-
-
Notifications
You must be signed in to change notification settings - Fork 223
feat: quick fix for adding lang="ts" #2882
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
Conversation
🦋 Changeset detectedLatest commit: 87daf2f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
It could still be considered as non-top-level if "under if block" checks failed
dummdidumm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small nits but otherwise ltgm
| return { | ||
| range: Range.create(startTagNameEnd, startTagNameEnd), | ||
| newText: ' lang="ts"' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to return here? Else we would add another one when one exist already IIUC
| return { | |
| range: Range.create(startTagNameEnd, startTagNameEnd), | |
| newText: ' lang="ts"' | |
| return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was originally going to replace the existing lang attribute. Now that I think about it, we might only be able to do it when it's lang="js", but I don't know if there are any people who actually write that. Don't suggest anything might be better.
packages/language-server/src/plugins/typescript/features/CodeActionsProvider.ts
Outdated
Show resolved
Hide resolved
dummdidumm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
#2876
I also removed the old custom quick fix. There should only be very few people who are still using the typescript version that doesn't support this, and ignore our typescript version requirement in the packages.json.