Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: codeCompletion-with-defaultSnippet-and-makdown #385

Conversation

p-spacek
Copy link
Contributor

@p-spacek p-spacek commented Jan 4, 2021

What does this PR do?

enable defaultSnippet markdown description in schemas for code completion service

What issues does this PR fix or reference?

when schema has defaultSnippet and markdown description parameter set, jsonCompletion will ignores this markdown description because of undefined parameter supportsMarkdown

Is it tested? How?

added unit-test

@coveralls
Copy link

coveralls commented Jan 4, 2021

Coverage Status

Coverage increased (+0.08%) to 81.154% when pulling 95f977c on p-spacek:fix/codeCompletion-with-defaultSnippet-and-makdown into 9013b60 on redhat-developer:master.

Copy link
Contributor

@JPinkney JPinkney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we will probably have to check the client capabilities similar to how vscode-json-languageservice does it: https://github.com/microsoft/vscode-json-languageservice/blob/36f8016a33df9eff3b6edd584605aea349b73745/src/services/jsonCompletion.ts#L968. Just to make sure that the client supports markdown before setting supportsMarkdown = true

 - copy functionality from original yaml-service
@p-spacek
Copy link
Contributor Author

p-spacek commented Jan 5, 2021

You are absolutely right!

So I used functionality from original json-service.
But I'm not sure if it safe to move initialization of customLanguageService = getCustomLanguageService into connection.onInitialize(

src/server.ts Outdated Show resolved Hide resolved
p-spacek and others added 2 commits January 8, 2021 10:58
 - first init with Capabilities.LATEST
src/server.ts Outdated Show resolved Hide resolved
@JPinkney JPinkney merged commit 0098020 into redhat-developer:master Jan 11, 2021
@p-spacek p-spacek deleted the fix/codeCompletion-with-defaultSnippet-and-makdown branch January 11, 2021 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants