You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LSP formatting error: Message could not be parsed. #579
Could you give me the link to the vscode extension which uses the language servers and if you are using user defined languzge server , could yiu export it by sélecting the server in the lsp console with contextual menu and attach the zip. Thanks.
Could you give me the link to the vscode extension which uses the language servers and if you are using user defined languzge server , could yiu export it by sélecting the server in the lsp console with contextual menu and attach the zip. Thanks.
Is there any limitation when parsing TextEdit range? I used (0,0)-(u32:max, u32:max) when building Response, I guess the problem is here. After my test, it can be parsed normally when executing formmat range request (returning normal range), but it will fail when formatting the entire file (returning (0,0)-(u32:max, u32:max))
Is there any limitation when parsing TextEdit range? I used (0,0)-(u32:max, u32:max) when building Response, I guess the problem is here. After my test, it can be parsed normally when executing formmat range request (returning normal range), but it will fail when formatting the entire file (returning (0,0)-(u32:max, u32:max))
Well, I solved the problem. I set the new range to (0,0)-(u32:max, u32:max) and Gson didn't seem to parse the value correctly. I recalculated the range and everything worked fine.
Activity
He1pa commentedon Oct 17, 2024
In addition, it cannot be used in MacOS and Windows systems. However, except for format, other lsp features are work fine
angelozerr commentedon Oct 17, 2024
Could you give me the link to the vscode extension which uses the language servers and if you are using user defined languzge server , could yiu export it by sélecting the server in the lsp console with contextual menu and attach the zip. Thanks.
angelozerr commentedon Oct 17, 2024
You should see this error in the LSP console too, perhaps you will have more info?
And perhaps your LSP logs something, perhaps you have some info in Logs tab?
He1pa commentedon Oct 17, 2024
https://marketplace.visualstudio.com/items?itemName=kcl.kcl-vscode-extension
He1pa commentedon Oct 17, 2024
open file - format file


log:
traces:
I get the message of lsp server has finished format request, but no response
He1pa commentedon Oct 17, 2024
I think we meet an error from
lsp4ij/src/main/java/com/redhat/devtools/lsp4ij/features/formatting/LSPFormattingSupport.java
Line 57 in 67f8e68
or
lsp4ij/src/main/java/com/redhat/devtools/lsp4ij/features/formatting/LSPFormattingSupport.java
Line 64 in 67f8e68
But I don't know more details.
He1pa commentedon Oct 17, 2024
Is there any limitation when parsing TextEdit range? I used (0,0)-(u32:max, u32:max) when building Response, I guess the problem is here. After my test, it can be parsed normally when executing formmat range request (returning normal range), but it will fail when formatting the entire file (returning (0,0)-(u32:max, u32:max))
angelozerr commentedon Oct 17, 2024
You don"t see the LSP formatting response because LSP4J (not LSP4IJ) failed when it tries to parse the JSON response from your language server https://github.com/eclipse-lsp4j/lsp4j/blob/7ce4f59bb2781094a013180f1b72bd4301d3e361/org.eclipse.lsp4j.jsonrpc/src/main/java/org/eclipse/lsp4j/jsonrpc/json/MessageJsonHandler.java#L133
The only solution that I see to understand the problem is to know the response of the language server, perhaps by setting a breakpoint in https://github.com/eclipse-lsp4j/lsp4j/blob/7ce4f59bb2781094a013180f1b72bd4301d3e361/org.eclipse.lsp4j.jsonrpc/src/main/java/org/eclipse/lsp4j/jsonrpc/json/MessageJsonHandler.java#L133
He1pa commentedon Oct 17, 2024
Well, I solved the problem. I set the new range to (0,0)-(u32:max, u32:max) and Gson didn't seem to parse the value correctly. I recalculated the range and everything worked fine.
angelozerr commentedon Oct 17, 2024
where?
He1pa commentedon Oct 17, 2024
The format range in Response should be 0 to 2^31 - 1
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#baseTypes
In my LSP server implementation, I returned u32::max in the response, which exceeds this range. This may be the reason for the parse failure
fix pr: kcl-lang/kcl#1698
angelozerr commentedon Oct 17, 2024
Ok thanks for your feedback! That's strange that it works in vscode but not with LSP4J?