helix-editor / helix

A post-modern modal text editor.
https://helix-editor.com
Mozilla Public License 2.0
33.85k stars 2.51k forks source link

Autocomplete removes the next character #12073

Open Bobrokus opened 3 days ago

Bobrokus commented 3 days ago

Summary

While using some LSPs (in my case svelteserver and godot), the autocompletion removes the next character.

Reproduction Steps

- Follow https://github.com/helix-editor/helix/wiki/Language-Server-Configurations#svelte - Open a `.svelte` file in Helix and try out the autocompletion **What I expected to happen:** Autocompletion should've normally inserted the autocompleted text without removing any characters. **What happened:** https://github.com/user-attachments/assets/e8c29444-e44c-4c63-9e89-197ad9e32f19 ### Helix log
~/.cache/helix/helix.log ``` 2024-11-15T23:52:42.040 globset [DEBUG] glob converted to regex: Glob { glob: "*/Dockerfile.*", re: "(?-u)^.*/Dockerfile\\..*$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: false, empty_alternates: false }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('D'), Literal('o'), Literal('c'), Literal('k'), Literal('e'), Literal('r'), Literal('f'), Literal('i'), Literal('l'), Literal('e'), Literal('.'), ZeroOrMore]) } 2024-11-15T23:52:42.041 globset [DEBUG] glob converted to regex: Glob { glob: "*/dockerfile.*", re: "(?-u)^.*/dockerfile\\..*$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: false, empty_alternates: false }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('d'), Literal('o'), Literal('c'), Literal('k'), Literal('e'), Literal('r'), Literal('f'), Literal('i'), Literal('l'), Literal('e'), Literal('.'), ZeroOrMore]) } 2024-11-15T23:52:42.045 globset [DEBUG] glob converted to regex: Glob { glob: "*/Containerfile.*", re: "(?-u)^.*/Containerfile\\..*$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: false, empty_alternates: false }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('C'), Literal('o'), Literal('n'), Literal('t'), Literal('a'), Literal('i'), Literal('n'), Literal('e'), Literal('r'), Literal('f'), Literal('i'), Literal('l'), Literal('e'), Literal('.'), ZeroOrMore]) } 2024-11-15T23:52:42.045 globset [DEBUG] glob converted to regex: Glob { glob: "*/containerfile.*", re: "(?-u)^.*/containerfile\\..*$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: false, empty_alternates: false }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('c'), Literal('o'), Literal('n'), Literal('t'), Literal('a'), Literal('i'), Literal('n'), Literal('e'), Literal('r'), Literal('f'), Literal('i'), Literal('l'), Literal('e'), Literal('.'), ZeroOrMore]) } 2024-11-15T23:52:42.045 globset [DEBUG] glob converted to regex: Glob { glob: "*/.*ignore", re: "(?-u)^.*/\\..*ignore$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: false, empty_alternates: false }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('.'), ZeroOrMore, Literal('i'), Literal('g'), Literal('n'), Literal('o'), Literal('r'), Literal('e')]) } 2024-11-15T23:52:42.045 globset [DEBUG] glob converted to regex: Glob { glob: "*/BUILD.*", re: "(?-u)^.*/BUILD\\..*$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: false, empty_alternates: false }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('B'), Literal('U'), Literal('I'), Literal('L'), Literal('D'), Literal('.'), ZeroOrMore]) } 2024-11-15T23:52:42.045 globset [DEBUG] glob converted to regex: Glob { glob: "*/.env.*", re: "(?-u)^.*/\\.env\\..*$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: false, empty_alternates: false }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('.'), Literal('e'), Literal('n'), Literal('v'), Literal('.'), ZeroOrMore]) } 2024-11-15T23:52:42.045 globset [DEBUG] glob converted to regex: Glob { glob: "*/.envrc.*", re: "(?-u)^.*/\\.envrc\\..*$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: false, empty_alternates: false }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('.'), Literal('e'), Literal('n'), Literal('v'), Literal('r'), Literal('c'), Literal('.'), ZeroOrMore]) } 2024-11-15T23:52:42.045 globset [DEBUG] glob converted to regex: Glob { glob: "*/conf/*/*.{inc,conf}", re: "(?-u)^.*/conf/.*/.*\\.(?:conf|inc)$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: false, empty_alternates: false }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('c'), Literal('o'), Literal('n'), Literal('f'), Literal('/'), ZeroOrMore, Literal('/'), ZeroOrMore, Literal('.'), Alternates([Tokens([Literal('c'), Literal('o'), Literal('n'), Literal('f')]), Tokens([Literal('i'), Literal('n'), Literal('c')])])]) } 2024-11-15T23:52:42.045 globset [DEBUG] glob converted to regex: Glob { glob: "*/Jenkinsfile.*", re: "(?-u)^.*/Jenkinsfile\\..*$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: false, empty_alternates: false }, tokens: Tokens([ZeroOrMore, Literal('/'), Literal('J'), Literal('e'), Literal('n'), Literal('k'), Literal('i'), Literal('n'), Literal('s'), Literal('f'), Literal('i'), Literal('l'), Literal('e'), Literal('.'), ZeroOrMore]) } 2024-11-15T23:52:42.045 globset [DEBUG] built glob set; 1 literals, 0 basenames, 0 extensions, 0 prefixes, 129 suffixes, 9 required extensions, 10 regexes 2024-11-15T23:52:42.215 helix_vcs [DEBUG] file is untracked 2024-11-15T23:52:42.215 helix_vcs [DEBUG] failed to open diff base for H:\rust-projects\cruelsrp-vehicle-catalog\frontend\src\routes\Header.svelte 2024-11-15T23:52:42.232 helix_view::editor [DEBUG] editor status: Loaded 1 file. 2024-11-15T23:52:42.232 helix_lsp::client [INFO] Using custom LSP config: {"configuration":{"javascript":{"inlayHints":{"enumMemberValues":{"enabled":true},"functionLikeReturnTypes":{"enabled":true},"parameterNames":{"enabled":"all"},"parameterTypes":{"enabled":true},"propertyDeclarationTypes":{"enabled":true},"variableTypes":{"enabled":true}}},"typescript":{"inlayHints":{"enumMemberValues":{"enabled":true},"functionLikeReturnTypes":{"enabled":true},"parameterNames":{"enabled":"all"},"parameterTypes":{"enabled":true},"propertyDeclarationTypes":{"enabled":true},"variableTypes":{"enabled":true}}}}} 2024-11-15T23:52:42.233 helix_lsp::transport [INFO] svelteserver -> {"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"general":{"positionEncodings":["utf-8","utf-32","utf-16"]},"textDocument":{"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"dataSupport":true,"disabledSupport":true,"isPreferredSupport":true,"resolveSupport":{"properties":["edit","command"]}},"completion":{"completionItem":{"deprecatedSupport":true,"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"snippetSupport":true,"tagSupport":{"valueSet":[1]}},"completionItemKind":{}},"formatting":{"dynamicRegistration":false},"hover":{"contentFormat":["markdown"]},"inlayHint":{"dynamicRegistration":false},"publishDiagnostics":{"tagSupport":{"valueSet":[1,2]},"versionSupport":true},"rename":{"dynamicRegistration":false,"honorsChangeAnnotations":false,"prepareSupport":true},"signatureHelp":{"signatureInformation":{"activeParameterSupport":true,"documentationFormat":["markdown"],"parameterInformation":{"labelOffsetSupport":true}}}},"window":{"workDoneProgress":true},"workspace":{"applyEdit":true,"configuration":true,"didChangeConfiguration":{"dynamicRegistration":false},"didChangeWatchedFiles":{"dynamicRegistration":true,"relativePatternSupport":false},"executeCommand":{"dynamicRegistration":false},"fileOperations":{"didRename":true,"willRename":true},"inlayHint":{"refreshSupport":false},"symbol":{"dynamicRegistration":false},"workspaceEdit":{"documentChanges":true,"failureHandling":"abort","normalizesLineEndings":false,"resourceOperations":["create","rename","delete"]},"workspaceFolders":true}},"clientInfo":{"name":"helix","version":"24.7 (079f5442)"},"initializationOptions":{"configuration":{"javascript":{"inlayHints":{"enumMemberValues":{"enabled":true},"functionLikeReturnTypes":{"enabled":true},"parameterNames":{"enabled":"all"},"parameterTypes":{"enabled":true},"propertyDeclarationTypes":{"enabled":true},"variableTypes":{"enabled":true}}},"typescript":{"inlayHints":{"enumMemberValues":{"enabled":true},"functionLikeReturnTypes":{"enabled":true},"parameterNames":{"enabled":"all"},"parameterTypes":{"enabled":true},"propertyDeclarationTypes":{"enabled":true},"variableTypes":{"enabled":true}}}}},"processId":9764,"rootPath":"H:\\rust-projects\\cruelsrp-vehicle-catalog","rootUri":"file:///H:/rust-projects/cruelsrp-vehicle-catalog","workspaceFolders":[{"name":"cruelsrp-vehicle-catalog","uri":"file:///H:/rust-projects/cruelsrp-vehicle-catalog"}]},"id":0} 2024-11-15T23:52:42.233 helix_tui::backend::crossterm [DEBUG] The keyboard enhancement protocol is not supported in this terminal (checked in 100ns) 2024-11-15T23:52:42.302 helix_term::application [DEBUG] received editor event: IdleTimer 2024-11-15T23:52:43.041 helix_lsp::transport [ERROR] svelteserver err <- "Initialize language server at file:///H:/rust-projects/cruelsrp-vehicle-catalog\n" 2024-11-15T23:52:43.050 helix_lsp::transport [INFO] svelteserver <- {"jsonrpc":"2.0","id":0,"result":{"capabilities":{"textDocumentSync":{"openClose":true,"change":2,"save":{"includeText":false}},"hoverProvider":true,"completionProvider":{"resolveProvider":true,"triggerCharacters":[".","\"","'","`","/","@","<",">","*","#","$","+","^","(","[","@","-",":","|"],"completionItem":{"labelDetailsSupport":true}},"documentFormattingProvider":true,"colorProvider":true,"documentSymbolProvider":true,"definitionProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","source.organizeImports","source.sortImports","refactor"],"resolveProvider":true},"executeCommandProvider":{"commands":["function_scope_0","function_scope_1","function_scope_2","function_scope_3","constant_scope_0","constant_scope_1","constant_scope_2","constant_scope_3","extract_to_svelte_component","migrate_to_svelte_5","Infer function return type"]},"renameProvider":{"prepareProvider":true},"referencesProvider":true,"selectionRangeProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",",","<"],"retriggerCharacters":[")"]},"semanticTokensProvider":{"legend":{"tokenModifiers":["declaration","static","async","readonly","defaultLibrary","local"],"tokenTypes":["class","enum","interface","namespace","typeParameter","type","parameter","variable","enumMember","property","function","method","event"]},"range":true,"full":true},"linkedEditingRangeProvider":true,"implementationProvider":true,"typeDefinitionProvider":true,"inlayHintProvider":true,"callHierarchyProvider":true,"foldingRangeProvider":true,"codeLensProvider":{"resolveProvider":true}}}} 2024-11-15T23:52:43.051 helix_lsp::transport [INFO] svelteserver <- {"capabilities":{"callHierarchyProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","source.organizeImports","source.sortImports","refactor"],"resolveProvider":true},"codeLensProvider":{"resolveProvider":true},"colorProvider":true,"completionProvider":{"completionItem":{"labelDetailsSupport":true},"resolveProvider":true,"triggerCharacters":[".","\"","'","`","/","@","<",">","*","#","$","+","^","(","[","@","-",":","|"]},"definitionProvider":true,"documentFormattingProvider":true,"documentSymbolProvider":true,"executeCommandProvider":{"commands":["function_scope_0","function_scope_1","function_scope_2","function_scope_3","constant_scope_0","constant_scope_1","constant_scope_2","constant_scope_3","extract_to_svelte_component","migrate_to_svelte_5","Infer function return type"]},"foldingRangeProvider":true,"hoverProvider":true,"implementationProvider":true,"inlayHintProvider":true,"linkedEditingRangeProvider":true,"referencesProvider":true,"renameProvider":{"prepareProvider":true},"selectionRangeProvider":true,"semanticTokensProvider":{"full":true,"legend":{"tokenModifiers":["declaration","static","async","readonly","defaultLibrary","local"],"tokenTypes":["class","enum","interface","namespace","typeParameter","type","parameter","variable","enumMember","property","function","method","event"]},"range":true},"signatureHelpProvider":{"retriggerCharacters":[")"],"triggerCharacters":["(",",","<"]},"textDocumentSync":{"change":2,"openClose":true,"save":{"includeText":false}},"typeDefinitionProvider":true}} 2024-11-15T23:52:43.051 helix_lsp::transport [INFO] svelteserver -> {"jsonrpc":"2.0","method":"initialized","params":{}} 2024-11-15T23:52:43.051 helix_term::application [DEBUG] received editor event: LanguageServerMessage((LanguageServerId(1v1), Notification(Notification { jsonrpc: None, method: "initialized", params: None }))) 2024-11-15T23:52:43.051 helix_lsp::transport [INFO] svelteserver -> {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"svelte","text":"\n\n

