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
6 changes: 1 addition & 5 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
"args": [
"--extensionDevelopmentPath=${workspaceRoot}",
"${workspaceFolder}/sample/project"
],
"preLaunchTask": {
"type": "npm",
"script": "build"
}
]
},
{
"type": "node",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"icon": "images/vba-lsp-icon.png",
"author": "SSlinky",
"license": "MIT",
"version": "1.7.2",
"version": "1.7.3",
"repository": {
"type": "git",
"url": "https://github.com/SSlinky/VBA-LanguageServer"
Expand Down
5 changes: 3 additions & 2 deletions server/src/antlr/vbapre.g4
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ orderOfOps2: MOD;
orderOfOps3: PLUS | SUBT;
orderOfOps4: AMP;
orderOfOps5: LIKE | (LT | GT)? (LT | GT | EQ) | EQ;
orderOfOps6: AND | OR | XOR | EQV | IMP;
orderOfOps6: anyWord;
// orderOfOps6: AND | OR | XOR | EQV | IMP;


directiveExpression
Expand Down Expand Up @@ -153,7 +154,6 @@ reservedWord
| PLUS
| SUBT
| THEN
| compilerConstant
;

unreservedWord
Expand All @@ -166,6 +166,7 @@ unreservedWord
| NOTHING
| NULL_
| TRUE
| compilerConstant
;

anyWord: ( unreservedWord | reservedWord)+;
Expand Down
8 changes: 8 additions & 0 deletions server/src/capabilities/diagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,14 @@ export class AmbiguousNameDiagnostic extends BaseDiagnostic {
}
}

// test
export class CannotEvaluateExpressionDiagnostic extends BaseDiagnostic {
severity = DiagnosticSeverity.Error;
constructor(range: Range, message: string) {
super(range);
this.message = `Cannot evaluate expression: '${message}'.`;
}
}

// test
export class ShadowDeclarationDiagnostic extends BaseDiagnostic {
Expand Down
4 changes: 2 additions & 2 deletions server/src/extensions/antlrVbaPreParserExtensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ CompilerConditionalStatementContext.prototype.vbaExpression = function (): strin
return (this.compilerIfStatement() ?? this.compilerElseIfStatement())!
.booleanExpression()
.getText()
.toLowerCase();
.toUpperCase();
};

DirectiveExpressionContext.prototype.vbaExpression = function (): string {
return this.getText().toLowerCase();
return this.getText().toUpperCase();
};
7 changes: 7 additions & 0 deletions server/src/extensions/stringExtensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ declare global {
stripQuotes(): string;
toFilePath(): string;
toFileUri(): string;
ciEquals(s: string): boolean;
}
}

Expand All @@ -25,3 +26,9 @@ String.prototype.toFileUri = function (): string {
? pathToFileURL(this.toString()).href
: this.toString();
};

String.prototype.ciEquals = function (s: string): boolean {
return this.localeCompare(s, undefined, {
sensitivity: 'accent'
}) === 0;
};
Loading