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 _typescript.configurePlugin workspace command #607

Merged
merged 3 commits into from
Oct 11, 2022

Conversation

mskelton
Copy link
Contributor

@mskelton mskelton commented Oct 11, 2022

This adds support for the _typescript.configurePlugin command which allows clients to dynamically update plugin configuration. This is useful when configuring global plugins which, since defined via the command line flags, cannot be configured the same way they might when defined in a local tsconfig.json file.

An example of this in Neovim which enables the typescript-styled-plugin with some configuration changes.

require("lspconfig").tsserver.setup({
  init_options = {
    plugins = {
      {
        name = "typescript-styled-plugin",
        location = "..."
      }
    }
  },
  on_init = function()
    local params = {
      command = "_typescript.configurePlugin",
      arguments = {
        "typescript-styled-plugin",
        {
          validate = false,
          emmet = {
            showExpandedAbbreviation = false
          }
        }
      },
    }
    
    client.request("workspace/executeCommand", params)
  end
})

@mskelton mskelton marked this pull request as ready for review October 11, 2022 02:26
src/configuration-manager.ts Outdated Show resolved Hide resolved
src/configuration-manager.ts Outdated Show resolved Hide resolved
@rchl rchl changed the title Add configurePlugin request feat: add _typescript.configurePlugin workspace command Oct 11, 2022
@rchl rchl merged commit 59a5217 into typescript-language-server:master Oct 11, 2022
@rchl
Copy link
Member

rchl commented Oct 11, 2022

Thanks

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.

None yet

2 participants