redhat-developer / yaml-language-server

Language Server for YAML Files
MIT License
1.1k stars 264 forks source link

fix: doNotSuggest for property and value completion #911

Open p-spacek opened 1 year ago

p-spacek commented 1 year ago

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 commented 1 year ago

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

gorkem commented 1 year ago

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?

aeschli commented 1 year ago

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.

coveralls commented 1 year ago

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.

p-spacek commented 1 year ago

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.