-
Notifications
You must be signed in to change notification settings - Fork 770
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
Add user options {gopls,rls,tsserver,tern,...}_binary_path #1289
Comments
Hi. That is exactly what we're doing for TypeScript completer, though it was never documented. The reason why it wasn't documented is because we never claimed support for it. It was more aimed at developers. So let's be clear on what means to use the server from
In the past, the most severely outdated dependency was Let's discuss completer executable paths:
|
For now, a quick and untested patch for rust and go: diff --git a/ycmd/completers/go/go_completer.py b/ycmd/completers/go/go_completer.py
index a7cebc49..8100ba63 100644
--- a/ycmd/completers/go/go_completer.py
+++ b/ycmd/completers/go/go_completer.py
@@ -31,7 +31,7 @@ from ycmd.completers.language_server import ( simple_language_server_completer,
language_server_completer )
-PATH_TO_GOPLS = os.path.abspath( os.path.join( os.path.dirname( __file__ ),
+PATH_TO_GOPLS = utils.PathToFirstExistingExecutable( [ os.path.abspath( os.path.join( os.path.dirname( __file__ ),
'..',
'..',
'..',
@@ -43,7 +43,8 @@ PATH_TO_GOPLS = os.path.abspath( os.path.join( os.path.dirname( __file__ ),
'tools',
'cmd',
'gopls',
- utils.ExecutableName( 'gopls' ) ) )
+ utils.ExecutableName( 'gopls' ) ) ),
+ 'gopls' ] )
def ShouldEnableGoCompleter( user_options ):
diff --git a/ycmd/completers/rust/rust_completer.py b/ycmd/completers/rust/rust_completer.py
index 941cec4f..0f15c8b1 100644
--- a/ycmd/completers/rust/rust_completer.py
+++ b/ycmd/completers/rust/rust_completer.py
@@ -36,8 +36,8 @@ LOGFILE_FORMAT = 'rls_'
RLS_BIN_DIR = os.path.abspath(
os.path.join( os.path.dirname( __file__ ), '..', '..', '..', 'third_party',
'rls', 'bin' ) )
-RUSTC_EXECUTABLE = utils.FindExecutable( os.path.join( RLS_BIN_DIR, 'rustc' ) )
-RLS_EXECUTABLE = utils.FindExecutable( os.path.join( RLS_BIN_DIR, 'rls' ) )
+RUSTC_EXECUTABLE = utils.PathToFirstExistingExecutable( [ os.path.join( RLS_BIN_DIR, 'rustc' ), 'rustc' ] )
+RLS_EXECUTABLE = utils.PathToFirstExistingExecutable( [ os.path.join( RLS_BIN_DIR, 'rls' ), 'rls' ] )
RLS_VERSION_REGEX = re.compile( r'^rls (?P<version>.*)$' )
|
Awesome! With a quick test, the rust patch makes YCM work fine with the rust package [1] on Arch Linux.
Thanks for clarification. A
If the official packages are old, we can either ask Arch devs to update or create another AUR package to track the latest packages. For example rls-git [3] might be useful in case rls from the official rust package is too old. For Omnisharp-Roslyn, I'm fine to co-maintain the AUR package [4] in case its maintainer is too busy.
Thanks for the info. I haven't tested JDT.LS. I may re-add it as a submodule if using system binaries/libraries is not feasible.
Thanks for the tip! I will consider switch to such an approach.
That's a good news :) [1] https://www.archlinux.org/packages/extra/x86_64/rust/ |
Glad we're on the same page. My personal wish, which might not be shared by other YCM maintainers, is to eventually end up in a state where ycmd can be packaged outside of You might also be interested in additional LSP completers. We've made LSP completers pluggable, but...
|
As commented on another PR, I like the current clangd completer approach (as it was discussed at length when implemented). It drives a good trade-off between what we can support and flexibility we can provide. I think we should follow that approach at least for consistency. All the original discussion points for clangd apply to the other servers mentioned here. JDT.LS is a bit of a wildcard because we do sometimes see regressions or test issues, though they are not always strict jdt.ls bugs. Moreover, the way it is launched is fiddly and awkward (it's not just java ), including requiring the workspace dir etc. etc. etc. |
From a perspective of a packager, the Regarding pluggable language completers: the current status sounds horrible. I'd like to skip them in my package for now. |
Yeah, going with |
Great to know that :) |
Hi, I'm the current maintainer of neovim-youcompleteme-core-git [1] package on unofficial Arch User Repository (AUR). Recently @bstaletic reached out to me about fixing that package for language completers like gopls or rls. As I aim to provide a package that use system packages than bundled ones, could ycmd also look into
$PATH
for language completers? For example, checkrls
in$PATH
ifycmd/third_party/rls/bin/rls
is not found, andgopls
in$PATH
ifycmd/third_party/go/src/golang.org/x/tools/cmd/gopls/gopls
is not found.[1] https://aur.archlinux.org/packages/neovim-youcompleteme-core-git/
The text was updated successfully, but these errors were encountered: