Skip to content

How to switch language server on the fly? #140

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

Closed
TxHawks opened this issue Oct 2, 2017 · 3 comments
Closed

How to switch language server on the fly? #140

TxHawks opened this issue Oct 2, 2017 · 3 comments

Comments

@TxHawks
Copy link

TxHawks commented Oct 2, 2017

Is there a way to switch the language server that is being used on the fly?

When editing javascript files, I find myself mostly wanting to use javascript-typescript-stdio, but switch to flow-language-server in projects where I use Flow.

Is that possible? Couldn't find anything relevant in the documentation or issues other than a reference to LanguageClient_registerServerCommands in #136 (comment), but not sure how to use it, or if it is even the right solution.

@TxHawks TxHawks changed the title How to switch language server on the fly How to switch language server on the fly? Oct 2, 2017
@autozimu
Copy link
Owner

autozimu commented Oct 2, 2017

You can put settings like this in a local vimrc file

call LanguageClient_registerServerCommands({'javascript':['path-to-server']})

And use a plugin to load load vimrc file.

Obviously you can do this manually without a plugin, just run the command before executing :LanguageClientStart.

@autozimu autozimu closed this as completed Oct 4, 2017
@TxHawks
Copy link
Author

TxHawks commented Oct 7, 2017

@autozimu
I get Ambiguous use of user-defined command when trying to run
:call LanguageClient_registerServerCommands({'javascript':['path-to-server']})

and indeed, :commands lists only LanguageClientStop and LanguageClientStart

@autozimu
Copy link
Owner

autozimu commented Oct 8, 2017

LanguageClient_registerServerCommands is a function, not a command.

Not sure what happened on your side, but I tried the steps and see no errors. If you believe you found an issue, please create new bug report. Cannot help much without detail information.

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

No branches or pull requests

2 participants