是否可以使用 Eclipse 自动完成 JSON 模式和文档?
Is it possible to have JSON schema autocomplete and documentation with eclipse?
我有一个巨大的 JSON 安装文件用于我的一个项目。我想通过 JSON 架构编写一些文档和验证规则,以便不熟悉它的人更容易编辑此文件。
我希望能够在 Eclipse 中打开 json 安装文件,并通过智能感知自动完成 json 属性。我还想在鼠标悬停时查看任何 json 设置 属性 的文档注释。
我找不到关于此功能的任何类型的文档。这可以用 Eclipse 实现吗?
我会回答我自己的问题,因为我发现方法很简单而且效果很好。
所以,
· Having a test.json file which contains the setup of your project which
you want to get autocomplete features on
· Having a c:\test.schema.json file which contains the schema for your
setup file
在eclipse上激活此功能的步骤是:
1- Open eclipse
2- go to "Window > Preferences: JSON > JSON Catalog"
3- add a new entry with "test.json" as the file and
"file:/c:/test.schema.json" as the URL
4- enable syntax and schema validation under "Window > Preferences:
JSON > JSON Files > Validation"
5- Apply the changes
6- Open the test.json file with eclipse and check that ctrl + space performs autocomplete
我发现这个过程中唯一乏味的部分是 每次 json 架构文件被修改时,您必须再次转到 "Window > Preferences: JSON > JSON Catalog" 并应用再次更改以刷新新值
我有一个巨大的 JSON 安装文件用于我的一个项目。我想通过 JSON 架构编写一些文档和验证规则,以便不熟悉它的人更容易编辑此文件。
我希望能够在 Eclipse 中打开 json 安装文件,并通过智能感知自动完成 json 属性。我还想在鼠标悬停时查看任何 json 设置 属性 的文档注释。
我找不到关于此功能的任何类型的文档。这可以用 Eclipse 实现吗?
我会回答我自己的问题,因为我发现方法很简单而且效果很好。
所以,
· Having a test.json file which contains the setup of your project which you want to get autocomplete features on
· Having a c:\test.schema.json file which contains the schema for your setup file
在eclipse上激活此功能的步骤是:
1- Open eclipse
2- go to "Window > Preferences: JSON > JSON Catalog"
3- add a new entry with "test.json" as the file and "file:/c:/test.schema.json" as the URL
4- enable syntax and schema validation under "Window > Preferences: JSON > JSON Files > Validation"
5- Apply the changes
6- Open the test.json file with eclipse and check that ctrl + space performs autocomplete
我发现这个过程中唯一乏味的部分是 每次 json 架构文件被修改时,您必须再次转到 "Window > Preferences: JSON > JSON Catalog" 并应用再次更改以刷新新值