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

feat: add LspReconfigure command #2763

Closed
wants to merge 1 commit into from

Conversation

overhacked
Copy link

@overhacked overhacked commented Aug 14, 2023

Add command LspReconfigure that allows overriding settings for LSP servers attached to the current buffer.

Does some command-line parsing so that:

  • Bare string literals don't have to be quoted:
    :LspReconfigure Lua.hint.paramName=Disable ➡️ Lua.hint.paramName="Disable"
  • Non-Lua-Name characters get properly quoted, and JSON literals (true/false/null) do not:
    rust-analyzer.assist.emitMustUse=true ➡️ ["rust-analyzer"].assist.emitMustUse=true
  • List-based settings can be assigned without using JSON syntax:
    Lua.diagnostics.disable=cast-local-type,cast-type-mismatch ➡️ Lua.diagnostics.disable=["cast-local-type","cast-type-mismatch"]
    Lua.diagnostics.disable=cast-local-type, ➡️ Lua.diagnostics.disable=["cast-local-type"]

In all of these cases, an "autotable" is generated so that arbitrarily-nested settings keys can be used, and the value can be any legal JSON expression so complex lists and mappings can be used if necessary.

@overhacked overhacked force-pushed the reconfigure-cmd branch 2 times, most recently from 23dedc3 to 0fc8e42 Compare August 14, 2023 13:46
@overhacked overhacked marked this pull request as ready for review August 14, 2023 13:48
Add a command-line command `LspReconfigure` that allows overriding LSP
server settings for servers attached to the current buffer. Does some
command-line parsing so that deeply nested settings can be modified and
mapping or list settings can be specified as a string.
@justinmk
Copy link
Member

This is too much code and too complicated.

This repo is a collection of configs. It is not another platform that accumulates endless features. Actual LSP features should be added in Nvim core or as third-party plugins.

@justinmk justinmk closed this Sep 10, 2023
@overhacked
Copy link
Author

Understand and appreciate rejecting feature creep. I'll look for a better home for this functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants