Multi-file project support #187
-
Hello everyone. However, in order for the extension to really work, I need a way to "peek" into the other files of the project.
Would appreciate any help here, since all the samples I've found so far are just doing some magic for Typescript; and the language I'm designing this for is not Typescript. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
const myLSPlugin: LanguageServicePlugin = {
create(context) {
return {
provideXXX(document) {
const dir = Utils.dirname(URI.parse(document.uri));
const files = await context.env.fs?.readDirectory(dir) ?? [];
if (files.length) {
const otherScriptUri = Utils.joinPath(dir, files[0][0]);
const otherVirtualCode = context.language.scripts.get(otherScriptUri)?.generated?.root;
// ...
}
},
};
},
};
const myLSPlugin: LanguageServicePlugin = {
create(context) {
return {
provideDiagnostics(document) {
return [{
relatedInformation: [{
// ...
}],
}];
},
};
},
}; |
Beta Was this translation helpful? Give feedback.
-
… ________________________________
От: Johnson Chu ***@***.***>
Отправлено: Sunday, June 9, 2024 5:51:50 AM
Кому: volarjs/volar.js ***@***.***>
Копия: Anton Zlygostev ***@***.***>; Author ***@***.***>
Тема: Re: [volarjs/volar.js] Multi-file project support (Discussion #187)
1. You need to use WorkspaceDiagnostics, which has been added via #199<#199>.
2. You need to replace provideDiagnostics with provideSemanticDiagnostics. provideSemanticDiagnostics will fire when any other file changes.
—
Reply to this email directly, view it on GitHub<#187 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AJ6JDWZBGYPARAPINELN6ELZGODINAVCNFSM6AAAAABIKQX52SVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TOMJWGYYTO>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
provideDiagnostics
withprovideSemanticDiagnostics
.provideSemanticDiagnostics
will fire when any other file changes.