Skip to content
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

feat(language-core): document links for classname within :class #4642

Merged
merged 12 commits into from
Aug 25, 2024

Conversation

KazariEX
Copy link
Collaborator

@KazariEX KazariEX commented Aug 4, 2024

resolve #4641

image

  • document links
  • rename support

@KazariEX KazariEX changed the title feat: document links for classname within :class feat(language-core): document links for classname within :class Aug 4, 2024
@johnsoncodehk
Copy link
Member

I think rename support can be left out for now. The current class name rename solution is unreliable due to a upstream issue (volarjs/volar.js#176).

@KazariEX KazariEX marked this pull request as ready for review August 4, 2024 12:03
@KazariEX KazariEX force-pushed the feat/classname-document-links branch from dcae58c to cf96978 Compare August 12, 2024 19:27
@KazariEX
Copy link
Collaborator Author

KazariEX commented Aug 12, 2024

This commit treats repeated class declarations as references to the first class, ensuring synchronization when renaming classes with the same name.

This requires ignoring the CSS renaming behavior when using the typescript-semantic renaming feature. Currently, since no interception is implemented, class renaming in the <style> will be overridden by the CSS functionality. We need to address this issue later.

@KazariEX
Copy link
Collaborator Author

Since we have extracted the classnames as much as possible, the logic previously used for renaming support is no longer necessary.

Copy link

pkg-pr-new bot commented Aug 24, 2024

commit: 4dd2bd5

vue-component-meta

pnpm add https://pkg.pr.new/vuejs/language-tools/vue-component-meta@4642

vue-component-type-helpers

pnpm add https://pkg.pr.new/vuejs/language-tools/vue-component-type-helpers@4642

@vue/language-core

pnpm add https://pkg.pr.new/vuejs/language-tools/@vue/language-core@4642

@vue/language-plugin-pug

pnpm add https://pkg.pr.new/vuejs/language-tools/@vue/language-plugin-pug@4642

@vue/language-server

pnpm add https://pkg.pr.new/vuejs/language-tools/@vue/language-server@4642

@vue/language-service

pnpm add https://pkg.pr.new/vuejs/language-tools/@vue/language-service@4642

vue-tsc

pnpm add https://pkg.pr.new/vuejs/language-tools/vue-tsc@4642

@vue/typescript-plugin

pnpm add https://pkg.pr.new/vuejs/language-tools/@vue/typescript-plugin@4642

Open in Stackblitz

@johnsoncodehk
Copy link
Member

Awesome, thanks! I tested it manually, it would be great if you could add a test case for it.

I plan to extract this feature to the language service plugin instead of relying on TS virtual code, which will improve the robustness of this feature.

@johnsoncodehk johnsoncodehk merged commit bee8ef5 into vuejs:master Aug 25, 2024
5 checks passed
@KazariEX KazariEX deleted the feat/classname-document-links branch August 26, 2024 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document links for classname within :class
2 participants