From 7387a94420f2a6553cee2e6c2d99bccbde0e5041 Mon Sep 17 00:00:00 2001 From: sslinky <39886505+SSlinky@users.noreply.github.com> Date: Sat, 12 Apr 2025 22:43:33 +0800 Subject: [PATCH 1/5] Remove log generation for antlr --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bb61f9e..00457a4 100644 --- a/package.json +++ b/package.json @@ -191,7 +191,7 @@ "postinstall": "cd client && npm install && cd ../server && npm install && cd ..", "textMate": "npx js-yaml client/syntaxes/vba.tmLanguage.yaml > client/syntaxes/vba.tmLanguage.json && npm run tmSnapTest", "antlr": "npm run antlr4ngPre && npm run antlr4ng && npm run antlr4ngFmt && npm run build", - "antlr4ng": "antlr4ng -Dlanguage=TypeScript -visitor -Xlog ./server/src/antlr/vba.g4 -o ./server/src/antlr/out/", + "antlr4ng": "antlr4ng -Dlanguage=TypeScript -visitor ./server/src/antlr/vba.g4 -o ./server/src/antlr/out/", "antlr4ngPre": "antlr4ng -Dlanguage=TypeScript -visitor ./server/src/antlr/vbapre.g4 -o ./server/src/antlr/out/", "antlr4ngFmt": "antlr4ng -Dlanguage=TypeScript -visitor ./server/src/antlr/vbafmt.g4 -o ./server/src/antlr/out/", "test": "npm run tmSnapTest && npm run tmUnitTest && npm run vsctest", From d5551c8985ee7eafae473a09825317bf178a5e8b Mon Sep 17 00:00:00 2001 From: sslinky <39886505+SSlinky@users.noreply.github.com> Date: Mon, 14 Apr 2025 10:41:19 +0800 Subject: [PATCH 2/5] Revert to icon theme and VBA lang identifier --- icon-theme.json | 32 ++++++++++++++++++------ package.json | 66 +++++++++++-------------------------------------- 2 files changed, 39 insertions(+), 59 deletions(-) diff --git a/icon-theme.json b/icon-theme.json index c8d94f7..b25a433 100644 --- a/icon-theme.json +++ b/icon-theme.json @@ -1,18 +1,34 @@ { - "fileExtensions": { - "cls": "_class", - "bas": "_module", - "frm": "_userform" - }, "iconDefinitions": { "_class": { - "iconPath": "icons/vba_blue.svg" + "iconPath": "icons/vba_90sGreen_dark.svg" + }, + "_class_light": { + "iconPath": "icons/vba_90sGreen_light.svg" }, "_module": { - "iconPath": "icons/vba_orange.svg" + "iconPath": "icons/vba_90sPurple_dark.svg" + }, + "_module_light": { + "iconPath": "icons/vba_90sPurple_light.svg" }, "_userform": { - "iconPath": "icons/vba_green.svg" + "iconPath": "icons/vba_90sYellow_dark.svg" + }, + "_userform_light": { + "iconPath": "icons/vba_90sPurple_light.svg" + } + }, + "fileExtensions": { + "cls": "_class", + "bas": "_module", + "frm": "_userform" + }, + "light": { + "fileExtensions": { + "cls": "_class_light", + "bas": "_module_light", + "frm": "_userform_light" } } } \ No newline at end of file diff --git a/package.json b/package.json index 00457a4..76823c2 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "Programming Languages", "Snippets", "Linters", - "Formatters" + "Formatters", + "Themes" ], "keywords": [ "multi-root ready" @@ -30,46 +31,27 @@ "contributes": { "languages": [ { - "id": "vba-class", + "id": "vba", "aliases": [ - "VBA Class" + "VBA" ], "extensions": [ - ".cls" + ".cls", + ".bas", + ".frm" ], "configuration": "./vba.language-configuration.json", "icon": { "dark": "icons/vba_90sGreen_dark.svg", "light": "icons/vba_90sGreen_light.svg" } - }, - { - "id": "vba-module", - "aliases": [ - "VBA Module" - ], - "extensions": [ - ".bas" - ], - "configuration": "./vba.language-configuration.json", - "icon": { - "dark": "icons/vba_90sPurple_dark.svg", - "light": "icons/vba_90sPurple_light.svg" - } - }, + } + ], + "iconThemes": [ { - "id": "vba-form", - "aliases": [ - "VBA Form" - ], - "extensions": [ - ".frm" - ], - "configuration": "./vba.language-configuration.json", - "icon": { - "dark": "icons/vba_90sYellow_dark.svg", - "light": "icons/vba_90sYellow_light.svg" - } + "id": "vba-lsp", + "label": "VBA Icons", + "path": "icon-theme.json" } ], "configurationDefaults": { @@ -148,32 +130,14 @@ }, "grammars": [ { - "language": "vba-class", - "scopeName": "source.vba", - "path": "./client/syntaxes/vba.tmLanguage.json" - }, - { - "language": "vba-module", - "scopeName": "source.vba", - "path": "./client/syntaxes/vba.tmLanguage.json" - }, - { - "language": "vba-form", + "language": "vba", "scopeName": "source.vba", "path": "./client/syntaxes/vba.tmLanguage.json" } ], "snippets": [ { - "language": "vba-class", - "path": "./snippets/vba.json" - }, - { - "language": "vba-module", - "path": "./snippets/vba.json" - }, - { - "language": "vba-form", + "language": "vba", "path": "./snippets/vba.json" } ] From 806fe036d7cf35e2bb1edca886c3d0f098a0194d Mon Sep 17 00:00:00 2001 From: sslinky <39886505+SSlinky@users.noreply.github.com> Date: Mon, 14 Apr 2025 12:10:17 +0800 Subject: [PATCH 3/5] Update readme for new theme --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index fb912fb..06efa67 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ Provides Visual Basic for Applications (VBA) language support in Visual Studio C * Semantic highlighting * Folding ranges * Code Snippets +* Icon theme * Document symbols * Document diagnostics * Document formatting1 @@ -41,6 +42,14 @@ Folding ranges help organise code, collapsing things out of the way when you don A small but growing collection of highly useful code snippets. The idea is to keep these to a "rememberable" level, but if there's something you use all the time and you think it's missing, I'd love to hear from you. +### Icon Theme + +VS Code supports two ways of contributing icons. +* Per language identifier. Limited to one icon for all file types. +* Icon pack. Allows more flexibility, however, only one icon theme can be active at any time. + +This extension provides both methods. Users with no icon pack installed can use the icon pack provided by this extension to see a visual difference between classes, modules, and forms. Users who prefer to use an alternative icon pack can fall back to the language assigned icon. + ### Document Symbols Document Symbols allow you to view a structured outline of your code in the VS Code Outline view and breadcrumbs. These make it easy to understand and navigate files. From e9c122f8de7101213ea37abc112b88b18dc1e4fa Mon Sep 17 00:00:00 2001 From: sslinky <39886505+SSlinky@users.noreply.github.com> Date: Mon, 14 Apr 2025 14:48:19 +0800 Subject: [PATCH 4/5] Add full build script to regenerate and build everything --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 76823c2..0cca9b2 100644 --- a/package.json +++ b/package.json @@ -145,6 +145,7 @@ "scripts": { "vscode:prepublish": "npm run package", "build": "npm run check-types && node esbuild.js", + "fullBuild": "npm run textMate && npm run antlr", "build-test": "node esbuild.js --test", "check-types": "tsc --noEmit", "watch": "npm-run-all -p watch:*", From 61d9103dc3380199fe75d416b3fba3fa55fe833e Mon Sep 17 00:00:00 2001 From: sslinky <39886505+SSlinky@users.noreply.github.com> Date: Mon, 14 Apr 2025 15:00:44 +0800 Subject: [PATCH 5/5] Fix extension activation --- client/src/extension.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/client/src/extension.ts b/client/src/extension.ts index 1e7cec4..62ff40c 100644 --- a/client/src/extension.ts +++ b/client/src/extension.ts @@ -40,9 +40,7 @@ export function activate(context: ExtensionContext) { const clientOptions: LanguageClientOptions = { // Register the server for plain text documents documentSelector: [ - { scheme: 'file', language: 'vba-class' }, - { scheme: 'file', language: 'vba-module' }, - { scheme: 'file', language: 'vba-form' } + { scheme: 'file', language: 'vba' } ], synchronize: { // Notify the server about file changes to '.clientrc files contained in the workspace @@ -61,7 +59,7 @@ export function activate(context: ExtensionContext) { // Add logging support for messages received from the server. client.onNotification("window/logMessage", (params) => { VscodeLogger.logMessage(params); - }) + }); // Start the client. This will also launch the server client.start();