Skip to content

Fix rename ResponseError not being passed onto VSCode - #220

Closed
Jens Fischer (Gama11) wants to merge 1 commit into
microsoft:masterfrom
Gama11:patch-1
Closed

Jens Fischer (Gama11) wants to merge 1 commit into
microsoft:masterfrom
Gama11:patch-1

Conversation

@Gama11

Copy link
Copy Markdown
Contributor

I was trying to return a ResponseError from the rename method in the Haxe language server to display an error in the UI (like the TypeScript language server does in some siutations, example).

However, no matter what error code I used, the end result was always the same, VSCode displays "No result." and the language client just logs it to the output channel:

This is probably not a proper solution, and there might be other methods that are affected similarly, but it does fix my issue:

@dbaeumer

Copy link
Copy Markdown
Member

Gam11: thanks for the PR. However I fixed this differently since we usually avoid to throw with promises. The problem was that the code used Promise#resolve instead of Promise#reject.

@nadako

Copy link
Copy Markdown

That fix doesn't really help with the original issue - VS Code still shows "No result" instead of the error message from the server.

@dbaeumer

Copy link
Copy Markdown
Member

Seems to be a VS Code issue. Opened microsoft/vscode#37808

@Gama11

Copy link
Copy Markdown
Contributor Author

This is actually still an issue with VSCode 1.21.0 and vscode-languageclient 4.0.0:

I'm not sure which of the two is at fault, but this error shows up in the dev console after a failed rename:

I gave your test case from microsoft/vscode#37808 a try, and that works as expected.

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

Successfully merging this pull request may close these issues.

5 participants