diff --git a/package-lock.json b/package-lock.json index 339ecbb..4b4bcce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vba-lsp", - "version": "1.5.8", + "version": "1.5.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "vba-lsp", - "version": "1.5.8", + "version": "1.5.9", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 0a44e5b..c51b72d 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "icon": "images/vba-lsp-icon.png", "author": "SSlinky", "license": "MIT", - "version": "1.5.8", + "version": "1.5.9", "repository": { "type": "git", "url": "https://github.com/SSlinky/VBA-LanguageServer" diff --git a/server/src/antlr/vba.g4 b/server/src/antlr/vba.g4 index d015d38..f8a8f56 100644 --- a/server/src/antlr/vba.g4 +++ b/server/src/antlr/vba.g4 @@ -427,7 +427,7 @@ constantName // ; constDeclaration - : variableModifier? CONST wsc constItemList + : (variableModifier wsc)? CONST wsc constItemList ; constItemList diff --git a/test/fixtures/ScopeDiagnostics.bas b/test/fixtures/ScopeDiagnostics.bas new file mode 100644 index 0000000..e192387 --- /dev/null +++ b/test/fixtures/ScopeDiagnostics.bas @@ -0,0 +1,16 @@ +Attribute VB_Name = "ScopeDiagnostics" + +Option Explicit + +Private Const ABC As Long = 0 + +Public Enum XfaskofeaFoo + Enum1 = 2 ^ 1 + Bar = 2 ^ 2 + Bar = 2 ^ 3 +End Enum + +Public Sub XfaskofeaFoo(Optional test_param As Variant = -0.1) +Attribute XfaskofeaFoo.VB_Description = "docstring." + Call SomeSub(param, -0.15) +End Sub \ No newline at end of file