-
Notifications
You must be signed in to change notification settings - Fork 200
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
Tolerate other keys in textDocument/documentSymbol #138
Conversation
Some LSP servers such as solargraph send additional keys in the response to `textDocument/documentSymbol` requests. Thus, the extraneous keys must be ignored.
I don't know what the standard says about this bit, but you could also convince Solargraph's devs to not break the spec (in case it is breaking the specs). That said, perhaps some macros based on In case Solargraph isn't breaking the spec, ignore this whole rant :-) |
Don't know TypeScript much, but I feel even if they do not, it is reasonable to allow excess properties not specified in the interfaces. |
As @MaskRay mentions, In any case, ignoring unknown fields would be a pragmatic decision in a world of decidedly less than ideal implementations of the protocol, especially if the alternative is breaking altogether (as happened in this case — the imenu integration doesn't work at all with solargraph without this fix or similar). Do feel free to close this PR in favor of a better solution. This seemed like the least invasive and most pragmatic solution to me. |
Should be fixed, please test it and report here. For the record, I think the best way to address this is to make |
I confirm it's fixed now, thank you @joaotavora!
I agree, that does sound like a better solution. |
* eglot.el (xref-backend-identifier-completion-table) (eglot-imenu): Accept and ignore "deprecated"
* eglot.el (xref-backend-identifier-completion-table) (eglot-imenu): Accept and ignore "deprecated"
* eglot.el (xref-backend-identifier-completion-table) (eglot-imenu): Accept and ignore "deprecated" #138: joaotavora/eglot#138
* eglot.el (xref-backend-identifier-completion-table) (eglot-imenu): Accept and ignore "deprecated" GitHub-reference: fix joaotavora/eglot#138
Some LSP servers such as solargraph may send additional keys in the response to
textDocument/documentSymbol
requests, causing errors such as the following:The corresponding code in solargraph is the following: https://github.com/castwide/solargraph/blob/db06853eff05bb597a40babc78844524bea29139/lib/solargraph/language_server/message/text_document/document_symbol.rb
Thus, the extraneous keys must be ignored.