microsoft / vscode-languageserver-node

Language server protocol implementation for VSCode. This allows implementing language services in JS/TS running on node.js
MIT License
1.48k stars 324 forks source link

Overflow value(exceeding uinteger) passed into jsonrpc but still work #1574

Open He1pa opened 1 month ago

He1pa commented 1 month ago

The reason is that I found that the fmt feature of my lsp server cannot be used in IntelliJ, but it still work in vscode. After investigation, I found that I assigned a u32:Max to formatResponse.textedit.range.line in the format's Response I implemented the lsp server in rust, and u32 was used as the range type in rust's lsp-type, but the range of this value in lsp should be 0-2^31 -1. I think this is the cause of the problem

But I'm not sure whether vscode has special handling for this situation or just forgot to check

https://github.com/redhat-developer/lsp4ij/issues/579 https://github.com/kcl-lang/kcl/pull/1698

dbaeumer commented 1 month ago

VS Code doesn't currently have checking code for this.

rcjsuen commented 1 month ago

I ran into this as well. If VS Code detects this what should it do? 🤔

dbaeumer commented 4 weeks ago

The only way how we could handle this is IMO by returning it as a Response error and then report it on the other side via an Error.