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

Feature flag request: Separate argument injection from snippets #685

Closed
peteruhnak opened this issue Sep 28, 2022 · 1 comment · Fixed by #1317
Closed

Feature flag request: Separate argument injection from snippets #685

peteruhnak opened this issue Sep 28, 2022 · 1 comment · Fixed by #1317
Labels
enhancement New feature or request

Comments

@peteruhnak
Copy link

Would it be possible to separate argument injection into its own config independent of enable_snippets?

With enable_snippets enabled, accepting a function completion also injects the function's args and types,

e.g.

exe.addCS

is completed to

exe.addCSourceFile(file: []const u8, flags: []const []const u8)

instead of

exe.addCSourceFile()

I'm sure this is quite useful to some people and some code editors, but it seems like a separate functionality to be toggled independently (and to me it is quite annoying).

So basically change the code here to use different flag, and add docs for it & everything

const use_snippets = server.config.enable_snippets and server.client_capabilities.supports_snippets;

I can create a PR if you are ok with the change.

@peteruhnak peteruhnak added the enhancement New feature or request label Sep 28, 2022
@Techatrix
Copy link
Member

Sounds like a good idea.
Because its sometimes easy to forget editing all locations for a new config options, i will list them here which may help you:

  1. enable_snippets: bool = false,
  2. enable_snippets: ?bool,
  3. "enable_snippets": {
  4. zls/README.md

    Line 106 in a70beba

    | `enable_snippets` | `bool` | `false` | Enables snippet completions when the client also supports them. |
  5. const snippets = try askBool("Do you want to enable snippets?");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants