yaml-language-server icon indicating copy to clipboard operation
yaml-language-server copied to clipboard

fix: doNotSuggest for property and value completion

Open p-spacek opened this issue 2 years ago • 5 comments

What does this PR do?

exclude doNotSuggest schema from autocompletion doNotSuggest was already there but implemented only for the simple object properties. This PR uses doNotSuggest also for other scenarios: anyOf, values

"anyOf":[
  {
     "$ref": "schema1",
     "doNotSuggest": true
   },
  {
     "$ref": "schema2",
   }
]

What issues does this PR fix or reference?

related to the previous unfinished PR for the deprecated property: https://github.com/redhat-developer/yaml-language-server/pull/833

Is it tested? How?

adds unit tests

p-spacek avatar Aug 10 '23 11:08 p-spacek

Hello @msivasubramaniaan, can I ask you for a review, please?

p-spacek avatar Sep 05 '23 11:09 p-spacek

We do inherit the doNotSuggest property from vscode json language service. As far as I can see on the JSON land it only applies to properties. Although I think this is an interesting usage of it.

@aeschli Is this something interesting for vscode json language service too?

gorkem avatar Oct 07 '23 17:10 gorkem

Yes, if you want to make a PR against the json-language-service that would be great. Note that doNotSuggest is internal and we don't want to advertise this. But if you can use it internally, why not.

aeschli avatar Oct 09 '23 07:10 aeschli

Coverage Status

coverage: 84.193% (+0.02%) from 84.174% when pulling 769f53ff488a7323a2601a8e9cb4a3763c0218fb on jigx-com:fix/doNotSuggest-for-property-and-value-completion into 7203630540f35c88731bcf03ac41ca90b5919125 on redhat-developer:main.

coveralls avatar Nov 06 '23 12:11 coveralls

Yes, if you want to make a PR against the json-language-service that would be great. Note that doNotSuggest is internal and we don't want to advertise this. But if you can use it internally, why not.

Hi, I created PR for this functionality https://github.com/microsoft/vscode-json-languageservice/pull/213 but I found a not-related issue probably, see the linked PR.

p-spacek avatar Nov 06 '23 12:11 p-spacek