Comments (4)
Strange, I am pretty sure I had only the lines I posted above in my coc-settings file. But maybe I had at that time,
somewhere else in the vim config a line confusing things, or a typo error in the coc config file... I reinstall several
times coc-perl, maybe something got wrong at some point, a cache was'nt cleared somewhere or I don't know...
Hmm, one thing I changed in the version I released yesterday was the way "workspace" CoC configuration files were being created after some options lookup/update. Maybe you had a $workspaceFolder/.vim/coc-settings.json
in your local folder, creating by coc-perl, with one server enabled while your user config file (the one when you :CocConfig
) had another. Idk, but...
But anyway, I reinstalled everything today in exactly 36 seconds and everything works! The steps I did 1) write
:CocConfig, 2) install coc-perl, 3) :CocRestart.
I'm really glad it worked :)
Now, on the docs front... thanks once again! I'll try to reduce some of the verbosity and check where I can simplify other things. About recommending PerlNavigator, personally, I also prefer using it, but people has said that Perl::LanguageServer has a really nice integration with Perl's debugger (which PerlNavigator lacks). But I've used nvim-dap + vscode-perl-debug for integrating nvim with the debugger.
from coc-perl.
@Twix53791 thanks for the detailed report and also for the criticism, which is a really valuable one! I'll make sure to use as basis for a complete overview of our doc and possibly ping PerlNavigator and Perl::LanguageServer maintainers to do the same.
To the issue now:
First, just to give you a quick context, coc.nvim was written before nvim had its official support for language servers, but in the past releases nvim has improved quite a lot on the LSP world and one day (not really soon though) it should become the de fact standard for LSP on nvim, however, coc.nvim doesn't lag behind on features or something like that, I would even say that's the contrary :). BUT, that's why you could get PerlNavigator working without coc-perl, the first snippet you pasted is indeed to way to get PerlNavigator configured without coc.nvim.
When I tried to install coc-config and write the piece of config code recommanded, I run in this issue:
The error message you saw in your coc log output, ... ERROR ... [extension:coc-perl] - coc-perl activated, but more than one server enabled
, means you had both PerlNavigator and Perl::LanguageServer .enable
option set to true
in the configuration file, eg. (using the our default notation for each server):
{
"perl.navigator.enable": true,
"perl.p::ls.enable": true
}
And as said in the docs, only one must be enabled at a time, otherwise the extension will only terminate and nothing will indeed work. I could set a default "winner" for such cases, but I don't think it's fair to any of the servers. One option, though, would to give the user the option to choose one of them in case both are enabled... like in a floating window.. hmm.. I'm going to think about it.
I was thinking they were installed automatically like the read me says: "In the current version of coc-perl, both
supported language servers are automatically installed in case you don't have it already, meaning you only need
to define which server you want to enable in CoC configuration." But in fact not isn't it?
Ooh, I just found where things fell off the rails... the installation process requires you to have already enabled one of the servers in coc-settings.json to then install the server you chose. For intance, after installing coc.nvim and coc-perl, the user (you) opens :CocConfig
and add "perl.navigator.enabled": true
or "perl.p::ls.enable": true
, thus the next time you open a Perl file, or after a :CocRestart
, coc-perl
would take over and install the server you chose to enable in the coc configuration file.
Ok, I already know where to modify in the docs for getting it more clear, even more for those not aware of how LSP or CoC actually works. Also, I'll think about adding a "floating window" for the user to choose the language server he wants to use with coc-perl.
from coc-perl.
@Twix53791 PR #38 brought the fix for issue #35 and also addressed some of your concerns around documentation. Unfortunately the longer the doc gets, the less people will read it, so I made sure to make small tweaks and add a specific section related to the automatic server installation process.
EDIT: in case you think that's not enough, please feel free to reopen this issue and I'll be glad to discuss how to further improve the docs.
Now, wrt the floating window to let the user choose which server he wants, demands a more in-depth study of UI's API, even more considering VIM UI is different from NeoVIM's one. But that's something in my TODO already.
from coc-perl.
Hi, thank you @bmeneg for your deep concern with this issue!
Ooh, I just found where things fell off the rails... the installation process requires you to have already enabled one of the servers in coc-settings.json to then install the server you chose.
Ok, well I understand the first problem I had. The former doc wasn't clear on this point!
The error message you saw in your coc log output, ... ERROR ... [extension:coc-perl] - coc-perl activated, but more than one server enabled, means you had both PerlNavigator and Perl::LanguageServer .enable option set to true in the configuration file, eg. (using the our default notation for each server)
Strange, I am pretty sure I had only the lines I posted above in my coc-settings file. But maybe I had at that time, somewhere else in the vim config a line confusing things, or a typo error in the coc config file... I reinstall several times coc-perl, maybe something got wrong at some point, a cache was'nt cleared somewhere or I don't know...
But anyway, I reinstalled everything today in exactly 36 seconds and everything works! The steps I did 1) write :CocConfig, 2) install coc-perl, 3) :CocRestart.
About the changes you did in the doc, it is better obviously, but I think it can be even better. Too verbose I think. We don't need all this explaination about the "Configurations properties", it make things look like complicated whereas they are not. If you want to keep this block, maybe put it after the "Enabling one server". I think, also, you could recommand to use perl navigator and put is as first choice. I think its less prone to bug than Perl LSP and moreover, yesterday I saw the cpan install of perl LSP, its complilation is huge! A complicated thing than this package I guess...
from coc-perl.
Related Issues (12)
- Image
- Help please. HOT 12
- LSP server crashes when opening two different perl files in neovim HOT 2
- [coc.nvim] The "perl" server crashed 4 times in the last 3 minutes. The server will not be restarted. HOT 2
- Update perl-languageserver to support perl.disableCache HOT 5
- Please help getting started HOT 9
- Messages not being displayed HOT 13
- Error on notification jumpDefinition HOT 27
- Add support for PerlNavigator HOT 6
- Consider adding Perl support to Wansmer/treesj HOT 1
- Cannot assign to read only property 'p::ls' of object '#<Object>' HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coc-perl.