{
"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"
}
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
Ruby Version
3.4.8
Ruby Version Manager
rbenv
Installed Extensions
Click to expand
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
Start the Ruby LSP using Visual Studio Code
Create a Ruby file
Write a minimal example
Trigger completion on
teand selecttestExpected behavior
"🐮 says #{test}"Actual behavior
"🐮 says #{tetestNotes
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.