修 id 解析

This commit is contained in:
2026-08-01 14:15:13 +02:00
parent 130f8b4c1d
commit 656fab349d
8 changed files with 293 additions and 13 deletions
+7
View File
@@ -3,6 +3,7 @@ import { parseXml, type XmlElement } from "../language/xmlParser";
import { analyzeContext, type CompletionContext } from "../language/context";
import { resolveElementType } from "../language/typeContext";
import * as model from "../model/schemaModel";
import { isLocalReferenceAttribute } from "../indexer/refs";
import type { ModWorkspace } from "../workspace";
import type { ModIndex, AssetDef } from "../indexer/types";
@@ -227,6 +228,12 @@ export class Ra3CompletionProvider implements vscode.CompletionItemProvider {
return this.assetIdItems(idx, el.name, null, prefix, make);
}
// `id` attributes are definitions and Poid attributes are pipeline-local
// references; offering global asset ids for them would be wrong.
if (attrInfo && isLocalReferenceAttribute(elType, attr.name)) {
return [];
}
if (attrInfo?.refType) {
return this.assetIdItems(idx, null, attrInfo.refType, prefix, make);
}