Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/ide/vscode/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "zenstack-v3",
"publisher": "zenstack",
"version": "3.0.9",
"version": "3.0.11",
"displayName": "ZenStack V3 Language Tools",
"description": "VSCode extension for ZenStack (v3) ZModel language",
"private": true,
Expand Down
6 changes: 6 additions & 0 deletions packages/language/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,19 @@ export function createZModelLanguageServices(

// when documents reach Parsed state, inspect plugin declarations and load corresponding
// plugin zmodel docs
// Note we must use `onBuildPhase` instead of `onDocumentPhase` here because the latter is
// not called when not running inside a language server.
shared.workspace.DocumentBuilder.onBuildPhase(DocumentState.Parsed, async (documents) => {
for (const doc of documents) {
if (doc.parseResult.lexerErrors.length > 0 || doc.parseResult.parserErrors.length > 0) {
// balk if there are lexer or parser errors
continue;
}

if (doc.uri.scheme !== 'file') {
continue;
}

const schemaPath = fileURLToPath(doc.uri.toString());
const pluginSchemas = getPluginDocuments(doc.parseResult.value as Model, schemaPath);
for (const plugin of pluginSchemas) {
Expand Down