Skip to content

Commit 4a275a1

Browse files
authored
Merge pull request #23 from ViTeXFTW/development
Hotfix
2 parents a168d9e + b306cf9 commit 4a275a1

22 files changed

+213166
-197668
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: Feature Request
3+
about: Describes a feature, wanted to be added to ZeroSyntax
4+
title: "[FEATURE]"
5+
assignees: ''
6+
7+
---
8+
9+
# Description
10+
- Describe the feature
11+
12+
# Why
13+
- Why is the feature needed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "ZeroSyntax-Server",
44
"description": "Language server for Generals Zero Hour INI files",
55
"icon": "images/icon.png",
6-
"version": "0.1.4",
6+
"version": "0.1.5",
77
"publisher": "ViTeXFTW",
88
"author": {
99
"name": "ViTeXFTW",

server/src/diagnostic/classVisitor.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export class ClassVisitor extends AbstractParseTreeVisitor<void> implements MapI
6060
} else if (child instanceof SoundEffectClassesContext) {
6161
//TODO: Add SoundEffect Classes List
6262
} else if (child instanceof SpecialPowerClassContext && child.specialpower_value()) {
63+
console.log(`Added ${child.specialpower_value()!.getText()} to customSpecialPower`)
6364
list.customSpecialPower.remove(child.specialpower_value()!.getText())
6465
list.customSpecialPower.insert(child.specialpower_value()!.getText())
6566
} else if (child instanceof UpgradeClassContext && child.upgrade_value()) {

server/src/diagnostic/diagnosticsVisitor.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ export class DiagnosticVisitor extends AbstractParseTreeVisitor<void> implements
177177
// }
178178

179179
visitObjectClass_drawModules(ctx: ObjectClass_drawModulesContext): void {
180+
console.log(list.customConditionStates)
180181
list.customConditionStates.clear()
181182
this.visitChildren(ctx)
182183
}
@@ -402,6 +403,7 @@ export class DiagnosticVisitor extends AbstractParseTreeVisitor<void> implements
402403
}
403404
}
404405
}
406+
this.visitChildren(ctx)
405407
}
406408

407409
visitDrawModule_transitionStateBlock(ctx: DrawModule_transitionStateBlockContext): void {
@@ -410,7 +412,7 @@ export class DiagnosticVisitor extends AbstractParseTreeVisitor<void> implements
410412
if (!list.customConditionStates.find(state.ID()!.getText())) {
411413
const severity = DiagnosticSeverity.Error
412414
const start = new Location(state.ID()!.symbol.line, state.ID()!.symbol.column)
413-
const msg = `Custom condition state ${state.ID()!.getText()} is not defined`
415+
const msg = `Custom condition state ${state.ID()!.getText()} is not defined. If this is a TransitionKey, please define it above this`
414416
this.addDiagnostic(severity, start, start, msg)
415417
}
416418
}
@@ -419,12 +421,15 @@ export class DiagnosticVisitor extends AbstractParseTreeVisitor<void> implements
419421
}
420422

421423
visitDrawModule_transitionKeyProperty(ctx: DrawModule_transitionKeyPropertyContext): void {
422-
const ID_text = ctx.transitionKey_value().ID()!.getText()
423424

424-
console.log(`Adding ${ID_text} to customConditionStates in context ${ctx.getText()}`)
425+
if (ctx.transitionKey_value().ID()) {
426+
const ID_text = ctx.transitionKey_value().ID()!.getText()
425427

426-
list.customConditionStates.remove(ID_text)
427-
list.customConditionStates.insert(ID_text)
428+
console.log(`Adding ${ID_text} to customConditionStates in context ${ctx.getText()}`)
429+
430+
list.customConditionStates.remove(ID_text)
431+
list.customConditionStates.insert(ID_text)
432+
}
428433
}
429434

430435
private addDiagnostic(severity: DiagnosticSeverity, start: Location, end: Location, msg: string, srcAppend: string = ''): void {

server/src/utils/antlr4ng/.antlr/MapIni.interp

Lines changed: 25 additions & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)