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

autocomplete gives duplicated text in nix #12540

Open
aster-void opened this issue Jan 15, 2025 · 0 comments
Open

autocomplete gives duplicated text in nix #12540

aster-void opened this issue Jan 15, 2025 · 0 comments
Labels
C-bug Category: This is a bug

Comments

@aster-void
Copy link
Contributor

Summary

When I autocomplete this,

pkgs.tailwindcss-<cursor>

I sometimes get this

pkgs.tailwindcss-tailwindcss-language-server<cursor>

which is not what I expect.

apparently it sometimes happen when I autocomplete package that consists of more than or eq to two words, separated by -
I'm not sure if this is helix or nixd bug.

Reproduction Steps

I tried this:

  1. install nixd, which gives the autocomplete feature
  2. hx example.nix
  3. write below in example.nix
{pkgs}:
pkgs.tailwindcss-language-servre
  1. delete the last 2 words
{pkgs}:
pkgs.tailwindcss-
  1. append lang so it becomes
{pkgs}:
pkgs.tailwindcss-lang
  1. wait for the autocomplete and press tab

I expected this to happen:

it completes to tailwindcss-language-server

Instead, this happened:

it gave me tailwindcss-tailwindcss-language-server

it's inconsistent so you may have to try a few times to get it to reproduce.

Helix log

