zed icon indicating copy to clipboard operation
zed copied to clipboard

Word based suggestions

Open chloerei opened this issue 1 year ago • 9 comments

Check for existing issues

  • [X] Completed

Describe the feature

Because some languages are very dynamic (such as Ruby), LSP cannot fully meet the needs of code completion. If it can support Word based suggestions, it will be an effective supplement.

It would be nice to provide options to turn this feature on or off globally or for specific languages.

If applicable, add mockups / screenshots to help present your vision of the feature

Zed

截屏2023-03-13 14 36 45

VSCode

截屏2023-03-13 14 36 22

chloerei avatar Mar 13 '23 06:03 chloerei

I use several languages that Zed doesn't fully support (e.g. Elm). Having a word based autocomplete would make a huge difference.

sporto avatar Nov 15 '23 21:11 sporto

Thanks for the suggestion @chloerei, this would be a great feature to have in Zed. :)

JosephTLyons avatar Nov 17 '23 21:11 JosephTLyons

Just a quick question (while semantic autocompletion is not available in Zed yet): is there a way to use generic semantic autocompletion servers for the languages which have to dedicated language servers?

For example here is a simple completion language server, which successfully works with Helix. I was hoping to enable it for plain text files like this:

  // Different settings for specific languages.
  "languages": {
    "Plain Text": {
      "language_servers": ["scls"]
    }
  }

But this does not seems to work. Is there a way to enable it? Help appreciated, thanks!

VKondakoff avatar May 02 '24 16:05 VKondakoff

Just a quick question (while semantic autocompletion is not available in Zed yet): is there a way to use generic semantic autocompletion servers for the languages which have to dedicated language servers?

For example here is a simple completion language server, which successfully works with Helix. I was hoping to enable it for plain text files like this:

  // Different settings for specific languages.
  "languages": {
    "Plain Text": {
      "language_servers": ["scls"]
    }
  }

But this does not seems to work. Is there a way to enable it? Help appreciated, thanks!

I simply packaged this LSP: https://github.com/d1y/simple-completion-zed

image

d1y avatar May 03 '24 22:05 d1y

Hey, thanks a lot, @d1y!

Can you, please, give a bit more installation instructions? I have successfully installed the LSP. What's next? Looks like this is a Zed extension. I tried to install it using the Install Dev Extension command, but this does not work. Should I compile the extension first?

And another question: how to enable the LSP for specific language (say, for plain text files)?

VKondakoff avatar May 04 '24 10:05 VKondakoff

I tried to install it using the Install Dev Extension command

@VKondakoff Add wasm32-wasi after try install

rustup target add wasm32-wasi

zed: open log cooperate to view the compilation log

https://github.com/zed-industries/zed/blob/8d390f986df632a77258c94bd7194dd20ef89706/crates/extension/src/extension_builder.rs#L120-L129

how to enable the LSP for specific language (say, for plain text files)?

I have many languages ​​enabled by default (https://github.com/d1y/simple-completion-zed/blob/abe9073176a3804df125b5d25fe82d46385fcc37/extension.toml#L14-L39) But for now I don’t know how to enable plain text 🤔

For information about disabling and enabling a certain language, please see #10906 here

d1y avatar May 04 '24 11:05 d1y

Thanks for helping!

rustup target add wasm32-wasi

Done! Снимок экрана 2024-05-04 в 14 42 51

Still no way to install using the Install Dev Extension command. Here is what I see:

Снимок экрана 2024-05-04 в 14 41 31

Am I doing something wrong? Maybe extension should be compiled before trying to install it?

VKondakoff avatar May 04 '24 11:05 VKondakoff

@VKondakoff I don't know where you made a mistake, you can go to the discord channel for help

d1y avatar May 04 '24 12:05 d1y

Ahh... Got it working. This was my mistake: after running the Install Dev Extension command I was expecting to open a file (extension.toml, for example), while I should open a folder containing the extension. Silly me!

@d1y, thank you for your help and for the extension!

VKondakoff avatar May 04 '24 12:05 VKondakoff