Closed jose-elias-alvarez closed 2 years ago
Separately, I have no idea why these actions have different titles and why I didn't see this before. The commit history for typescript-language-server
doesn't have any clues. The TypeScript repo is too gigantic to go through it, but I wonder when and why this started happening.
now it works as expected there is only one UB left
when I do :TSLspImoprtAll
or :TSLspImportCurrent
it uses second option, while obviously first option matches better and it is first (other imports work okay, but this one is strange)
I don't know about the project your screenshot is from, but on your sample repo from the issue, the function adds an import from "next/app"
. Improving selection behavior is a separate issue, so since this solves the issue of imports not working at all, I'll go ahead and merge it.
@jose-elias-alvarez thanks a lot!
Closes #112.
For whatever reason, it looks like
tsserver
code actions can conform to various patterns. We handle this pattern correctly:But these patterns are ignored, since they don't specify a target:
This PR handles patterns 2 and 3 and generally cleans up pattern handling a bit.