~/.cache/helix/helix.log
2025-01-15T12:13:04.481 helix_lsp::transport [ERROR] nixd err <- "I[12:13:04.481] 771968: <-- initialize(0)\n"
2025-01-15T12:13:04.481 helix_lsp::transport [ERROR] nixd err <- "I[12:13:04.481] 771968: --> reply:initialize(0)\n"
2025-01-15T12:13:04.484 helix_lsp::transport [ERROR] nixd err <- "I[12:13:04.484] 771968: --> call window/workDoneProgress/create(1)\n"
2025-01-15T12:13:04.484 helix_lsp::transport [ERROR] nixd err <- "I[12:13:04.484] 771968: --> notify $/progress\n"
2025-01-15T12:13:04.484 helix_lsp::transport [ERROR] nixd err <- "I[12:13:04.484] 771968: --> call attrset/evalExpr(1)\n"
2025-01-15T12:13:04.486 helix_lsp::transport [ERROR] nixd err <- "I[12:13:04.486] 771968: --> call window/workDoneProgress/create(2)\n"
2025-01-15T12:13:04.486 helix_lsp::transport [ERROR] nixd err <- "I[12:13:04.486] 771968: --> notify $/progress\n"
2025-01-15T12:13:04.486 helix_lsp::transport [ERROR] nixd err <- "I[12:13:04.486] 771968: --> call attrset/evalExpr(1)\n"
2025-01-15T12:13:04.486 helix_lsp::transport [ERROR] nixd err <- "I[12:13:04.486] 771968: --> call workspace/configuration(3)\n"
2025-01-15T12:13:04.487 helix_lsp::transport [ERROR] nixd err <- "I[12:13:04.487] 771968: <-- initialized\n"
2025-01-15T12:13:04.487 helix_lsp::transport [ERROR] nixd err <- "I[12:13:04.487] 771968: <-- textDocument/didOpen\n"
2025-01-15T12:13:04.487 helix_lsp::transport [ERROR] nixd err <- "I[12:13:04.487] 771968: --> notify textDocument/publishDiagnostics\n"
2025-01-15T12:13:04.487 helix_lsp::transport [ERROR] nixd err <- "I[12:13:04.487] 771968: <-- reply(1)\n"
2025-01-15T12:13:04.487 helix_lsp::transport [ERROR] nixd err <- "I[12:13:04.487] 771968: <-- reply(2)\n"
2025-01-15T12:13:04.488 helix_lsp::transport [ERROR] nixd err <- "I[12:13:04.487] 771968: <-- reply(3)\n"
2025-01-15T12:13:04.488 helix_lsp::transport [ERROR] nixd err <- "E[12:13:04.488] 771968: workspace/configuration: parse error expected object\n"
2025-01-15T12:13:05.522 helix_lsp::transport [ERROR] nixd err <- "I[12:13:05.522] 771968: <-- reply(1)\n"
2025-01-15T12:13:05.522 helix_lsp::transport [ERROR] nixd err <- "I[12:13:05.522] 771968: --> notify $/progress\n"
2025-01-15T12:13:06.744 helix_lsp::transport [ERROR] nixd err <- "I[12:13:06.744] 771968: <-- textDocument/didChange\n"
2025-01-15T12:13:06.745 helix_lsp::transport [ERROR] nixd err <- "I[12:13:06.744] 771968: --> notify textDocument/publishDiagnostics\n"
2025-01-15T12:13:06.758 helix_lsp::transport [ERROR] nixd err <- "I[12:13:06.758] 771968: <-- textDocument/completion(1)\n"
2025-01-15T12:13:06.759 helix_lsp::transport [ERROR] nixd err <- "I[12:13:06.759] 771968: --> reply:textDocument/completion(1)\n"
2025-01-15T12:13:07.218 helix_lsp::transport [ERROR] nixd err <- "I[12:13:07.218] 771968: <-- textDocument/didChange\n"
2025-01-15T12:13:07.218 helix_lsp::transport [ERROR] nixd err <- "I[12:13:07.218] 771968: --> notify textDocument/publishDiagnostics\n"
2025-01-15T12:13:07.282 helix_lsp::transport [ERROR] nixd err <- "I[12:13:07.282] 771968: <-- textDocument/didChange\n"
2025-01-15T12:13:07.283 helix_lsp::transport [ERROR] nixd err <- "I[12:13:07.282] 771968: --> notify textDocument/publishDiagnostics\n"
2025-01-15T12:13:07.534 helix_lsp::transport [ERROR] nixd err <- "I[12:13:07.534] 771968: <-- textDocument/completion(2)\n"
2025-01-15T12:13:07.562 helix_lsp::transport [ERROR] nixd err <- "I[12:13:07.534] 771968: --> call attrset/attrpathComplete(2)\n"
2025-01-15T12:13:07.562 helix_lsp::transport [ERROR] nixd err <- "I[12:13:07.544] 771968: <-- textDocument/didChange\n"
2025-01-15T12:13:07.562 helix_lsp::transport [ERROR] nixd err <- "I[12:13:07.544] 771968: --> notify textDocument/publishDiagnostics\n"
2025-01-15T12:13:07.562 helix_lsp::transport [ERROR] nixd err <- "I[12:13:07.544] 771968: <-- reply(1)\n"
2025-01-15T12:13:07.562 helix_lsp::transport [ERROR] nixd err <- "I[12:13:07.544] 771968: --> notify $/progress\n"
2025-01-15T12:13:07.562 helix_lsp::transport [ERROR] nixd err <- "I[12:13:07.551] 771968: <-- reply(2)\n"
2025-01-15T12:13:07.562 helix_lsp::transport [ERROR] nixd err <- "I[12:13:07.552] 771968: --> reply:textDocument/completion(2)\n"
2025-01-15T12:13:07.999 helix_lsp::transport [ERROR] nixd err <- "I[12:13:07.999] 771968: <-- textDocument/didChange\n"
2025-01-15T12:13:08.000 helix_lsp::transport [ERROR] nixd err <- "I[12:13:08.000] 771968: --> notify textDocument/publishDiagnostics\n"
2025-01-15T12:13:08.215 helix_lsp::transport [ERROR] nixd err <- "I[12:13:08.215] 771968: <-- textDocument/didChange\n"
2025-01-15T12:13:08.216 helix_lsp::transport [ERROR] nixd err <- "I[12:13:08.216] 771968: --> notify textDocument/publishDiagnostics\n"
2025-01-15T12:13:08.434 helix_lsp::transport [ERROR] nixd err <- "I[12:13:08.433] 771968: <-- textDocument/didChange\n"
2025-01-15T12:13:08.434 helix_lsp::transport [ERROR] nixd err <- "I[12:13:08.434] 771968: --> notify textDocument/publishDiagnostics\n"
2025-01-15T12:13:08.577 helix_lsp::transport [ERROR] nixd err <- "I[12:13:08.577] 771968: <-- textDocument/didChange\n"
2025-01-15T12:13:08.578 helix_lsp::transport [ERROR] nixd err <- "I[12:13:08.577] 771968: --> notify textDocument/publishDiagnostics\n"
2025-01-15T12:13:08.828 helix_lsp::transport [ERROR] nixd err <- "I[12:13:08.828] 771968: <-- textDocument/completion(3)\n"
2025-01-15T12:13:08.829 helix_lsp::transport [ERROR] nixd err <- "I[12:13:08.829] 771968: --> call attrset/attrpathComplete(3)\n"
2025-01-15T12:13:08.851 helix_lsp::transport [ERROR] nixd err <- "I[12:13:08.850] 771968: <-- reply(3)\n"
2025-01-15T12:13:08.851 helix_lsp::transport [ERROR] nixd err <- "I[12:13:08.851] 771968: --> reply:textDocument/completion(3)\n"
2025-01-15T12:13:08.910 helix_lsp::transport [ERROR] nixd err <- "I[12:13:08.910] 771968: <-- textDocument/didChange\n"
2025-01-15T12:13:08.910 helix_lsp::transport [ERROR] nixd err <- "I[12:13:08.910] 771968: --> notify textDocument/publishDiagnostics\n"
2025-01-15T12:13:09.391 helix_lsp::transport [ERROR] nixd err <- "I[12:13:09.391] 771968: <-- textDocument/didChange\n"
2025-01-15T12:13:09.391 helix_lsp::transport [ERROR] nixd err <- "I[12:13:09.391] 771968: --> notify textDocument/publishDiagnostics\n"
2025-01-15T12:13:10.100 helix_lsp::transport [ERROR] nixd err <- "I[12:13:10.100] 771968: <-- completionItem/resolve(4)\n"
2025-01-15T12:13:10.101 helix_lsp::transport [ERROR] nixd err <- "I[12:13:10.101] 771968: --> call attrset/attrpathInfo(4)\n"
2025-01-15T12:13:10.106 helix_lsp::transport [ERROR] nixd err <- "I[12:13:10.106] 771968: <-- reply(4)\n"
2025-01-15T12:13:10.106 helix_lsp::transport [ERROR] nixd err <- "I[12:13:10.106] 771968: --> reply:completionItem/resolve(4)\n"
2025-01-15T12:13:10.692 helix_lsp::transport [ERROR] nixd err <- "I[12:13:10.692] 771968: <-- textDocument/didChange\n"
2025-01-15T12:13:10.692 helix_lsp::transport [ERROR] nixd err <- "I[12:13:10.692] 771968: --> notify textDocument/publishDiagnostics\n"
2025-01-15T12:13:10.693 helix_lsp::transport [ERROR] nixd err <- "I[12:13:10.693] 771968: <-- textDocument/didChange\n"
2025-01-15T12:13:10.693 helix_lsp::transport [ERROR] nixd err <- "I[12:13:10.693] 771968: --> notify textDocument/publishDiagnostics\n"
2025-01-15T12:13:11.838 helix_lsp::transport [ERROR] nixd err <- "I[12:13:11.838] 771968: <-- textDocument/didSave\n"
2025-01-15T12:13:11.838 helix_lsp::transport [ERROR] nixd err <- "I[12:13:11.838] 771968: unhandled notification textDocument/didSave\n"
2025-01-15T12:13:11.838 helix_lsp::transport [ERROR] nixd err <- "I[12:13:11.838] 771968: <-- shutdown(5)\n"
2025-01-15T12:13:11.838 helix_lsp::transport [ERROR] nixd err <- "I[12:13:11.838] 771968: --> reply:shutdown(5)\n"
2025-01-15T12:13:11.839 helix_lsp::transport [ERROR] nixd err <- "I[12:13:11.839] 771968: <-- exit\n"
2025-01-15T12:13:11.841 helix_lsp::transport [ERROR] err: <- Other(failed to send a message to server

Caused by:
    channel closed)
2025-01-15T12:13:11.841 helix_lsp::transport [ERROR] nil err: <- StreamClosed

Platform

Linux

Terminal Emulator

kitty 0.38.1 created by Kovid Goyal

Installation Method

flake

Helix Version

helix 25.01 (ca19496)

@aster-void aster-void added the C-bug Category: This is a bug label Jan 15, 2025
@aster-void aster-void changed the title autocomplete gives duplicated text autocomplete gives duplicated text in nix Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

1 participant