Repository navigation
Open
Labels
bugSomething isn't workingSomething isn't workinghelp-wantedExtra attention is neededExtra attention is neededpinnedThis issue or pull request is pinned and won't be marked as staleThis issue or pull request is pinned and won't be marked as stalevscodeThis pull request should be included in the VS Code extension's release notesThis pull request should be included in the VS Code extension's release notes
Description
Description
Ruby LSP Information
VS Code Version
1.94.2
Ruby LSP Extension Version
0.8.8
Ruby LSP Server Version
0.20.1
Ruby LSP Addons
- Ruby LSP Rails
Ruby Version
3.3.5
Ruby Version Manager
rbenv
Installed Extensions
Click to expand
- vscode-erb-beautify (0.5.0)
- vscode-django (1.15.0)
- vscode-markdownlint (0.56.0)
- python-environment-manager (1.2.4)
- python-extension-pack (1.7.0)
- EditorConfig (0.16.4)
- copilot (1.242.1180)
- copilot-chat (0.22.2024100702)
- vscode-github-actions (0.27.0)
- go (0.42.1)
- haskell (2.4.4)
- language-haskell (3.6.0)
- vsc-python-indent (1.18.0)
- rainbow-csv (3.12.0)
- git-graph (1.30.0)
- data-workspace-vscode (0.5.0)
- mssql (1.25.0)
- sql-bindings-vscode (0.4.0)
- sql-database-projects-vscode (1.4.3)
- debugpy (2024.12.0)
- isort (2023.10.1)
- pylint (2024.0.0)
- python (2024.16.1)
- vscode-pylance (2024.10.1)
- datawrangler (1.12.0)
- jupyter (2024.9.1)
- jupyter-keymap (1.1.2)
- jupyter-renderers (1.0.19)
- cmake-tools (1.19.52)
- cpptools (1.22.10)
- cpptools-extension-pack (1.3.0)
- cpptools-themes (2.0.0)
- hexeditor (1.10.0)
- makefile-tools (0.11.13)
- powershell (2024.2.2)
- vscode-speech (0.10.0)
- autodocstring (0.6.1)
- vscode-powerquery (0.1.60)
- scala (0.5.8)
- metals (1.40.0)
- ruby-lsp (0.8.8)
- rewrap (1.16.3)
- cmake (0.0.17)
- vim (1.28.1)
- jinja (0.0.8)
- five-server (0.3.1)
- dark-ruby-theme (1.2.0)
- markdown-pdf (1.5.0)
Ruby LSP Settings
Click to expand
Workspace
{}User
{
"enableExperimentalFeatures": true,
"enabledFeatures": {
"codeActions": true,
"diagnostics": true,
"documentHighlights": true,
"documentLink": true,
"documentSymbols": true,
"foldingRanges": true,
"formatting": true,
"hover": true,
"inlayHint": true,
"onTypeFormatting": true,
"selectionRanges": true,
"semanticHighlighting": true,
"completion": true,
"codeLens": true,
"definition": true,
"workspaceSymbol": true,
"signatureHelp": true,
"typeHierarchy": true
},
"featuresConfiguration": {},
"addonSettings": {
"rubocop": {
"lint": true,
"format": true
},
"erb": {
"lint": true,
"format": true
}
},
"rubyVersionManager": {
"identifier": "auto"
},
"customRubyCommand": "",
"formatter": "rubocop",
"linters": null,
"bundleGemfile": "",
"testTimeout": 30,
"branch": "",
"pullDiagnosticsOn": "both",
"useBundlerCompose": false,
"bypassTypechecker": false,
"rubyExecutablePath": "",
"indexing": {},
"erbSupport": true
}Reproduction steps
- Start the Ruby LSP using VSCode
- Open an ERB file
- Hover over an HTML tag
- No documentation provided and error thrown. The Ruby LSP output is as follows:
2024-10-25 15:21:20.805 [info] (top_flickr_api) [Error - 3:21:20 PM] Request textDocument/hover failed.
2024-10-25 15:21:20.805 [info] (top_flickr_api) Error: Unable to resolve text model content for resource embedded-content://html/file%3A///home/username/courses/top/rails/top_flickr_api/app/views/layouts/application.html.erb.html
at q8e.u (vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:1279:21909)
at async q8e.r (vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:1279:20939)
at async nfi.acquire (vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:25:3125)
at async G8e.createModelReference (vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js:1279:22405)Reacted by Louis Kottmann
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp-wantedExtra attention is neededExtra attention is neededpinnedThis issue or pull request is pinned and won't be marked as staleThis issue or pull request is pinned and won't be marked as stalevscodeThis pull request should be included in the VS Code extension's release notesThis pull request should be included in the VS Code extension's release notes
Activity
vinistock commentedon Oct 28, 2024
Thank you for the bug report! I can't seem to reproduce it by following the steps. Maybe it could be related to the structure of the ERB file or potentially some other extension you have installed.
Do you see this error on every ERB document? And for every HTML element?
sean-garwood commentedon Oct 28, 2024
Yes, this triggers on hover for every HTML element in every ERB file I've tested, even app defaults (as in, built when
bin/rails new some_appis invoked in bash in project's parent directory) such asapplication.html.erbandmailer.html.erb.I noticed that the error output is looking for
embedded-content://.../mailer.html.erb.html:Error: Unable to resolve text model content for resource embedded-content://html/file%3A///home/ssg/courses/top/rails/top_flickr_api/app/views/layouts/mailer.html.erb.htmlNot sure if this is intended behavior or something else.
Another user got this same behavior when cloning two repositories I used to test this:
I also:
The issue persists.
andyw8 commentedon Oct 28, 2024
Thank you, I was able to reproduce this error on
top_flickr_api. We will investigate.andyw8 commentedon Oct 28, 2024
Can also reproduce on other repos, e.g.
ruby-lsp-rails.andyw8 commentedon Oct 28, 2024
Verified that this also happens in the previous VS Code release (1.93.1).
mahmoudimus commentedon Dec 9, 2024
Hi, do we have any update on this issue?
brunoprietog commentedon May 23, 2025
Do you have any updates on this? Please 🙏
rafayqayyum commentedon Nov 8, 2026
I think I found the cause: documents are parsed when they're opened, so the
delegate/textDocument/virtualStatenotification is only sent after the first edit. A freshly opened ERB file has no embedded content for the extension to resolve until you type something, which would explain why it only reproduces for some people. Opened #4267 to send the virtual state ondidOpen.