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

Integrate eslint language server #49

Closed
angelozerr opened this issue Sep 15, 2017 · 9 comments
Closed

Integrate eslint language server #49

angelozerr opened this issue Sep 15, 2017 · 9 comments

Comments

@angelozerr
Copy link
Contributor

ESLint is very used in JavaScript word. It seems that VSCode provides an eslint language server https://github.com/Microsoft/vscode-eslint/blob/master/server/src/server.ts

I think it should be interesting to integrate it but activate with some condition like:

  • search if it exists an eslint.json in the project root
  • force the activation of the eslint language server with a preferences.

In other words:

  • BlueSky could be attractive for JavaScript developers.
  • It's a new use case to activate language server with some conditions.
@mickaelistria
Copy link
Contributor

Sounds like a good idea! Do you know which kind of features is provided by the eslint server? Is there more than diagnostics?
If it's only about diagnostic, I think it could be a separate bundle, that we could suggest as addition to JSDT later (and consume in BlueSky).

@angelozerr
Copy link
Contributor Author

Is there more than diagnostics?

Never played with it. But you can see feature support at https://github.com/Microsoft/vscode-eslint/blob/master/server/src/server.ts#L591

@angelozerr
Copy link
Contributor Author

For the moment vscode-eslint doesn't support --stdio

We must wait for microsoft/vscode-eslint#290

@mniewrzal
Copy link
Contributor

For the moment vscode-eslint doesn't support --stdio

But does it have LSP support? Maybe it supports TCP/IP communication?

@angelozerr
Copy link
Contributor Author

According https://github.com/Microsoft/vscode-eslint/blob/master/server/src/server.ts#L289 it supports IPC

let connection = createConnection(ProposedFeatures.all, new IPCMessageReader(process), new IPCMessageWriter(process));

I have tried to replace this code with

let connection = createConnection()

like JSON, CSS Language server does (it search for instance if stdio is in the args), but it failed at https://github.com/Microsoft/vscode-eslint/blob/master/server/src/server.ts#L303

resultPromise = connection.workspace.getConfiguration({ scopeUri: uri, section: '' }).then((settings: TextDocumentSettings) => {
because connection.workspace is null (it's not a standars LSP connection).

@mickaelistria
Copy link
Contributor

mickaelistria commented Sep 15, 2017 via email

@mickaelistria
Copy link
Contributor

We're now using typescript-language-server from Typefox/Theia. Is ESLint still useful with this language server?

@angelozerr
Copy link
Contributor Author

Is ESLint still useful with this language server?

Typefox/Theia can support tslint by using the plugin https://github.com/angelozerr/tslint-language-service

So you can define lint rules with tslint. Some user could prefer ESLint which works only with JS if I remember.

@mickaelistria
Copy link
Contributor

I'm closing it in favor of #145

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

3 participants