Support defaultSnippets - #111
Conversation
jdesrosiers
left a comment
There was a problem hiding this comment.
I think the AnnotationEvaluationPlugin changes aren't going to be sufficient. See my comment below. Start by creating a test that illustrates the problem.
Please create a new file for these tests. I think this is a distinct feature and that's a good excuse to not pile onto a file that's already several thousand lines long.
jdesrosiers
left a comment
There was a problem hiding this comment.
I just realized that this should be its own CompletionProvider instead of adding to ValueCompletionProvider. I originally assumed it would be modifying the existing completions somehow, but that's not what's happening. It's just adding additional completions. So, there's no reason for them to be coupled.
390abb7 to
5c6fa17
Compare
|
Changes made:
|
There was a problem hiding this comment.
I push some clean up and fixed a bug that I noticed when fixing some positions in the tests.
I notice at this point that there there's a significant amount of duplication in the CompletionProviders. See if you can refactor to improve that situation. I think much of the duplication can move to Completions.
And please rebase as well.
|
I agree with you and I have some ideas for this one. |
|
The tests are passing for me locally, so it looks like we have a race condition bug again. 😢 |
|
No problem, I will track what went wrong |
|
Hi @jdesrosiers So I will study the changes in the last PR and try to find why is this one failing, and I will push the newest version of this current feature for your review. |
42af79b to
c589f54
Compare
|
Hi @jdesrosiers |
jdesrosiers
left a comment
There was a problem hiding this comment.
I changed the approach to addressing the code duplication problem.
I also used AI to fix a couple issues that I noticed. One was that the splitPointer function didn't escape the pointer segment. The other was filling in support for some keywords that were supported in the completions plugin and missed for annotations.
jdesrosiers
left a comment
There was a problem hiding this comment.
I think this is ready. It got complicated with the AnnotaitonsEvaluationPlugin upgrade, but I think that's going to enhance the user experience for every feature that relies on annotations.
Property names containing '/' or '~' were compared in their JSON Pointer escaped form, so additionalProperties and patternProperties matched them incorrectly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tionsEvaluationPlugin Add draft-04/items, unevaluatedProperties, and unevaluatedItems, and mark incomplete locations as evaluated so unevaluated* doesn't also apply to them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n's properties handler Incomplete properties aren't in the instance, so the core properties keyword never marks them evaluated and unevaluatedProperties applied to them too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(Pretty sure I introduced this. I've been letting AI do a little more lately and this time I didn't watch it closely enough.)
51df36a to
641e1ed
Compare
|
Yes, annotations upgrade will be useful for future features, and I think it is ready too |
Summary
This PR adds support for VS Code custom keyword
defaultSnippets.What changed
The VS Code keyword can provide the snippet body in multiple forms so the completion logic now handles each supported variant.
Tests
Closes #107