-
Notifications
You must be signed in to change notification settings - Fork 773
[READY] Generic LSP completer #1245
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
Conversation
0a49839
to
46e3e21
Compare
Codecov Report
@@ Coverage Diff @@
## master #1245 +/- ##
==========================================
+ Coverage 97.14% 97.15% +0.01%
==========================================
Files 95 96 +1
Lines 7343 7376 +33
Branches 153 153
==========================================
+ Hits 7133 7166 +33
Misses 169 169
Partials 41 41 |
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.
We probably need to update the README. We should at least to say what the 'language' parameter would be for extra conf.
I think this is neat. We could create a wiki page on the repo that says those servers known to work but are considered "unsupported" in the sense that we'll support with best-efforts only.
Thanks for doing this. It was always in the back of my mind to do something like this with LSP.
Reviewed 9 of 9 files at r1.
Reviewable status: 1 of 2 LGTMs obtained (waiting on @bstaletic)
run_tests.py, line 322 at r1 (raw file):
old_cwd = os.getcwd() os.chdir( os.path.join( DIR_OF_THIRD_PARTY, 'generic_server' ) ) npm = FindExecutableOrDie( 'npm', 'npm is required to install TSServer.' )
We're not installing TSServer ?
run_tests.py, line 325 at r1 (raw file):
with open( os.devnull, 'w' ) as devnull: subprocess.check_call( [ npm, 'install' ], stdout = devnull,
what's the reason for this forced redirect ? If there are installation errors (e.g. proxy error or something), it will be tricky to debug. I'm not against the extra console output personally.
third_party/generic_server/out/server.js, line 4 at r1 (raw file):
/* -------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information.
is this compatible with our GPL license ? Only asking because I haven't checked.
Out of interest, can we get this from npm too like we did with tern? I.e. just put it in as a dependency in package.json ?
ycmd/server_state.py, line 38 at r1 (raw file):
if lsp_cmdline is not None: return generic_lsp_completer.GenericLSPCompleter( user_options, filetype, lsp_cmdline )
Any expectation that we might want to supply more than the command line here? e.g. should we tempt YAGNI and make it a dict like:
{
"language_server": {
"generic_ls": {
"command_line": [ "thing", "here" ],
}
}
}
That would possibly allow us to add, say environment variables or something in future.
46e3e21
to
458d0bb
Compare
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.
Reviewable status: 0 of 2 LGTMs obtained (and 1 stale) (waiting on @micbou and @puremourning)
run_tests.py, line 322 at r1 (raw file):
Previously, puremourning (Ben Jackson) wrote…
We're not installing TSServer ?
Done.
run_tests.py, line 325 at r1 (raw file):
Previously, puremourning (Ben Jackson) wrote…
what's the reason for this forced redirect ? If there are installation errors (e.g. proxy error or something), it will be tricky to debug. I'm not against the extra console output personally.
I thought it was annoying to see it every time you run the tests, even if you don't intend to run these tests.
Anyway, redirection dropped.
third_party/generic_server/out/server.js, line 4 at r1 (raw file):
is this compatible with our GPL license ? Only asking because I haven't checked.
MIT license is GPL-compatible as far as I know.
Out of interest, can we get this from npm too like we did with tern? I.e. just put it in as a dependency in package.json ?
I don't know because I don't know how package.json
. I mean I could write a simple package.json
, but what do i put in "dependencies"
list? I got the example server from here:
https://github.com/microsoft/vscode-extension-samples/tree/master/lsp-sample/server
ycmd/server_state.py, line 38 at r1 (raw file):
Previously, puremourning (Ben Jackson) wrote…
Any expectation that we might want to supply more than the command line here? e.g. should we tempt YAGNI and make it a dict like:
{ "language_server": { "generic_ls": { "command_line": [ "thing", "here" ], } } }That would possibly allow us to add, say environment variables or something in future.
@micbou mentioned something similar in gitter. My argument was basically YAGNI and "support on best effort basis".
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.
Reviewable status: 1 of 2 LGTMs obtained (waiting on @puremourning)
third_party/generic_server/out/server.js, line 4 at r1 (raw file):
Previously, bstaletic (Boris Staletic) wrote…
is this compatible with our GPL license ? Only asking because I haven't checked.
MIT license is GPL-compatible as far as I know.
Out of interest, can we get this from npm too like we did with tern? I.e. just put it in as a dependency in package.json ?
I don't know because I don't know how
package.json
. I mean I could write a simplepackage.json
, but what do i put in"dependencies"
list? I got the example server from here:https://github.com/microsoft/vscode-extension-samples/tree/master/lsp-sample/server
I suppose we could just clone the whole thing with:
{
"description": "Runtime area for LSP sample server",
"dependencies": {
"lsp-sample-server": "microsoft/vscode-extension-samples"
}
}
But tbh this is probably fine. It allows us to fiddle with it anyway.
ycmd/server_state.py, line 38 at r1 (raw file):
Previously, bstaletic (Boris Staletic) wrote…
@micbou mentioned something similar in gitter. My argument was basically YAGNI and "support on best effort basis".
Sure. We can always do if issuance (..., dict):
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.
Reviewed 1 of 1 files at r2.
Reviewable status: 1 of 2 LGTMs obtained
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.
Reviewable status: 1 of 2 LGTMs obtained
third_party/generic_server/out/server.js, line 4 at r1 (raw file):
Previously, puremourning (Ben Jackson) wrote…
I suppose we could just clone the whole thing with:
{ "description": "Runtime area for LSP sample server", "dependencies": { "lsp-sample-server": "microsoft/vscode-extension-samples" } }But tbh this is probably fine. It allows us to fiddle with it anyway.
The reason I put the actual source of the server in the repo was to avoid having microsoft/vscode-extension-samples
a git submodule.
If you want me to, I can write the package.json
and fix the paths. It would save a few MBs for the users.
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.
Reviewable status: 1 of 2 LGTMs obtained
third_party/generic_server/out/server.js, line 4 at r1 (raw file):
Previously, bstaletic (Boris Staletic) wrote…
The reason I put the actual source of the server in the repo was to avoid having
microsoft/vscode-extension-samples
a git submodule.If you want me to, I can write the
package.json
and fix the paths. It would save a few MBs for the users.
Nah I think what you have is probably the best compromise. The whole repo is kinda large, and npm cloning it wasn't quick on my machine, so having a copy is fine. It also means that we can use this code to hack test scenarios if we want to. I'm cool with it.
458d0bb
to
c5668d3
Compare
Merge conflicts solved. |
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.
Reviewed 3 of 3 files at r3.
Reviewable status: 1 of 2 LGTMs obtained
c5668d3
to
6a42c7e
Compare
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.
Updated with the changes requested in gitter.
This now supports servers that target multiple filetypes.
Reviewable status: 0 of 2 LGTMs obtained (and 1 stale) (waiting on @puremourning)
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.
Reviewed 5 of 5 files at r4.
Reviewable status: 1 of 2 LGTMs obtained
6a42c7e
to
a6595a5
Compare
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.
Finally! A green build!
Reviewable status: 0 of 2 LGTMs obtained (and 1 stale) (waiting on @puremourning)
Let's go. |
Thanks for your patience! |
Thanks for sending a PR! |
ycm-core/ycmd#1275 Remap python GoTo* commands ycm-core/ycmd#1274 Migrate to Omnisharp-Roslyn ycm-core/ycmd#1239 Error ID in diagnostic messages ycm-core/ycmd#1267 Clangd extra conf support ycm-core/ycmd#1266 JDT update to 0.40.0 ycm-core/ycmd#1245 Generic (pluggable) LSP completer support ycm-core/ycmd#1263 Support JDT extensions ycm-core/ycmd#1261 Typescript update ycm-core/ycmd#1264 [vimspector](/puremourning/vimspector) configuration ycm-core/ycmd#1262 Multi-user installation ycm-core/ycmd#1243 Migrate to GOPLS ycm-core/ycmd#1249 Support MSVC 16 (VS2019) ycm-core/ycmd#1224 Migrate to RLS
ycm-core/ycmd#1275 Remap python GoTo* commands ycm-core/ycmd#1274 Migrate to Omnisharp-Roslyn ycm-core/ycmd#1239 Error ID in diagnostic messages ycm-core/ycmd#1267 Clangd extra conf support ycm-core/ycmd#1266 JDT update to 0.40.0 ycm-core/ycmd#1245 Generic (pluggable) LSP completer support ycm-core/ycmd#1263 Support JDT extensions ycm-core/ycmd#1261 Typescript update ycm-core/ycmd#1264 [vimspector](/puremourning/vimspector) configuration ycm-core/ycmd#1262 Multi-user installation ycm-core/ycmd#1243 Migrate to GOPLS ycm-core/ycmd#1249 Support MSVC 16 (VS2019) ycm-core/ycmd#1224 Migrate to RLS
ycm-core/ycmd#1275 Remap python GoTo* commands ycm-core/ycmd#1274 Migrate to Omnisharp-Roslyn ycm-core/ycmd#1239 Error ID in diagnostic messages ycm-core/ycmd#1267 Clangd extra conf support ycm-core/ycmd#1266 JDT update to 0.40.0 ycm-core/ycmd#1245 Generic (pluggable) LSP completer support ycm-core/ycmd#1263 Support JDT extensions ycm-core/ycmd#1261 Typescript update ycm-core/ycmd#1264 [vimspector](/puremourning/vimspector) configuration ycm-core/ycmd#1262 Multi-user installation ycm-core/ycmd#1243 Migrate to GOPLS ycm-core/ycmd#1249 Support MSVC 16 (VS2019) ycm-core/ycmd#1224 Migrate to RLS
ycm-core/ycmd#1275 Remap python GoTo* commands ycm-core/ycmd#1274 Migrate to Omnisharp-Roslyn ycm-core/ycmd#1239 Error ID in diagnostic messages ycm-core/ycmd#1267 Clangd extra conf support ycm-core/ycmd#1266 JDT update to 0.40.0 ycm-core/ycmd#1245 Generic (pluggable) LSP completer support ycm-core/ycmd#1263 Support JDT extensions ycm-core/ycmd#1261 Typescript update ycm-core/ycmd#1264 [vimspector](/puremourning/vimspector) configuration ycm-core/ycmd#1262 Multi-user installation ycm-core/ycmd#1243 Migrate to GOPLS ycm-core/ycmd#1249 Support MSVC 16 (VS2019) ycm-core/ycmd#1224 Migrate to RLS
ycm-core/ycmd#1275 Remap python GoTo* commands ycm-core/ycmd#1274 Migrate to Omnisharp-Roslyn ycm-core/ycmd#1239 Error ID in diagnostic messages ycm-core/ycmd#1267 Clangd extra conf support ycm-core/ycmd#1266 JDT update to 0.40.0 ycm-core/ycmd#1245 Generic (pluggable) LSP completer support ycm-core/ycmd#1263 Support JDT extensions ycm-core/ycmd#1261 Typescript update ycm-core/ycmd#1264 [vimspector](/puremourning/vimspector) configuration ycm-core/ycmd#1262 Multi-user installation ycm-core/ycmd#1243 Migrate to GOPLS ycm-core/ycmd#1249 Support MSVC 16 (VS2019) ycm-core/ycmd#1224 Migrate to RLS
With this PR plugging a new server for testing is as simple as sending
language_server = { $LANGUAGE: [ $SERVER_COMMANDLINE ] }
.The server that is plugged in this way can do everything the
SimpleLSPCompleter
can by default, but also providesGetHover
subcommand to the user. It doesn't try to be smart about it and just returns{ 'message': self.GetHoverResponse( request_data ) }
.The testing was done with Microsoft's sample implementation of the server which does't support the hover request.
This change is