sublimelsp / LSP-typescript

TypeScript, JavaScript support for Sublime LSP plugin
MIT License
135 stars 11 forks source link

Plugin options? #117

Closed nianiam closed 2 years ago

nianiam commented 2 years ago

I am trying to use the typescript-styled-plugin, however, I can't figure if it's possible to inject the plugin options into typescript-LSP. The plugin loads fine by adding the following into initializationOptions/plugins:

{
  "initializationOptions": {
    "plugins": [
      {
        "name": "typescript-styled-plugin"
      }
    ]
  }
}

However, the LSP settings only accepts name and location. As compared to the typescript-styled-plugin docs, they have a few extra fields such as 'lint' to apply specific settings. However, they assume you're using Microsoft's old Typescript-sublime-plugin. Is there a way I can set these options?

rchl commented 2 years ago

Just including configuration in the project's tsconfig.json, as typescript-styled-plugin docs say, should work.

I think you might not even have to add anything to initializationOptions but haven't verified.

nianiam commented 2 years ago

My project is in a mono-repo and I was loading the plugins in the top level tsconfig.json. This did not work, but I tried loading the plugins in the relevant sub-packages and it's working fine.

I can confirm I did not need to have anything in initializationOptions.