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

Panic on LSP completion #4473

Closed
xbol0 opened this issue Oct 26, 2022 · 2 comments
Closed

Panic on LSP completion #4473

xbol0 opened this issue Oct 26, 2022 · 2 comments
Labels
A-language-server Area: Language server client C-bug Category: This is a bug

Comments

@xbol0
Copy link

xbol0 commented Oct 26, 2022

Summary

thread 'main' panicked at 'not implemented: completion: insert_and_replace InsertReplaceEdit { new_text: "?.[Symbol]", insert: Range { start: Position { line: 43, character: 34 }, end: Position { line: 43, character: 35 } }, replace: Range { start: Position { line: 43, character: 34 }, end: Position { line: 43, character: 35 } } }', helix-term/src/ui/completion.rs:112:29
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I'm using Deno, here's my language.toml:

[[language]]
name = "javascript"
shebangs = ["deno", "node"]
auto-format = true
roots = ["deno.json", "package.json", "tsconfig.json"]
config = { enable = true, lint = true, unstable = true }
language-server = { command = "deno", args = ["lsp"], language-id = "javascript" }

[[language]]
name = "jsx"
shebangs = ["deno", "node"]
auto-format = true
roots = ["deno.json", "package.json", "tsconfig.json"]
config = { enable = true, lint = true, unstable = true }
language-server = { command = "deno", args = ["lsp"], language-id = "javascriptreact" }

[[language]]
name = "typescript"
shebangs = ["deno"]
auto-format = true
roots = ["deno.json"]
config = { enable = true, lint = true, unstable = true }
language-server = { command = "deno", args = ["lsp"], language-id = "typescript" }

[[language]]
name = "tsx"
shebangs = ["deno", "node"]
auto-format = true
roots = ["deno.json", "package.json", "tsconfig.json"]
config = { enable = true, lint = true, unstable = true }
language-server = { command = "deno", args = ["lsp"], language-id = "typescriptreact" }

It panic many times.

Reproduction Steps

https://asciinema.org/a/Oa2WMFaTzMdlG6pdQ8VcazC8d
I tried this:

  1. hx

Use tab switch completion items, it panicked.

Helix log

~/.cache/helix/helix.log
2022-10-26T15:04:06.283 helix_view::theme [WARN] Theme: malformed hexcode: highlight
2022-10-26T15:04:06.430 helix_lsp::transport [ERROR] err <- "Starting Deno language server...\n"
2022-10-26T15:04:06.431 helix_lsp::transport [ERROR] err <- "  version: 1.26.2 (release, aarch64-apple-darwin)\n"
2022-10-26T15:04:06.431 helix_lsp::transport [ERROR] err <- "  executable: /opt/homebrew/bin/deno\n"
2022-10-26T15:04:06.507 helix_lsp::transport [ERROR] err <- "Server ready.\n"
2022-10-26T15:04:06.511 helix_lsp::transport [ERROR] err <- "failed to update settings: invalid type: null, expected struct WorkspaceSettings\n"
2022-10-26T15:04:06.511 helix_lsp::transport [ERROR] err <- "Error converting specifier settings (file:///Users/boloto/Desktop/commoe/commoe.ts): Error converting specifier settings: invalid type: null, expected struct SpecifierSettings\n"
2022-10-26T15:23:49.938 helix_lsp::transport [ERROR] err <- "Format error: Unexpected token `)`. Expected this, import, async, function, [ for array literal, { for object literal, @ for decorator, function, class, null, true, false, number, bigint, string, regexp, ` for template literal, (, or an identifier at file:///Users/boloto/Desktop/commoe/commoe.ts:23:8\n"
2022-10-26T15:23:49.940 helix_term::application [WARN] unhandled window/showMessage: ShowMessageParams { typ: Warning, message: "Unable to format \"file:///Users/boloto/Desktop/commoe/commoe.ts\". Likely due to unrecoverable syntax errors in the file." }
2022-10-26T15:24:06.250 helix_lsp::transport [ERROR] err <- "Format error: Unexpected token `)`. Expected this, import, async, function, [ for array literal, { for object literal, @ for decorator, function, class, null, true, false, number, bigint, string, regexp, ` for template literal, (, or an identifier at file:///Users/boloto/Desktop/commoe/commoe.ts:25:8\n"
2022-10-26T15:24:06.250 helix_term::application [WARN] unhandled window/showMessage: ShowMessageParams { typ: Warning, message: "Unable to format \"file:///Users/boloto/Desktop/commoe/commoe.ts\". Likely due to unrecoverable syntax errors in the file." }
2022-10-26T15:24:18.686 helix_lsp::transport [ERROR] err <- "Format error: Unexpected token `)`. Expected this, import, async, function, [ for array literal, { for object literal, @ for decorator, function, class, null, true, false, number, bigint, string, regexp, ` for template literal, (, or an identifier at file:///Users/boloto/Desktop/commoe/commoe.ts:25:8\n"
2022-10-26T15:24:18.687 helix_term::application [WARN] unhandled window/showMessage: ShowMessageParams { typ: Warning, message: "Unable to format \"file:///Users/boloto/Desktop/commoe/commoe.ts\". Likely due to unrecoverable syntax errors in the file." }
2022-10-26T15:24:53.577 helix_lsp::transport [ERROR] err <- "Format error: Unexpected token `)`. Expected this, import, async, function, [ for array literal, { for object literal, @ for decorator, function, class, null, true, false, number, bigint, string, regexp, ` for template literal, (, or an identifier at file:///Users/boloto/Desktop/commoe/commoe.ts:28:8\n"
2022-10-26T15:24:53.578 helix_term::application [WARN] unhandled window/showMessage: ShowMessageParams { typ: Warning, message: "Unable to format \"file:///Users/boloto/Desktop/commoe/commoe.ts\". Likely due to unrecoverable syntax errors in the file." }
2022-10-26T15:25:08.977 helix_lsp::transport [ERROR] err <- "Format error: Unexpected token `)`. Expected this, import, async, function, [ for array literal, { for object literal, @ for decorator, function, class, null, true, false, number, bigint, string, regexp, ` for template literal, (, or an identifier at file:///Users/boloto/Desktop/commoe/commoe.ts:28:8\n"
2022-10-26T15:25:08.978 helix_term::application [WARN] unhandled window/showMessage: ShowMessageParams { typ: Warning, message: "Unable to format \"file:///Users/boloto/Desktop/commoe/commoe.ts\". Likely due to unrecoverable syntax errors in the file." }

Platform

macOS 13.0 (22A380) m1 chip

Terminal Emulator

iterm2

Helix Version

helix 22.08.1 (66276ce)

@xbol0 xbol0 added the C-bug Category: This is a bug label Oct 26, 2022
@archseer
Copy link
Member

Nice! Now we have some sample data for

lsp::CompletionTextEdit::InsertAndReplace(item) => {
unimplemented!("completion: insert_and_replace {:?}", item)
}

@the-mikedavis the-mikedavis added the A-language-server Area: Language server client label Oct 29, 2022
@xbol0
Copy link
Author

xbol0 commented Nov 8, 2022

When would you fix this bug? This problem makes me have to repeating work when i forgot saving.😭

herkhinah pushed a commit to herkhinah/helix that referenced this issue Dec 11, 2022
freqmod pushed a commit to freqmod/helix that referenced this issue Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-language-server Area: Language server client C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

3 participants