-
Notifications
You must be signed in to change notification settings - Fork 41
Language server keep restarting indexing service? #32
Comments
@Yevgnen usually the way to go is to compare the lsp-mode -> LS communication with vscode -> LS communication. Although the protocol is standard the servers are tested and adjusted to work with vscode which is PITA for us(lsp-mode team). So it will will be very helpful for us if you can take a look and share your observations. |
@yyoncho Thanks for your advice. I've not figured out how to see the communication of vscode... But after a quick look of the language server logs of vscode
The |
@yyoncho Now I comment out this line(I have no idea about the meaning of the param and can not find it here), and it just seems works! The logs looks fine (no restarted logs and the configure looks empty):
and the analysis can be finished once
|
The param is not part of the spec but it is something specific for the microsoft language server. It is really hard for me to tell why this param fixes your issue. I tried using mspyls on my machine and it worked fine. Here it is the vscode configuration which we have to mimic: https://github.com/microsoft/vscode-python/tree/master/src/client/activation/languageServer There are a few initialization options that are missing, e. g.
I don't know whether some of these will fix your issue. AFAIK we have to do more work on this adapter to make it on par with vscode one. |
Do you try it in a virtualen? It only happens when I am using virtualenv...
…On Wed, Jun 26, 2019 at 22:17 Ivan Yonchovski ***@***.***> wrote:
@yyoncho <https://github.com/yyoncho> Now I comment out this line(I have
no idea about the meaning of the param and can not find it here), and it
just seems works!
The param is not part of the spec but it is something specific for the
microsoft language server. It is really hard for me to tell why this param
fixes your issue. I tried using mspyls on my machine and it worked fine.
Here it is the vscode configuration which we have to mimic:
https://github.com/microsoft/vscode-python/tree/master/src/client/activation/languageServer
There are a few initialization options that are missing, e. g.
:analysisUpdates t
:asyncStartup t
I don't know whether some of these will fix your issue. AFAIK we have to
do more work on this adapter to make it on par with vscode one.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#32?email_source=notifications&email_token=AD7ZJXXQKB3FYOFQGG4NJWLP4N3A7A5CNFSM4H3H5FKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYTVWLI#issuecomment-505895725>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AD7ZJXSCSBBBFB7XPXWH64DP4N3A7ANCNFSM4H3H5FKA>
.
|
@Yevgnen no, I didn't. I am not a python programmer and I am not very familiar with how they work and what is the expected behaviour when you are using such. |
After comment the line that @Yevgnen mentioned, my problem solved. The problem happens with some big python file, with no virtualenv, both in macos and windows. The problem is: Open a new file at first time, the completion, as well as jump to /back works smoothly. After some editing, something like "Reloading modules..." appears in lsp-log buffer, the source file is re-analyzed, then, some built-in modules such as sys, time are labels as "unresolved import", thus no completion , nor some other lsp related functions. There is no "Reloading modules..." issues in my lsp-log buffer, and everything works normally when the relevant line is commented. |
I think that I found out why this is happening: if you take a look here the microsoft pyls server code here: ... the server is restarting the analysis if some of the initial search paths have changed. IMO the issue is that the search path in emacs side is wrong and points to a file that changes very often and the result is that the analysis is cancelled too often. IMO if we delete searchPath argument we will lose some functionality so the correct fix is to unify the path calculation in lsp-mode and vscode. Here it is the corresponding piece of code in vscode: https://github.com/microsoft/vscode-python/blob/master/src/client/activation/languageServer/analysisOptions.ts#L129 |
@yyoncho I check the file https://github.com/microsoft/vscode-python/blob/master/src/client/activation/languageServer/analysisOptions.ts#L129 and start a debug session in vscode, there is some interesting observations,
|
@smallzhan thank you, are you interested in providing a PR to unify with what vscode does? |
Completion is almost not working when I'm using Microsoft's python language server. By 'almost', the
*Message*
printsLSP :: The task was cancelled.
most of the time and about 5% percentage of time I may get completions. I test it in vscode in the same virtualenv and the same language server binary, the analyzer run so fast (average < 5s on my MacBook Pro 2019) like thisThe same message can be found in the follow logs, but I notice the indexing service is keep restarting.
The content of the
*lsp-log*
buffer isand the content of
*lsp-log: mspyls:38548*
is here. Variablecompany-lsp-cache-candidates
is set to'auto
.I have no idea if the issue comes from
lsp-mode
orlsp-mode-ms
orcompany-lap
or the language server.@yyoncho Do you have any idea about this? Thank you very much.
The text was updated successfully, but these errors were encountered: