Skip to content
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

Frequent "Request textDocument failed." popups #91

Open
tomazf1 opened this issue Aug 13, 2024 · 4 comments
Open

Frequent "Request textDocument failed." popups #91

tomazf1 opened this issue Aug 13, 2024 · 4 comments

Comments

@tomazf1
Copy link

tomazf1 commented Aug 13, 2024

When I'm editing nim source file in vs code, I'm getting frequent "Request textDocument/codeAction failed.", "Request textDocument/inlayHint failed." or "Request textDocument/documentSymbol failed." popups.
This is very annoying.

Versions:
OS: linux debian sid
nim: 2.0.8
nimlangserver: 1.4.0
vscode-nim: 1.0.2

@lewisl
Copy link

lewisl commented Aug 19, 2024

I have a version of this problem, too.

Versions:
OS: macosx 14.6.1 (23G93)
nim: 2.0.8
nimlangserver: 1.4.0
vscode-nim: 1.0.2

I can send the problem message, but it is about 2 pages every time it fails. let me know if you need the log.

My config looks like this:

within settings:

 ...
"[nim]": {
      "editor.tabSize": 2,
     "editor.indentSize": 2,
    "editor.autoIndent": "full",
},
"nim.nimprettyIndent": 2,
"nim.nimprettyMaxLineLen": 100,
"nimlangserver.trace.server": "messages",
"nim.buildOnSave": false,
"nim.buildCommand": "c -d:release --mm:orc --opt:speed --outdir:bin",
"nim.lintOnSave": true,
"nim.project": [],
...

Note: I am not using nim.projectMapping because it seems like I shouldn't have to.

Since the problem I have added:
"nim.provider": "lsp" -> but this is deprecated with the message "Deprecated. Please use the lsp backend.: But, this appears to be exactly what I am requesting. Note that this setting is still documented and there appears to be no other way to request the lsp. Ah, that is the default so I removed this setting.
Note also that I have NOT installed any of the lsp plugins for nim as that appears to be unnecessary and a duplication of what this plugin does.
I also removed "nim.project": [] as this is the default and should be unnecessary.

I also set nimlangserver.trace.server to "off", which might just suppress all the nasty messages.

After this I got the status message: Restarting nimsuggest for . This went on forever and it never started.

So, let me know if I have done the setup correctly as there still seems to be a problem.

lsp was supposed to improve the nimsuggest restart problem but it seems to have made it far worse. I never had a problem with Saem's plugin. The new fork seems to be a step in the wrong direction (YMMV)

@lewisl
Copy link

lewisl commented Aug 19, 2024

I think restarting vs code after all of the above changes may have solved the problem.

New problem nimsuggest is finding problems with:
math.nim
typedthreads.nim
gc.nim

Nothing I can do about this...

@ursetto
Copy link

ursetto commented Aug 20, 2024

I'm getting this too, along with duplicated errors (i.e. each error message in "Problems" occurs twice). The only difference between the errors is one shows nim(nimsuggest chk) and the other does not show this.

I solved this by turning on "Use Nimsuggest Check", causing only the nim(nimsuggest chk) error variant to show up. I'm not sure what this does, or if this is a bug where both variants are accidentally enabled when this box is not checked, but it stops the problem for me.

edit: It did not solve the popup problem. The errors are no longer duplicated, but it's still crashing most (but not all) of the time with

[Error - 12:40:02 AM] Request textDocument/codeAction failed.
  Message: textDocument/codeAction raised an exception: Server crashed/socket closed.
  Code: -32000 

nimlangserver: 1.4.0
nim: 2.0.8
OS: macOS Sonoma 14.4.1

@lewisl
Copy link

lewisl commented Aug 21, 2024

I am going back to nimsaem's plugin: it works. Until this gets resolved.

Or can I not use the lsp at all and just use the nimsuggest that the compiler provides?

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

3 participants