Skip to content

Root relative Workspace/Project local configuration file #725

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

Open
hinell opened this issue May 25, 2023 · 4 comments
Open

Root relative Workspace/Project local configuration file #725

hinell opened this issue May 25, 2023 · 4 comments

Comments

@hinell
Copy link

hinell commented May 25, 2023

export class LspClientImpl implements LspClient {
constructor(protected connection: lsp.Connection) {}

I request to provide a way to configure typescript-language-server locally i.e. relative to the root of the project (i.e. tsconfig.json) by forcing lsp-client (I mean client from this repo that connects to the tsserver) to read configuration settings from a tsconfig.json. For example, a formatOptions: ... field might be used by the server immediately from a such config file.

Why tsserver doesn't have config file

There is a TypeScript issue discussion on this issue that took place many years ago regarding whether tsserver should support local-config file and it seems that devs have decided (microsoft/TypeScript#8709 (comment)) to unload this responsibility to the LSP clients, which is utterly wrong IMO. Many LSP servers (clangd, lua etc.) read their config from a project root config files like xyz_rc.json.

Thanks.

@rchl
Copy link
Member

rchl commented May 26, 2023

I think I'm fine with adding that if someone provides a PR.

Some questions:

  • should both initializationOptions and workspace settings be supported or only the latter?
  • server would have to watch tsconfig.json for changes and reload settings (or even restart if initializationOptions are supported).

@hinell
Copy link
Author

hinell commented May 26, 2023

should both initializationOptions and workspace settings be supported or only the latter?

What do you mean by workspace settings?

server would have to watch

We aren't in hurry. This is the least desirable feature for now.

@rchl
Copy link
Member

rchl commented May 26, 2023

What do you mean by workspace settings?

Those

server would have to watch

We aren't in hurry. This is the least desirable feature for now.

I agree we are not in a hurry but that feature I would expect to be present from the start since having to manually restart the server after changing settings would not be a good experience.

@hinell
Copy link
Author

hinell commented May 26, 2023

@rchl I think both types of settings should be supported. They don't seem to be different.

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

No branches or pull requests

2 participants