-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
vscode-json-languageserver support #4164
Conversation
VSCode JSON languageserver has schema support for linting and completions. I have enabled snippets support (`snippetSupport`) even if it is not fully supported. `label` that comes with completions response can be used as well.
Please do not merge yet. I want to investigate some alternatives. |
vscode-json-languageserver is more up-to-date (about 1 year old), vscode-json-languageserver-bin is 4 years old.
Now everything is good. |
@hsanson it is not WIP anymore 😄 Unless you have some ideas what can be improved. |
autoload/ale/lsp.vim
Outdated
@@ -412,7 +412,7 @@ function! s:SendInitMessage(conn) abort | |||
\ 'completion': { | |||
\ 'dynamicRegistration': v:false, | |||
\ 'completionItem': { | |||
\ 'snippetSupport': v:false, | |||
\ 'snippetSupport': v:true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunatelly I think this needs more evaluation. I did some tests and when this is enabled ALEImport breaks for me.
If enablinb snippetSupport is not critical for vscodejson I would recommend reverting this to get vscodejson merged and then handle adding snippetSupport on a separate issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely not critical. Let me fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hsanson BTW, how ALEImport breaks for you? What filetype you were workin on? I want to reproduce the problem and see if there is a fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simple Java HelloWorld.java managed via Gradle and using eclipselsp:
public class HelloWorld {
public static void main(String[] argv) {
LocalDate today = LocalDate.now();
System.out.println("Hello gradle world at " + today);
}
}
- Put the cursos in LocalDate class and invoke :ALEImport.
- ALE should add the import statement "import java.time.LocalDate" at the beginning of the file.
- With the snippetSupport enabled this does not work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good.
* vscode-json-languageserver-bin support VSCode JSON languageserver has schema support for linting and completions. I have enabled snippets support (`snippetSupport`) even if it is not fully supported. `label` that comes with completions response can be used as well. * Test fix. * vscode-json-languageserver instead of vscode-json-languageserver-bin vscode-json-languageserver is more up-to-date (about 1 year old), vscode-json-languageserver-bin is 4 years old. * Use git root. * Documentation update. * Trying to sort ordering issue. * One more attempt * One more attempt * Uppercase seems to win. * Clean-up * Clean-up 2 * Test removed.
* vscode-json-languageserver-bin support VSCode JSON languageserver has schema support for linting and completions. I have enabled snippets support (`snippetSupport`) even if it is not fully supported. `label` that comes with completions response can be used as well. * Test fix. * vscode-json-languageserver instead of vscode-json-languageserver-bin vscode-json-languageserver is more up-to-date (about 1 year old), vscode-json-languageserver-bin is 4 years old. * Use git root. * Documentation update. * Trying to sort ordering issue. * One more attempt * One more attempt * Uppercase seems to win. * Clean-up * Clean-up 2 * Test removed.
VSCode JSON languageserver has schema support for linting and
completions.
I have enabled snippets support (
snippetSupport
) even if it is notfully supported.
label
that comes with completions response can beused as well.