Skip to content

Commit 63f472c

Browse files
committed
fix(schema): ignore enum entries when accessing
1 parent f7c3e9c commit 63f472c

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

schema/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sourcemod-dev/schema",
3-
"version": "0.1.4",
3+
"version": "0.1.5",
44
"main": "dist/index.js",
55
"types": "dist/index.d.ts",
66
"files": [

schema/src/classes/bundle.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,13 @@ export class Strand implements IStrand, Searchable {
109109
}
110110

111111
public getSymbolByPath(path: string[]): ClassSymbol {
112-
path = path.filter(e => e.includes('.'))
112+
path = path.filter(e => {
113+
// Ignore Enum entries, as it's not a dedicated symbol
114+
return e.includes('.') || [
115+
Identifier.EnumerationEntry,
116+
Identifier.Entry,
117+
].includes(splitPath(e).identifier)
118+
});
113119

114120
const L1 = splitPath(path[0]);
115121

schema/src/classes/symbol/enumeration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class Enumeration extends Declaration implements IEnumeration, Searchable
2525

2626
ret[0].score += 0.01;
2727

28-
localOptions.parents.push(this.name);
28+
localOptions.parents.push(`${this.identifier}.${this.name}`);
2929

3030
if (localOptions.l1Only !== true) {
3131
for (const entry of Object.values(this.entries)) {

0 commit comments

Comments
 (0)