Skip to content

Single quote in a HEREDOC breaks formatting for the entire file #3815

@justwiebe

Description

@justwiebe

Description

Ruby LSP Information

Ruby LSP Information

VS Code Version

1.105.1

Ruby LSP Extension Version

0.9.32

Ruby LSP Server Version

0.26.2

Ruby LSP Add-ons

  • Ruby LSP Rails (0.4.8)
  • RuboCop (unknown)

Ruby Version

3.4.5

Ruby Version Manager

rbenv

Installed Extensions

Click to expand
  • EditorConfig (0.17.4)
  • azure-repos (0.40.0)
  • copilot (1.388.0)
  • copilot-chat (0.32.4)
  • docker (0.18.0)
  • gitlens (17.6.2)
  • haml (1.0.1)
  • json (2.0.2)
  • lit-plugin (1.4.3)
  • markdown-mermaid (1.29.0)
  • nuxt-vscode (0.0.6)
  • rails-db-schema (0.2.9)
  • rails-partial (0.3.6)
  • rails-routes (0.6.3)
  • rainbow-csv (3.23.0)
  • remote-containers (0.427.0)
  • remote-explorer (0.5.0)
  • remote-repositories (0.42.0)
  • remote-server (1.5.3)
  • remote-ssh (0.120.0)
  • remote-ssh-edit (0.87.0)
  • remotehub (0.64.0)
  • ruby-linter (1.0.0)
  • ruby-lsp (0.9.32)
  • ruby-symbols (0.1.8)
  • simple-ruby-erb (0.2.1)
  • solargraph (0.25.0)
  • sort-lines (1.12.0)
  • test-adapter-converter (0.2.1)
  • vscode-color (0.4.5)
  • vscode-containers (2.2.0)
  • vscode-docker (2.0.0)
  • vscode-eslint (3.0.16)
  • vscode-github-actions (0.28.0)
  • vscode-pgsql (1.10.0)
  • vscode-rdbg (0.2.2)
  • vscode-stylelint (1.5.3)
  • vscode-toggle-quotes (0.3.6)
  • vscode-zipfs (3.0.0)
  • vsliveshare (1.0.5959)
  • yarn-pnp-extension (0.1.3)

Ruby LSP Settings

Click to expand
Workspace
{}
User
{
  "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,
  "featureFlags": {},
  "sigOpacityLevel": "1"
}

Reproduction steps

  1. Start the Ruby LSP using a certain editor
  2. Open a Ruby file
  3. Create a HEREDOC
  4. Add a single quote to it

Code snippet or error message

class MyClass
  SYSTEM_MESSAGE = <<~HEREDOC
    Hello there '
    Testing, everything is broken.
  HEREDOC

  def this_is_now_incorrectly_highlighted
  end
end

I have a coworker who has the deprecated VSCode Ruby extension installed in addition to Ruby LSP, and everything works correctly. When he disables that extension, the highlighting is broken again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions