-
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
Provide quick fix to open tslint.json and go at the rule #4
Comments
Today codefix from TypeScript is used to update code and not to open to another file and select a content. The only feature that I have implemented is to open More when I try to add textchanges with position of tslint.json rule (by using jsonc-parser) the tsserver translate the give position with the ts file which is validated. TypeScript should provide perhaps CodeFix to navigate to other file? Here my POC:
|
Provide quick fix to open tslint.json and go at the rule to give the capability to edit, remove the rule.
This codefix is hard to implement because:
*
codefix update no content
. In other wordstextChanges
is empty.It causes problem with VSCode which ignores codefix when textChanges is empty.
retrieve the location of the rule. It means that we need a JSON parser with location. I have experimented https://github.com/Microsoft/node-jsonc-parser which works well for that. But it seems TypeScript have implemented their own JSON parser (for tsconfig.json), it should be cool if TypeScript could provide an API to consume it.
store the location in the codefix. I have tried to store the rule location in the
textChanges
but tsserver try to convert location (from position to char/line) and the converstion fails because tsserver doesn't know thetslint.json
.store the location in the codefix with clean mean. Storing location in the textChanges is uggly. IMHO, I think codefix should be improved to support codefix which "Go at some location". CodeFix could looks like:
@egamma I have tried to explain challenges with
Edit 'XXX' rule from tslint.json
, please tell me if my explanation is not very good. We need to speak about this issue to TypeScript team, if you could do that, it should be very cool, thanks!The text was updated successfully, but these errors were encountered: