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

refactor(language-service): consistent style of source and virtual code operation #5053

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

KazariEX
Copy link
Collaborator

@KazariEX KazariEX commented Dec 15, 2024

Adopt the following naming and logic as much as possible:

const uri = URI.parse(document.uri);
const decoded = context.decodeEmbeddedDocumentUri(uri);
const sourceScript = decoded && context.language.scripts.get(decoded[0]);
const virtualCode = decoded && sourceScript?.generated?.embeddedCodes.get(decoded[1]);
if (!sourceScript?.generated || virtualCode?.id !== '...') {
	return;
}

const root = sourceScript.generated.root;
if (!(root instanceof VueVirtualCode)) {
	return;
}

Copy link

pkg-pr-new bot commented Dec 15, 2024

Open in Stackblitz

vue-component-meta

npm i https://pkg.pr.new/vuejs/language-tools/vue-component-meta@5053

@vue/language-core

npm i https://pkg.pr.new/vuejs/language-tools/@vue/language-core@5053

@vue/language-plugin-pug

npm i https://pkg.pr.new/vuejs/language-tools/@vue/language-plugin-pug@5053

vue-component-type-helpers

npm i https://pkg.pr.new/vuejs/language-tools/vue-component-type-helpers@5053

@vue/language-server

npm i https://pkg.pr.new/vuejs/language-tools/@vue/language-server@5053

@vue/language-service

npm i https://pkg.pr.new/vuejs/language-tools/@vue/language-service@5053

@vue/typescript-plugin

npm i https://pkg.pr.new/vuejs/language-tools/@vue/typescript-plugin@5053

vue-tsc

npm i https://pkg.pr.new/vuejs/language-tools/vue-tsc@5053

commit: 0df0f27

@KazariEX KazariEX changed the title refactor(language-service): consistent style of virtual code operation refactor(language-service): consistent style of source and virtual code operation Dec 15, 2024
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.

1 participant