Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Incorrect completion inside interpolated string when prefix contains Unicode characters

Open
#4,180 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@rubemoon is already working on this.

Since Aug 9, 2026.

  • #4188 by @rubemoon — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
ruby, vscode
Domain
devtools

Research direction

Start by reproducing the completion case in VS Code using the issue's Ruby example, then trace the completion replacement range and offset handling for Unicode-prefixed lines and interpolated strings. Done means selecting test produces "🐮 says #{test}" without overwriting the closing quote, including when Unicode appears outside interpolation.

Written by the indexing model from the issue text.

Description

bug
Description

Completion inside a Ruby interpolated string behaves incorrectly when the string prefix contains Unicode characters (e.g., emoji).
The completion inserts duplicated/garbled text instead of replacing the identifier prefix correctly.

Ruby LSP Information
VS Code Version

1.130.0

Ruby LSP Extension Version

0.10.4

Ruby LSP Server Version

0.26.9

Ruby LSP Add-ons
  • Standard Ruby (unknown)
  • Ruby LSP RSpec (0.26.9)
  • Ruby LSP Rails (0.4.8)
  • RuboCop (1.84.2)
Ruby Version

3.4.8

Ruby Version Manager

rbenv

Installed Extensions
Click to expand
  • code-spell-checker (4.5.6)
  • codesnap (1.3.4)
  • opencode (0.0.13)
  • ruby-lsp (0.10.4)
  • vscode-pgsql (1.26.0)
  • vscode-yaml (1.24.0)
Ruby LSP Settings
Click to expand
Workspace
{
  "formatter": "standard"
}
User
{
  "enabledFeatures": {
    "codeActions": true,
    "diagnostics": false,
    "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": "standard",
  "linters": null,
  "bundleGemfile": "",
  "testTimeout": 30,
  "pullDiagnosticsOn": "both",
  "useBundlerCompose": false,
  "bypassTypechecker": false,
  "rubyExecutablePath": "",
  "indexing": {},
  "erbSupport": true,
  "featureFlags": {},
  "sigOpacityLevel": "1"
}
Reproduction steps
  1. Start the Ruby LSP using Visual Studio Code

  2. Create a Ruby file

  3. Write a minimal example

    test = "moo"
    "🐮 says #{te}"
    
  4. Trigger completion on te and select test

Expected behavior
"🐮 says #{test}"
Actual behavior
"🐮 says #{tetest

Notice that the last " is overwritten

Notes

It looks like the replacement range/offset for completion in interpolated string content is calculated incorrectly when Unicode characters appear earlier in the same string. The same issue also occurs outside of interpolated string declarations if the source code line is prefixed with Unicode characters.

Dominant language
Ruby
Stars
2k
Forks
282
Avg merge
12h 23m
Merged PRs (30d)
9

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Shopify/ruby-lsp

All issues in Shopify/ruby-lsp

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.