Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong indents after the static initialization block in Javascript #7845

Closed
unnamedname opened this issue Aug 6, 2023 · 6 comments · Fixed by #7852
Closed

Wrong indents after the static initialization block in Javascript #7845

unnamedname opened this issue Aug 6, 2023 · 6 comments · Fixed by #7852
Labels
A-indent Area: Indentation A-language-support Area: Support for programming/text languages C-bug Category: This is a bug

Comments

@unnamedname
Copy link

Summary

Every indentation level after the static initialization block is reduced by 1, as described in the title.

Reproduction Steps

I tried this:

  1. run hx test.js -c none --log helix.log
  2. type class A {Enterstatic {Enter

I expected this to happen:
image

Instead, this happened:
image

Helix log

~/.cache/helix/helix.log
2023-08-07T01:30:12.642 helix_view::clipboard [DEBUG] Using wl-copy+wl-paste to interact with the system and selection (primary) clipboard
2023-08-07T01:30:12.673 helix_vcs [INFO] Error {
    context: "failed to open git repo",
    source: Discover(
        NoGitRepository {
            path: "/home/unnamed/Desktop",
        },
    ),
}
2023-08-07T01:30:12.673 helix_vcs [INFO] failed to open diff base for /home/unnamed/Desktop/test.js
2023-08-07T01:30:12.673 helix_vcs [INFO] Error {
    context: "failed to open git repo",
    source: Discover(
        NoGitRepository {
            path: "/home/unnamed/Desktop",
        },
    ),
}
2023-08-07T01:30:12.673 helix_vcs [INFO] failed to obtain current head name for /home/unnamed/Desktop/test.js
2023-08-07T01:30:12.674 helix_view::editor [DEBUG] editor status: Loaded 1 file.
2023-08-07T01:30:12.674 helix_lsp::client [INFO] Using custom LSP config: {"hostInfo":"helix","javascript":{"inlayHints":{"includeInlayEnumMemberValueHints":true,"includeInlayFunctionLikeReturnTypeHints":true,"includeInlayFunctionParameterTypeHints":true,"includeInlayParameterNameHints":"all","includeInlayParameterNameHintsWhenArgumentMatchesName":true,"includeInlayPropertyDeclarationTypeHints":true,"includeInlayVariableTypeHints":true}}}
2023-08-07T01:30:12.674 helix_lsp::transport [INFO] -> {"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"]}}},"completion":{"completionItem":{"deprecatedSupport":true,"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"snippetSupport":true,"tagSupport":{"valueSet":[1]}},"completionItemKind":{}},"hover":{"contentFormat":["markdown"]},"inlayHint":{"dynamicRegistration":false},"publishDiagnostics":{"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},"executeCommand":{"dynamicRegistration":false},"inlayHint":{"refreshSupport":false},"symbol":{"dynamicRegistration":false},"workspaceEdit":{"documentChanges":true,"failureHandling":"abort","normalizesLineEndings":false,"resourceOperations":["create","rename","delete"]},"workspaceFolders":true}},"clientInfo":{"name":"helix","version":"23.05"},"initializationOptions":{"hostInfo":"helix","javascript":{"inlayHints":{"includeInlayEnumMemberValueHints":true,"includeInlayFunctionLikeReturnTypeHints":true,"includeInlayFunctionParameterTypeHints":true,"includeInlayParameterNameHints":"all","includeInlayParameterNameHintsWhenArgumentMatchesName":true,"includeInlayPropertyDeclarationTypeHints":true,"includeInlayVariableTypeHints":true}}},"processId":169161,"rootPath":"/home/unnamed/Desktop","rootUri":null,"workspaceFolders":[]},"id":0}
2023-08-07T01:30:12.677 helix_tui::backend::crossterm [DEBUG] The keyboard enhancement protocol is not supported in this terminal (checked in 3.268363ms)
2023-08-07T01:30:12.677 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:12.850 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Using Typescript version (bundled) 5.1.6 from path \"/usr/lib/node_modules/typescript/lib/tsserver.js\""}}
2023-08-07T01:30:12.850 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":0,"method":"window/workDoneProgress/create","params":{"token":"cca17b40-07c3-4ce2-8471-9f2b065398c0"}}
2023-08-07T01:30:12.850 helix_term::application [DEBUG] received editor event: LanguageServerMessage((0, Notification(Notification { jsonrpc: Some(V2), method: "window/logMessage", params: Map({"message": String("Using Typescript version (bundled) 5.1.6 from path \"/usr/lib/node_modules/typescript/lib/tsserver.js\""), "type": Number(3)}) })))
2023-08-07T01:30:12.850 helix_term::application [INFO] window/logMessage: LogMessageParams { typ: Info, message: "Using Typescript version (bundled) 5.1.6 from path \"/usr/lib/node_modules/typescript/lib/tsserver.js\"" }
2023-08-07T01:30:12.850 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:12.850 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":0,"result":{"capabilities":{"textDocumentSync":2,"completionProvider":{"triggerCharacters":[".","\"","'","/","@","<"],"resolveProvider":true},"codeActionProvider":{"codeActionKinds":["source.fixAll.ts","source.removeUnused.ts","source.addMissingImports.ts","source.organizeImports.ts","source.removeUnusedImports.ts","source.sortImports.ts","quickfix","refactor"]},"definitionProvider":true,"documentFormattingProvider":true,"documentRangeFormattingProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"executeCommandProvider":{"commands":["_typescript.applyWorkspaceEdit","_typescript.applyCodeAction","_typescript.applyRefactoring","_typescript.configurePlugin","_typescript.organizeImports","_typescript.applyRenameFile","_typescript.goToSourceDefinition"]},"hoverProvider":true,"inlayHintProvider":true,"renameProvider":{"prepareProvider":true},"referencesProvider":true,"selectionRangeProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",",","<"],"retriggerCharacters":[")"]},"workspaceSymbolProvider":true,"implementationProvider":true,"typeDefinitionProvider":true,"foldingRangeProvider":true,"semanticTokensProvider":{"documentSelector":null,"legend":{"tokenTypes":["class","enum","interface","namespace","typeParameter","type","parameter","variable","enumMember","property","function","member"],"tokenModifiers":["declaration","static","async","readonly","defaultLibrary","local"]},"full":true,"range":true},"workspace":{"fileOperations":{"willRename":{"filters":[{"scheme":"file","pattern":{"glob":"**/*.{ts,js,jsx,tsx,mjs,mts,cjs,cts}","matches":"file"}}]}}}}}}
2023-08-07T01:30:12.850 helix_lsp::transport [INFO] <- {"capabilities":{"codeActionProvider":{"codeActionKinds":["source.fixAll.ts","source.removeUnused.ts","source.addMissingImports.ts","source.organizeImports.ts","source.removeUnusedImports.ts","source.sortImports.ts","quickfix","refactor"]},"completionProvider":{"resolveProvider":true,"triggerCharacters":[".","\"","'","/","@","<"]},"definitionProvider":true,"documentFormattingProvider":true,"documentHighlightProvider":true,"documentRangeFormattingProvider":true,"documentSymbolProvider":true,"executeCommandProvider":{"commands":["_typescript.applyWorkspaceEdit","_typescript.applyCodeAction","_typescript.applyRefactoring","_typescript.configurePlugin","_typescript.organizeImports","_typescript.applyRenameFile","_typescript.goToSourceDefinition"]},"foldingRangeProvider":true,"hoverProvider":true,"implementationProvider":true,"inlayHintProvider":true,"referencesProvider":true,"renameProvider":{"prepareProvider":true},"selectionRangeProvider":true,"semanticTokensProvider":{"documentSelector":null,"full":true,"legend":{"tokenModifiers":["declaration","static","async","readonly","defaultLibrary","local"],"tokenTypes":["class","enum","interface","namespace","typeParameter","type","parameter","variable","enumMember","property","function","member"]},"range":true},"signatureHelpProvider":{"retriggerCharacters":[")"],"triggerCharacters":["(",",","<"]},"textDocumentSync":2,"typeDefinitionProvider":true,"workspace":{"fileOperations":{"willRename":{"filters":[{"pattern":{"glob":"**/*.{ts,js,jsx,tsx,mjs,mts,cjs,cts}","matches":"file"},"scheme":"file"}]}}},"workspaceSymbolProvider":true}}
2023-08-07T01:30:12.850 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"initialized","params":{}}
2023-08-07T01:30:12.850 helix_term::application [DEBUG] received editor event: LanguageServerMessage((0, MethodCall(MethodCall { jsonrpc: Some(V2), method: "window/workDoneProgress/create", params: Map({"token": String("cca17b40-07c3-4ce2-8471-9f2b065398c0")}), id: Num(0) })))
2023-08-07T01:30:12.850 helix_term::application [DEBUG] received editor event: LanguageServerMessage((0, Notification(Notification { jsonrpc: None, method: "initialized", params: None })))
2023-08-07T01:30:12.850 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","result":null,"id":0}
2023-08-07T01:30:12.850 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{"hostInfo":"helix","javascript":{"inlayHints":{"includeInlayEnumMemberValueHints":true,"includeInlayFunctionLikeReturnTypeHints":true,"includeInlayFunctionParameterTypeHints":true,"includeInlayParameterNameHints":"all","includeInlayParameterNameHintsWhenArgumentMatchesName":true,"includeInlayPropertyDeclarationTypeHints":true,"includeInlayVariableTypeHints":true}}}}}
2023-08-07T01:30:12.850 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"javascript","text":"\n","uri":"file:///home/unnamed/Desktop/test.js","version":0}}}
2023-08-07T01:30:12.851 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"$/typescriptVersion","params":{"version":"5.1.6","source":"bundled"}}
2023-08-07T01:30:12.851 helix_term::application [DEBUG] received editor event: LanguageServerMessage((0, Notification(Notification { jsonrpc: Some(V2), method: "$/typescriptVersion", params: Map({"source": String("bundled"), "version": String("5.1.6")}) })))
2023-08-07T01:30:12.851 helix_term::application [ERROR] received malformed notification from Language Server: Unhandled
2023-08-07T01:30:12.852 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"$/progress","params":{"token":"cca17b40-07c3-4ce2-8471-9f2b065398c0","value":{"kind":"begin","title":"Initializing JS/TS language features…"}}}
2023-08-07T01:30:12.852 helix_term::application [DEBUG] received editor event: LanguageServerMessage((0, Notification(Notification { jsonrpc: Some(V2), method: "$/progress", params: Map({"token": String("cca17b40-07c3-4ce2-8471-9f2b065398c0"), "value": Object {"kind": String("begin"), "title": String("Initializing JS/TS language features…")}}) })))
2023-08-07T01:30:13.043 helix_term::application [DEBUG] received editor event: IdleTimer
2023-08-07T01:30:13.141 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":1,"method":"window/workDoneProgress/create","params":{"token":"50ea6c89-b263-438e-b697-63d81b1235d0"}}
2023-08-07T01:30:13.141 helix_term::application [DEBUG] received editor event: LanguageServerMessage((0, MethodCall(MethodCall { jsonrpc: Some(V2), method: "window/workDoneProgress/create", params: Map({"token": String("50ea6c89-b263-438e-b697-63d81b1235d0")}), id: Num(1) })))
2023-08-07T01:30:13.141 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"$/progress","params":{"token":"cca17b40-07c3-4ce2-8471-9f2b065398c0","value":{"kind":"end"}}}
2023-08-07T01:30:13.141 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","result":null,"id":1}
2023-08-07T01:30:13.141 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:13.141 helix_term::application [DEBUG] received editor event: LanguageServerMessage((0, Notification(Notification { jsonrpc: Some(V2), method: "$/progress", params: Map({"token": String("cca17b40-07c3-4ce2-8471-9f2b065398c0"), "value": Object {"kind": String("end")}}) })))
2023-08-07T01:30:13.142 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"$/progress","params":{"token":"50ea6c89-b263-438e-b697-63d81b1235d0","value":{"kind":"begin","title":"Initializing JS/TS language features…"}}}
2023-08-07T01:30:13.142 helix_term::application [DEBUG] received editor event: LanguageServerMessage((0, Notification(Notification { jsonrpc: Some(V2), method: "$/progress", params: Map({"token": String("50ea6c89-b263-438e-b697-63d81b1235d0"), "value": Object {"kind": String("begin"), "title": String("Initializing JS/TS language features…")}}) })))
2023-08-07T01:30:13.641 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:13.641 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/signatureHelp","params":{"position":{"character":0,"line":0},"textDocument":{"uri":"file:///home/unnamed/Desktop/test.js"}},"id":1}
2023-08-07T01:30:13.645 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":1,"result":null}
2023-08-07T01:30:13.645 helix_lsp::transport [INFO] <- null
2023-08-07T01:30:13.645 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:14.042 helix_term::application [DEBUG] received editor event: IdleTimer
2023-08-07T01:30:14.042 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:14.964 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":0,"line":0},"start":{"character":0,"line":0}},"text":"c"}],"textDocument":{"uri":"file:///home/unnamed/Desktop/test.js","version":1}}}
2023-08-07T01:30:14.964 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:15.146 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":1,"line":0},"start":{"character":1,"line":0}},"text":"l"}],"textDocument":{"uri":"file:///home/unnamed/Desktop/test.js","version":2}}}
2023-08-07T01:30:15.146 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:15.289 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":2,"line":0},"start":{"character":2,"line":0}},"text":"a"}],"textDocument":{"uri":"file:///home/unnamed/Desktop/test.js","version":3}}}
2023-08-07T01:30:15.289 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:15.565 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":3,"line":0},"start":{"character":3,"line":0}},"text":"s"}],"textDocument":{"uri":"file:///home/unnamed/Desktop/test.js","version":4}}}
2023-08-07T01:30:15.565 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:15.728 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":4,"line":0},"start":{"character":4,"line":0}},"text":"s"}],"textDocument":{"uri":"file:///home/unnamed/Desktop/test.js","version":5}}}
2023-08-07T01:30:15.728 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:15.973 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":5,"line":0},"start":{"character":5,"line":0}},"text":" "}],"textDocument":{"uri":"file:///home/unnamed/Desktop/test.js","version":6}}}
2023-08-07T01:30:15.973 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:16.374 helix_term::application [DEBUG] received editor event: IdleTimer
2023-08-07T01:30:16.374 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:16.391 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":6,"line":0},"start":{"character":6,"line":0}},"text":"A"}],"textDocument":{"uri":"file:///home/unnamed/Desktop/test.js","version":7}}}
2023-08-07T01:30:16.391 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:16.627 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":7,"line":0},"start":{"character":7,"line":0}},"text":" "}],"textDocument":{"uri":"file:///home/unnamed/Desktop/test.js","version":8}}}
2023-08-07T01:30:16.627 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:16.961 helix_core::auto_pairs [DEBUG] auto pair transaction: Transaction {
    changes: ChangeSet {
        changes: [
            Retain(
                8,
            ),
            Insert(
                "{}",
            ),
            Retain(
                1,
            ),
        ],
        len: 9,
        len_after: 11,
    },
    selection: Some(
        Selection {
            ranges: [
                Range {
                    anchor: 10,
                    head: 9,
                    old_visual_position: None,
                },
            ],
            primary_index: 0,
        },
    ),
}
2023-08-07T01:30:16.961 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":8,"line":0},"start":{"character":8,"line":0}},"text":"{}"}],"textDocument":{"uri":"file:///home/unnamed/Desktop/test.js","version":9}}}
2023-08-07T01:30:16.961 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:17.130 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"$/progress","params":{"token":"50ea6c89-b263-438e-b697-63d81b1235d0","value":{"kind":"end"}}}
2023-08-07T01:30:17.130 helix_term::application [DEBUG] received editor event: LanguageServerMessage((0, Notification(Notification { jsonrpc: Some(V2), method: "$/progress", params: Map({"token": String("50ea6c89-b263-438e-b697-63d81b1235d0"), "value": Object {"kind": String("end")}}) })))
2023-08-07T01:30:17.131 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:17.254 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":9,"line":0},"start":{"character":9,"line":0}},"text":"\n  \n"}],"textDocument":{"uri":"file:///home/unnamed/Desktop/test.js","version":10}}}
2023-08-07T01:30:17.254 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:17.520 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/unnamed/Desktop/test.js","diagnostics":[]}}
2023-08-07T01:30:17.520 helix_term::application [DEBUG] received editor event: LanguageServerMessage((0, Notification(Notification { jsonrpc: Some(V2), method: "textDocument/publishDiagnostics", params: Map({"diagnostics": Array [], "uri": String("file:///home/unnamed/Desktop/test.js")}) })))
2023-08-07T01:30:17.520 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:17.654 helix_term::application [DEBUG] received editor event: IdleTimer
2023-08-07T01:30:17.655 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:18.126 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":2,"line":1},"start":{"character":2,"line":1}},"text":"s"}],"textDocument":{"uri":"file:///home/unnamed/Desktop/test.js","version":11}}}
2023-08-07T01:30:18.126 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:18.332 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":3,"line":1},"start":{"character":3,"line":1}},"text":"t"}],"textDocument":{"uri":"file:///home/unnamed/Desktop/test.js","version":12}}}
2023-08-07T01:30:18.332 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:18.389 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/unnamed/Desktop/test.js","diagnostics":[]}}
2023-08-07T01:30:18.389 helix_term::application [DEBUG] received editor event: LanguageServerMessage((0, Notification(Notification { jsonrpc: Some(V2), method: "textDocument/publishDiagnostics", params: Map({"diagnostics": Array [], "uri": String("file:///home/unnamed/Desktop/test.js")}) })))
2023-08-07T01:30:18.390 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:18.608 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/unnamed/Desktop/test.js","diagnostics":[]}}
2023-08-07T01:30:18.608 helix_term::application [DEBUG] received editor event: LanguageServerMessage((0, Notification(Notification { jsonrpc: Some(V2), method: "textDocument/publishDiagnostics", params: Map({"diagnostics": Array [], "uri": String("file:///home/unnamed/Desktop/test.js")}) })))
2023-08-07T01:30:18.609 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:18.733 helix_term::application [DEBUG] received editor event: IdleTimer
2023-08-07T01:30:18.734 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:18.734 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":4,"line":1},"textDocument":{"uri":"file:///home/unnamed/Desktop/test.js"}},"id":2}
2023-08-07T01:30:18.787 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":2,"result":{"items":[{"label":"accessor","kind":14,"sortText":"15","data":{"file":"/home/unnamed/Desktop/test.js","line":2,"offset":5,"entryNames":["accessor"]},"textEdit":{"newText":"accessor","insert":{"start":{"line":1,"character":2},"end":{"character":4,"line":1}},"replace":{"start":{"line":1,"character":2},"end":{"line":1,"character":4}}}},{"label":"async","kind":14,"sortText":"15","data":{"file":"/home/unnamed/Desktop/test.js","line":2,"offset":5,"entryNames":["async"]},"textEdit":{"newText":"async","insert":{"start":{"line":1,"character":2},"end":{"character":4,"line":1}},"replace":{"start":{"line":1,"character":2},"end":{"line":1,"character":4}}}},{"label":"constructor","kind":14,"sortText":"15","data":{"file":"/home/unnamed/Desktop/test.js","line":2,"offset":5,"entryNames":["constructor"]},"textEdit":{"newText":"constructor","insert":{"start":{"line":1,"character":2},"end":{"character":4,"line":1}},"replace":{"start":{"line":1,"character":2},"end":{"line":1,"character":4}}}},{"label":"get","kind":14,"sortText":"15","data":{"file":"/home/unnamed/Desktop/test.js","line":2,"offset":5,"entryNames":["get"]},"textEdit":{"newText":"get","insert":{"start":{"line":1,"character":2},"end":{"character":4,"line":1}},"replace":{"start":{"line":1,"character":2},"end":{"line":1,"character":4}}}},{"label":"set","kind":14,"sortText":"15","data":{"file":"/home/unnamed/Desktop/test.js","line":2,"offset":5,"entryNames":["set"]},"textEdit":{"newText":"set","insert":{"start":{"line":1,"character":2},"end":{"character":4,"line":1}},"replace":{"start":{"line":1,"character":2},"end":{"line":1,"character":4}}}},{"label":"static","kind":14,"sortText":"15","data":{"file":"/home/unnamed/Desktop/test.js","line":2,"offset":5,"entryNames":["static"]},"textEdit":{"newText":"static","insert":{"start":{"line":1,"character":2},"end":{"character":4,"line":1}},"replace":{"start":{"line":1,"character":2},"end":{"line":1,"character":4}}}}],"isIncomplete":false}}
2023-08-07T01:30:18.788 helix_lsp::transport [INFO] <- {"isIncomplete":false,"items":[{"data":{"entryNames":["accessor"],"file":"/home/unnamed/Desktop/test.js","line":2,"offset":5},"kind":14,"label":"accessor","sortText":"15","textEdit":{"insert":{"end":{"character":4,"line":1},"start":{"character":2,"line":1}},"newText":"accessor","replace":{"end":{"character":4,"line":1},"start":{"character":2,"line":1}}}},{"data":{"entryNames":["async"],"file":"/home/unnamed/Desktop/test.js","line":2,"offset":5},"kind":14,"label":"async","sortText":"15","textEdit":{"insert":{"end":{"character":4,"line":1},"start":{"character":2,"line":1}},"newText":"async","replace":{"end":{"character":4,"line":1},"start":{"character":2,"line":1}}}},{"data":{"entryNames":["constructor"],"file":"/home/unnamed/Desktop/test.js","line":2,"offset":5},"kind":14,"label":"constructor","sortText":"15","textEdit":{"insert":{"end":{"character":4,"line":1},"start":{"character":2,"line":1}},"newText":"constructor","replace":{"end":{"character":4,"line":1},"start":{"character":2,"line":1}}}},{"data":{"entryNames":["get"],"file":"/home/unnamed/Desktop/test.js","line":2,"offset":5},"kind":14,"label":"get","sortText":"15","textEdit":{"insert":{"end":{"character":4,"line":1},"start":{"character":2,"line":1}},"newText":"get","replace":{"end":{"character":4,"line":1},"start":{"character":2,"line":1}}}},{"data":{"entryNames":["set"],"file":"/home/unnamed/Desktop/test.js","line":2,"offset":5},"kind":14,"label":"set","sortText":"15","textEdit":{"insert":{"end":{"character":4,"line":1},"start":{"character":2,"line":1}},"newText":"set","replace":{"end":{"character":4,"line":1},"start":{"character":2,"line":1}}}},{"data":{"entryNames":["static"],"file":"/home/unnamed/Desktop/test.js","line":2,"offset":5},"kind":14,"label":"static","sortText":"15","textEdit":{"insert":{"end":{"character":4,"line":1},"start":{"character":2,"line":1}},"newText":"static","replace":{"end":{"character":4,"line":1},"start":{"character":2,"line":1}}}}]}
2023-08-07T01:30:18.788 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:19.547 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:19.948 helix_term::application [DEBUG] received editor event: IdleTimer
2023-08-07T01:30:19.948 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:19.948 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"completionItem/resolve","params":{"data":{"entryNames":["static"],"file":"/home/unnamed/Desktop/test.js","line":2,"offset":5},"kind":14,"label":"static","sortText":"15","textEdit":{"insert":{"end":{"character":4,"line":1},"start":{"character":2,"line":1}},"newText":"static","replace":{"end":{"character":4,"line":1},"start":{"character":2,"line":1}}}},"id":3}
2023-08-07T01:30:19.953 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":3,"result":{"data":{"entryNames":["static"],"file":"/home/unnamed/Desktop/test.js","line":2,"offset":5},"kind":14,"label":"static","sortText":"15","textEdit":{"insert":{"end":{"character":4,"line":1},"start":{"character":2,"line":1}},"newText":"static","replace":{"end":{"character":4,"line":1},"start":{"character":2,"line":1}}},"detail":"static"}}
2023-08-07T01:30:19.953 helix_lsp::transport [INFO] <- {"data":{"entryNames":["static"],"file":"/home/unnamed/Desktop/test.js","line":2,"offset":5},"detail":"static","kind":14,"label":"static","sortText":"15","textEdit":{"insert":{"end":{"character":4,"line":1},"start":{"character":2,"line":1}},"newText":"static","replace":{"end":{"character":4,"line":1},"start":{"character":2,"line":1}}}}
2023-08-07T01:30:19.953 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:20.273 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":4,"line":1},"start":{"character":2,"line":1}},"text":"static"}],"textDocument":{"uri":"file:///home/unnamed/Desktop/test.js","version":15}}}
2023-08-07T01:30:20.273 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":8,"line":1},"start":{"character":8,"line":1}},"text":" "}],"textDocument":{"uri":"file:///home/unnamed/Desktop/test.js","version":16}}}
2023-08-07T01:30:20.273 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:20.274 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/signatureHelp","params":{"position":{"character":8,"line":1},"textDocument":{"uri":"file:///home/unnamed/Desktop/test.js"}},"id":4}
2023-08-07T01:30:20.282 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":4,"result":null}
2023-08-07T01:30:20.282 helix_lsp::transport [INFO] <- null
2023-08-07T01:30:20.283 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:20.531 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/unnamed/Desktop/test.js","diagnostics":[]}}
2023-08-07T01:30:20.531 helix_term::application [DEBUG] received editor event: LanguageServerMessage((0, Notification(Notification { jsonrpc: Some(V2), method: "textDocument/publishDiagnostics", params: Map({"diagnostics": Array [], "uri": String("file:///home/unnamed/Desktop/test.js")}) })))
2023-08-07T01:30:20.532 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:21.128 helix_core::auto_pairs [DEBUG] auto pair transaction: Transaction {
    changes: ChangeSet {
        changes: [
            Retain(
                19,
            ),
            Insert(
                "{}",
            ),
            Retain(
                3,
            ),
        ],
        len: 22,
        len_after: 24,
    },
    selection: Some(
        Selection {
            ranges: [
                Range {
                    anchor: 21,
                    head: 20,
                    old_visual_position: None,
                },
            ],
            primary_index: 0,
        },
    ),
}
2023-08-07T01:30:21.129 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":9,"line":1},"start":{"character":9,"line":1}},"text":"{}"}],"textDocument":{"uri":"file:///home/unnamed/Desktop/test.js","version":17}}}
2023-08-07T01:30:21.129 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:21.393 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/unnamed/Desktop/test.js","diagnostics":[]}}
2023-08-07T01:30:21.393 helix_term::application [DEBUG] received editor event: LanguageServerMessage((0, Notification(Notification { jsonrpc: Some(V2), method: "textDocument/publishDiagnostics", params: Map({"diagnostics": Array [], "uri": String("file:///home/unnamed/Desktop/test.js")}) })))
2023-08-07T01:30:21.394 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:21.528 helix_term::application [DEBUG] received editor event: IdleTimer
2023-08-07T01:30:21.529 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:22.157 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":10,"line":1},"start":{"character":10,"line":1}},"text":"\n  \n"}],"textDocument":{"uri":"file:///home/unnamed/Desktop/test.js","version":18}}}
2023-08-07T01:30:22.158 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:22.422 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/unnamed/Desktop/test.js","diagnostics":[]}}
2023-08-07T01:30:22.422 helix_term::application [DEBUG] received editor event: LanguageServerMessage((0, Notification(Notification { jsonrpc: Some(V2), method: "textDocument/publishDiagnostics", params: Map({"diagnostics": Array [], "uri": String("file:///home/unnamed/Desktop/test.js")}) })))
2023-08-07T01:30:22.423 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:22.559 helix_term::application [DEBUG] received editor event: IdleTimer
2023-08-07T01:30:22.559 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-08-07T01:30:24.244 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 1
2023-08-07T01:30:24.245 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 1
2023-08-07T01:30:25.452 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 1
2023-08-07T01:30:25.853 helix_term::application [DEBUG] received editor event: IdleTimer
2023-08-07T01:30:25.887 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 1
2023-08-07T01:30:26.030 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 1
2023-08-07T01:30:26.763 helix_view::document [DEBUG] submitting save of doc 'Some("/home/unnamed/Desktop/test.js")'
2023-08-07T01:30:26.763 helix_term::job [DEBUG] waiting on jobs...
2023-08-07T01:30:26.764 helix_view::document [DEBUG] doc 1 revision updated 0 -> 1
2023-08-07T01:30:26.764 helix_term::commands::typed [DEBUG] quitting...
2023-08-07T01:30:26.764 helix_view::document [DEBUG] id 1 modified - last saved: 1, current: 1
2023-08-07T01:30:26.764 helix_term::job [DEBUG] waiting on jobs...
2023-08-07T01:30:26.764 helix_term::job [DEBUG] waiting on jobs...
2023-08-07T01:30:26.764 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"shutdown","id":5}
2023-08-07T01:30:26.766 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":5,"result":null}
2023-08-07T01:30:26.766 helix_lsp::transport [INFO] <- null
2023-08-07T01:30:26.766 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"exit"}

