LuaLS / LuaLS/lua-language-server

Disable snippets via `capabilities`?

Open
#3,000 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
4.4k
Forks
442
PR merge metrics
No merged PRs in 30d

Description

How are you using the lua-language-server?

NeoVim

Which OS are you using?

MacOS

What is the issue affecting?

Completion

Expected Behaviour

According to the LSP spec, clients should be able to disable support for snippets by setting capabilities.textDocument.completion.completionItem.snippetSupport = false. However, lua-language-server seems to ignore this setting in favor of its own (non-standard?) settings (completion.callSnippet = "Disable" and completion.keywordSnippet = "Disable".

Actual Behaviour

Even if a user sets capabilities.textDocument.completion.completionItem.snippetSupport = false, snippets continue to be sent by the language server.

Reproduction steps
  1. Set capabilities.textDocument.completion.completionItem.snippetSupport = false
  2. Start typing i... or fo..
  3. Snippets will be shown for if and for.
Additional Notes

Since it seems standard to disable snippets using the capabilities setting, I'm hoping that lua-language-server can support that.

Log File

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing completion for if and for in NeoVim with capabilities.textDocument.completion.completionItem.snippetSupport = false, then trace the language server's completion handling. Done means the server respects that capability and stops sending snippets when it is disabled, without relying on the separate completion.callSnippet or completion.keywordSnippet settings.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, macos, neovim
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.