Hello {name}

\n\n\n","uri":"file:///H:/rust-projects/cruelsrp-vehicle-catalog/frontend/src/routes/Header.svelte","version":0}}} 2024-11-15T23:52:43.051 helix_lsp::transport [INFO] svelteserver -> {"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{"configuration":{"javascript":{"inlayHints":{"enumMemberValues":{"enabled":true},"functionLikeReturnTypes":{"enabled":true},"parameterNames":{"enabled":"all"},"parameterTypes":{"enabled":true},"propertyDeclarationTypes":{"enabled":true},"variableTypes":{"enabled":true}}},"typescript":{"inlayHints":{"enumMemberValues":{"enabled":true},"functionLikeReturnTypes":{"enabled":true},"parameterNames":{"enabled":"all"},"parameterTypes":{"enabled":true},"propertyDeclarationTypes":{"enabled":true},"variableTypes":{"enabled":true}}}}}}} 2024-11-15T23:52:43.053 helix_lsp::transport [INFO] svelteserver <- {"jsonrpc":"2.0","id":0,"method":"client/registerCapability","params":{"registrations":[{"id":"e4665049-3e45-4e28-8025-c8668a6ee0f6","method":"workspace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"**/*.{ts,js,mts,mjs,cjs,cts,json,svelte}"}]}}]}} 2024-11-15T23:52:43.053 helix_term::application [DEBUG] received editor event: LanguageServerMessage((LanguageServerId(1v1), MethodCall(MethodCall { jsonrpc: Some(V2), method: "client/registerCapability", params: Map({"registrations": Array [Object {"id": String("e4665049-3e45-4e28-8025-c8668a6ee0f6"), "method": String("workspace/didChangeWatchedFiles"), "registerOptions": Object {"watchers": Array [Object {"globPattern": String("**/*.{ts,js,mts,mjs,cjs,cts,json,svelte}")}]}}]}), id: Num(0) }))) 2024-11-15T23:52:43.053 helix_lsp::file_event [DEBUG] Registering didChangeWatchedFiles for client '1v1' with id 'e4665049-3e45-4e28-8025-c8668a6ee0f6' 2024-11-15T23:52:43.053 helix_lsp::transport [INFO] svelteserver -> {"jsonrpc":"2.0","result":null,"id":0} 2024-11-15T23:52:43.053 globset [DEBUG] glob converted to regex: Glob { glob: "**/*.{ts,js,mts,mjs,cjs,cts,json,svelte}", re: "(?-u)^(?:/?|.*/).*\\.(?:svelte|json|cts|cjs|mjs|mts|js|ts)$", opts: GlobOptions { case_insensitive: false, literal_separator: false, backslash_escape: false, empty_alternates: false }, tokens: Tokens([RecursivePrefix, ZeroOrMore, Literal('.'), Alternates([Tokens([Literal('s'), Literal('v'), Literal('e'), Literal('l'), Literal('t'), Literal('e')]), Tokens([Literal('j'), Literal('s'), Literal('o'), Literal('n')]), Tokens([Literal('c'), Literal('t'), Literal('s')]), Tokens([Literal('c'), Literal('j'), Literal('s')]), Tokens([Literal('m'), Literal('j'), Literal('s')]), Tokens([Literal('m'), Literal('t'), Literal('s')]), Tokens([Literal('j'), Literal('s')]), Tokens([Literal('t'), Literal('s')])])]) } 2024-11-15T23:52:43.053 globset [DEBUG] built glob set; 0 literals, 0 basenames, 0 extensions, 0 prefixes, 0 suffixes, 0 required extensions, 1 regexes 2024-11-15T23:52:43.073 helix_lsp::transport [ERROR] svelteserver err <- "Initialize new ts service at h:/rust-projects/cruelsrp-vehicle-catalog/frontend/tsconfig.json\n" 2024-11-15T23:52:43.085 helix_term::application [DEBUG] received editor event: Redraw 2024-11-15T23:52:43.109 helix_lsp::transport [ERROR] svelteserver err <- "Trying to load configs for h:/rust-projects/cruelsrp-vehicle-catalog/frontend\n" 2024-11-15T23:52:43.760 helix_lsp::transport [ERROR] svelteserver err <- "Loaded config at h:\\rust-projects\\cruelsrp-vehicle-catalog\\frontend\\svelte.config.js\n" 2024-11-15T23:52:43.832 helix_lsp::transport [ERROR] svelteserver err <- "SnapshotManager File Statistics:\n" 2024-11-15T23:52:43.832 helix_lsp::transport [ERROR] svelteserver err <- "Project files: 8\n" 2024-11-15T23:52:43.832 helix_lsp::transport [ERROR] svelteserver err <- "Svelte files: 2\n" 2024-11-15T23:52:43.832 helix_lsp::transport [ERROR] svelteserver err <- "From node_modules: 0\n" 2024-11-15T23:52:43.832 helix_lsp::transport [ERROR] svelteserver err <- "Total: 8\n" 2024-11-15T23:52:44.674 helix_lsp::transport [INFO] svelteserver <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///h%3A/rust-projects/cruelsrp-vehicle-catalog/frontend/tsconfig.json","diagnostics":[]}} 2024-11-15T23:52:44.674 helix_term::application [DEBUG] received editor event: LanguageServerMessage((LanguageServerId(1v1), Notification(Notification { jsonrpc: Some(V2), method: "textDocument/publishDiagnostics", params: Map({"diagnostics": Array [], "uri": String("file:///h%3A/rust-projects/cruelsrp-vehicle-catalog/frontend/tsconfig.json")}) }))) 2024-11-15T23:52:44.721 helix_term::application [DEBUG] received editor event: Redraw 2024-11-15T23:52:44.787 helix_lsp::transport [INFO] svelteserver <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///h%3A/rust-projects/cruelsrp-vehicle-catalog/frontend/src/routes/Header.svelte","diagnostics":[{"range":{"start":{"line":1,"character":14},"end":{"line":1,"character":23}},"severity":4,"source":"ts","message":"'fake_name' is declared but its value is never read.","code":6133,"tags":[1]}]}} 2024-11-15T23:52:44.787 helix_term::application [DEBUG] received editor event: LanguageServerMessage((LanguageServerId(1v1), Notification(Notification { jsonrpc: Some(V2), method: "textDocument/publishDiagnostics", params: Map({"diagnostics": Array [Object {"code": Number(6133), "message": String("'fake_name' is declared but its value is never read."), "range": Object {"end": Object {"character": Number(23), "line": Number(1)}, "start": Object {"character": Number(14), "line": Number(1)}}, "severity": Number(4), "source": String("ts"), "tags": Array [Number(1)]}], "uri": String("file:///h%3A/rust-projects/cruelsrp-vehicle-catalog/frontend/src/routes/Header.svelte")}) }))) 2024-11-15T23:52:44.830 helix_term::application [DEBUG] received editor event: Redraw 2024-11-15T23:52:44.906 helix_term::application [DEBUG] received editor event: IdleTimer 2024-11-15T23:52:44.907 helix_lsp::transport [INFO] svelteserver -> {"jsonrpc":"2.0","method":"textDocument/inlayHint","params":{"range":{"end":{"character":0,"line":8},"start":{"character":0,"line":0}},"textDocument":{"uri":"file:///H:/rust-projects/cruelsrp-vehicle-catalog/frontend/src/routes/Header.svelte"}},"id":1} 2024-11-15T23:52:44.925 helix_lsp::transport [INFO] svelteserver <- {"jsonrpc":"2.0","id":1,"result":[]} 2024-11-15T23:52:44.925 helix_lsp::transport [INFO] svelteserver <- [] ```
### Platform Windows ### Terminal Emulator wezterm 20240203-110809-5046fc22 ### Installation Method scoop ### Helix Version helix 24.7 (079f5442)
RoloEdits commented 2 days ago

This might have been fixed in #11266. If you are able to, build at or after this was merged to see if its fixed for you.