Platform

Linux arch 6.4.7-arch1-3

Terminal Emulator

wezterm 20230712-072601-f4abf8fd

Helix Version

helix 23.05

@unnamedname unnamedname added the C-bug Category: This is a bug label Aug 6, 2023
@pascalkuthe pascalkuthe added A-indent Area: Indentation A-language-support Area: Support for programming/text languages labels Aug 6, 2023
@David-Else
Copy link
Contributor

There were some improvements on master since 23.05 was released: #7207 , not sure if they affect indentation, but maybe give them a try: https://docs.helix-editor.com/install.html#building-from-source

@woojiq
Copy link
Contributor

woojiq commented Aug 7, 2023

The reason this doesn't work is that helix currently has a very old version of tree-sitter-javascript which does not support the new ecma2022 features. static block has been added to the TS here. The solution is to update the TS revision and add additional indent queries.

@David-Else
Copy link
Contributor

I see @the-mikedavis just made a commit to that repo :) Perhaps he is thinking of updating the Helix version? I think it ties together with https://github.com/tree-sitter/tree-sitter-typescript ?

@unnamedname

This comment was marked as outdated.

@woojiq

This comment was marked as outdated.

@unnamedname
Copy link
Author

Thanks! @woojiq Can confirm it's fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-indent Area: Indentation A-language-support Area: Support for programming/text languages C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants