-
Notifications
You must be signed in to change notification settings - Fork 22
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
Gaps between tslint-language-service and vscode-tslint #32
Comments
Very cool!
I think this feature should be supported by tsserver, no? But for the moment we could implement it.
I tell me more and more if I see several values for this context:
Those values could be filled with a tsserver request when semantic command is called.
Could you create an issue at TypeScript please?
What do you mean?
In typescript.java I provide a wizard which generates tslint.json with
It seems that TypeScript 2.4 will provide "global" plugins, perhaps it will fix this issue? |
Fair question, auto fixing has become popular for linters, but less so for general semantic language errors. So I suggest that we implement it first.
The more interesting issue is related to applying the code fixes, the changes must be applied before the save operation so that a document is not saved twice. This needs a new hook like aboutToSave that enables to apply changes.
VS Code provides Intellisense when editing a tsconfig.son, see below. You want to have the same comfort when a plugin provides settings that you want to configure.
This makes sense, vscode-tslint does something similar.
This allows to configure a plugin globally, not clear to me yet, how global plugins support module dependencies of a plugin. Do you have a pointer with the latest on this? |
Ok!
Is it an issue for TypeScript or VSCode?
Thanks for the clarification. I think tslint-language-service should provide that (when getExtranlFiles will be implemented), no?
The only info that I have about global plugin is angular/vscode-ng-language-service#43 (comment) |
The typescript language server needs to provide a hook for aboutToSave to plugins. It also needs to provide a way for a tool like VS Code or Eclipse to inform that TypeScript server that an about to save is about to happen.
This would be possible, but the tsconfig.json file is a JSON file for which there is a JSON language service that can provide validation based on JSON schemas (and there is a schema for tsconfig.json). I would not want to duplicate this and compete with the JSON language service inside the tslint-language-service. What I suggest is that a plugin can provide a JSON schema fragment for its plugin attributes and the JSON language service can consume it and use it for validation (BTW, the VS Code JSON language server can also be used from Eclipse). |
This is already supported you can pass the TS server as set of plugin locations (directories) on the command line and the TS server will load plugins from these locations. This is used in VS Code to support loading a TS language server from a VS Code extension. This is what I'm doing in the preview of the 'tslint' plugin extension https://marketplace.visualstudio.com/items?itemName=eg2.ts-tslint |
|
One other strange gap that I felt is important to note for this discussion is that VS Code currently only calls out to |
Looks like |
Hey! Is auto-fix available now? |
blocked - currently shown in the server log only, which is intended for plugin authors but not users, see Plugins - support plugin specific logging microsoft/TypeScript#15913
no-unused-variable-rule
is disabled by defaultblocked - the rule has side effects and triggers an assertion failure The implementation of the 'no-unused-variable' rule breaks the tslint language service plugin palantir/tslint#2649. There is a fix for the side effect, that will be available in a next version. Even with the fix the rule requires to re-analyze a file for linting and it is too expensive to enable.
blocked - the TypeScript language server has no notion of a pre save hook Plugins - support a 'willSave' hook microsoft/TypeScript#15917
blocked - requires an API to trigger a revalidation of the open files Plugins - support that a plugin can trigger a diagnostic validation when its configuration changes microsoft/TypeScript#15914
tsconfig.json
changes.blocked - Plugins - notify a plugin when a tsconfig.json file changes microsoft/TypeScript#15915
Settings
blocked see above
blocked - typescript always creates diagnostics as the user types
Commands contributed by vscode-tslint
from microsoft/vscode-ts-tslint#1:
tslint --init
Custom quick fixes
vscode-tslint provides some custom quick fixes. Rather than providing quick fixes the better approach is to make PRs against the tslint rules.
quotemark
- quick fix has been added in tslint 5triple-equals
- no quick fix provided by tslintcomment-format
- no quick fix provided by tslintwhitespace
- no quick fix provided by tslintShould be provided by tslint editor extension
the vscode typescript status indicator should show status/provide access to the status of extensions
The text was updated successfully, but these errors were encountered: