This repository was archived by the owner on Jul 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 283
This repository was archived by the owner on Jul 31, 2023. It is now read-only.
Language server doesn't like a particular line of code #693
Copy link
Copy link
Closed
Labels
bugBug reportsBug reports
Description
Your environment
vscode-rubyversion: 0.28.0- Ruby version: 2.7.2
- Ruby version manager (if any): asdf
- VS Code version: 1.52.1
- Operating System: macOS 11.1
- Using language server? (eg
useLanguageServeris true in your configuration?) yes
Expected behavior
- Letting me view my Terminal while I work
Actual behavior
- The actual extension functionality seems to work fine, but after I view a certain file, every time I click anywhere in Ruby file, my Terminal is switched to Output, which is incredibly disruptive (is there a way to switch that off perhaps?). Under Output, I see something like the following, which, according to my Google searches, is just generic extension errors:
Initializing Ruby language server...
TypeError: Cannot read property 'apply' of undefined
at t.<computed> (/Users/anamba/.vscode/extensions/rebornix.ruby-0.28.0/dist/server/index.js:16:235186)
at <anonymous>:wasm-function[20]:0x908
at <anonymous>:wasm-function[19]:0x4a8
at <anonymous>:wasm-function[80]:0x15c68
at <anonymous>:wasm-function[129]:0x25fcc
at ts_parser_parse_wasm (<anonymous>:wasm-function[248]:0x2d59c)
at he.parse (/Users/anamba/.vscode/extensions/rebornix.ruby-0.28.0/dist/server/index.js:16:261383)
at Object.createTree (/Users/anamba/.vscode/extensions/rebornix.ruby-0.28.0/dist/server/index.js:16:176062)
at e.project (/Users/anamba/.vscode/extensions/rebornix.ruby-0.28.0/dist/server/index.js:16:176538)
at e._next (/Users/anamba/.vscode/extensions/rebornix.ruby-0.28.0/dist/server/index.js:16:117207)
[Error - 11:11:12 AM] Request textDocument/documentSymbol failed.
Message: Request textDocument/documentSymbol failed with message: Cannot read property 'documentSymbols' of undefined
Code: -32603
[Error - 11:11:12 AM] Request textDocument/foldingRange failed.
Message: Request textDocument/foldingRange failed with message: Cannot read property 'foldingRanges' of undefined
Code: -32603
[Error - 11:11:15 AM] Request textDocument/documentHighlight failed.
Message: Request textDocument/documentHighlight failed with message: Cannot read property 'rootNode' of undefined
Code: -32603
I ultimately narrowed it down to these two lines (part of a merge method):
photos.each { |obj| target.photos << obj }
notes.each { |obj| target.notes << obj }If I reload the window, all is well until I switch to that particular tab again, and then after that, any time I click anywhere in any ruby file, I get more errors under Output.
Rewriting those lines to this helped:
photos.each { |obj| obj.update(entity: target) }
notes.each { |obj| obj.update(entity: target) }🤷♂️
durrellchamorro, requiemformemories, Takahiro-YAMANA, mdesantis, dylanhanning and 11 more
Metadata
Metadata
Assignees
Labels
bugBug reportsBug reports