Add completions for for build files#193
Conversation
The server now can provide completions for smithy-build.json and .smithy-project.json. The implementation works roughly the same as other node-like completions, using a new builtins model that specifies the structure of the build files. I also had to override the completion item mapper to make sure it wrapped object keys in strings, which is necessary in json.
yefrig
left a comment
There was a problem hiding this comment.
LGTM.
Tested in neovim v0.11. All completions work fine.
It might be nice to include a text edit with a comma if completing inside a list where the completion is not the last member of the list. But might be out of scope.
| } | ||
|
|
||
| structure MavenRepository { | ||
| @required |
There was a problem hiding this comment.
How are constraints used by the LS? Could we possibly add more constraints to save energy doing validations like urls etc
There was a problem hiding this comment.
They really aren't right now. Originally I intended to use them for validation, but I scrapped that idea to use the validation errors from smithy-build. However, with trait values, required members get autopopulated in completions, so maybe a future update could do that for node values too.
Nice. Yea that would be cool, maybe a future improvement |
The server now can provide completions for smithy-build.json and .smithy-project.json. The implementation works roughly the same as other node-like completions, using a new builtins model that specifies the structure of the build files. I also had to override the completion item mapper to make sure it wrapped object keys in strings, which is necessary in json.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.