neoclide / coc-tsserver

Tsserver extension for coc.nvim that provide rich features like VSCode for javascript & typescript
MIT License
1.05k stars 68 forks source link

CodeAction for `did you mean` errors #357

Closed eybisi closed 2 years ago

eybisi commented 2 years ago

When tsserver fires an error like this:

Info 119  [18:43:00.677] event:
    {"seq":0,"type":"event","event":"syntaxDiag","body":{"file":"agent/activity-service.ts","diagnostics":[{"start":{"line":2,"offset":1},"end":{"line":2,"offset":6},"text":"Unknown keyword or identifier. Did you mean 'export'?","code":1435,"category":"error"}]}}
Info 120  [18:43:00.705] event:
    {"seq":0,"type":"event","event":"semanticDiag","body":{"file":"agent/activity-service.ts","diagnostics":[{"start":{"line":2,"offset":1},"end":{"line":2,"offset":6},"text":"Cannot find name 'xport'.","code":2304,"category":"error"}]}}
Info 121  [18:43:00.708] event:

I can see these errors. error

For did you mean error there should be action to fix it right?. But when I list all codeactions for this file I get following list and fix for export is not found actions Do I need to set certain option to get action for this error ? or is it not implemented yet ?

chemzqm commented 2 years ago

Seems not implemented by tsserver, try upgrade your typescript module or you can send feature request to typescript team.

eybisi commented 2 years ago

Ah okey. Same situation for visual code, looks like no one is giving action for this type of error. And from your answer I guess it is not a good idea to implement it in here.