TypeStrong / atom-typescript

The only TypeScript package you will ever need
https://atom.io/packages/atom-typescript
MIT License
1.13k stars 204 forks source link

Intentions are not highlighted in TypeScript files #1586

Closed aminya closed 2 years ago

aminya commented 3 years ago

If I change the extension of a file to JavaScript and hold CTRL, the intentions are highlighted, but in TypeScript, nothing is returned by atom-typescript.

lierdakil commented 3 years ago

Well, we do provide intentions:highlight service, and it ostensibly should work regardless of file format. However, tsserver doesn't really have a way to request all available code fixes efficiently, only get code fixes for the current cursor position, and iterating over every possible document position would just be incredibly slow. So what we actually do is iterate over reported errors (which are more likely to have code fixes attached). No errors mean we can't display any code fixes, really.

Disclaimer: it's been a while since I really sifted through tsserver's API, perhaps in newer versions there are ways to get all available code fixes, I am just not aware of it.

aminya commented 3 years ago

But the only difference here is the file extension. Why one of them is fast and the other isn't? Is it because of type checking?

lierdakil commented 3 years ago

Eh... my guess is you're probably getting js highlights from another package.

github-actions[bot] commented 2 years ago

This issue has been marked as stale because it did not have any activity for the last 90 days or more. Remove the stale label or comment or this will be closed in 14 days