Shopify / ruby-lsp

An opinionated language server for Ruby
https://shopify.github.io/ruby-lsp/
MIT License
1.57k stars 152 forks source link

Syntax highlighting not working properly #2735

Open baelter opened 19 hours ago

baelter commented 19 hours ago

Description

Ruby LSP Information

Ruby LSP Information

VS Code Version

1.94.2

Ruby LSP Extension Version

0.8.6

Ruby LSP Server Version

0.20.1

Ruby LSP Addons

Ruby Version

3.3.5

Ruby Version Manager

rbenv

Installed Extensions

Click to expand - better-comments (3.0.2) - haml-lint (0.2.1) - project-manager (12.8.0) - auto-add-brackets (0.12.2) - markdown-mermaid (1.25.0) - mermaid-markdown-syntax-highlighting (1.6.6) - systemd-unit-file (1.0.6) - crystal-lang (0.9.6) - doxdocgen (1.4.0) - vscode-markdownlint (0.56.0) - gitlens (15.6.2) - vscode-html-css (2.0.10) - EditorConfig (0.16.4) - RunOnSave (0.2.4) - copilot (1.239.0) - copilot-chat (0.21.2) - vscode-github-actions (0.27.0) - vscode-pull-request-github (0.98.0) - todo-tree (0.0.226) - output-colorizer (0.1.2) - workspacesort (1.6.2) - custom-local-formatters (0.0.6) - haml (1.4.1) - vscode-rdbg (0.2.2) - rainbow-csv (3.12.0) - dotenv (1.0.1) - vscode-kubernetes-tools (1.3.18) - debugpy (2024.12.0) - isort (2023.10.1) - python (2024.16.1) - vscode-pylance (2024.10.1) - jupyter (2024.9.1) - remote-containers (0.388.0) - remote-ssh (0.115.0) - remote-wsl (0.88.4) - makefile-tools (0.11.13) - remote-explorer (0.4.3) - vsliveshare (1.0.5941) - vscode-template-literal-editor (0.10.0) - vscode-yaml (1.15.0) - vscode-sort-json (1.20.0) - vscode-qt-for-python (7.6.0) - ruby-extensions-pack (0.1.12) - ruby-lsp (0.8.6) - sorbet-vscode-extension (0.3.37) - vscode-standard (2.1.3) - code-spell-checker (3.0.1) - vscode-stylelint (1.4.0) - shellcheck (0.37.1) - errorlens (3.20.0) - vscode-lldb (1.11.0) - crystal-ameba (0.2.1) - simple-ruby-erb (0.2.1) - vscode-gradle (3.16.4) - debug (0.27.0)

Ruby LSP Settings

Click to expand ##### Workspace ```json {} ``` ##### User ```json { "enableExperimentalFeatures": false, "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": {}, "rubyVersionManager": { "identifier": "auto" }, "customRubyCommand": "", "formatter": "auto", "linters": null, "bundleGemfile": "", "testTimeout": 30, "branch": "", "pullDiagnosticsOn": "both", "useBundlerCompose": false, "bypassTypechecker": false, "rubyExecutablePath": "", "indexing": {}, "erbSupport": true } ```

Reproduction steps

  1. Start the Ruby LSP using a certain editor
  2. Open a Ruby file
  3. Do something
  4. See unexpected behavior

Symbols are sometimes broken in half and highlighting just goes crazy.

Image Image

vinistock commented 15 hours ago

Thank you for the bug report! Can you share a minimal Ruby snippet that reproduces the issue? I suspect that this might be related to how we handle multibyte characters, but there's no way to tell if we don't know what syntax triggers it.

andyw8 commented 15 hours ago

Also @baelter, have you noticed if this happens only when you open files from outside of the workspace?