From cfc54e13b0511c8f0c5a5167135af9693265f987 Mon Sep 17 00:00:00 2001 From: Jason Adam Date: Thu, 9 Apr 2026 11:38:55 -0700 Subject: [PATCH 1/7] Changes to allow this language server to be used in Claude Code. This fixes a problem with documentSymbol always finding 0 symbols --- src/VisualBasicLanguageServer/Handlers/Completion.fs | 2 +- src/VisualBasicLanguageServer/State/ServerState.fs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/VisualBasicLanguageServer/Handlers/Completion.fs b/src/VisualBasicLanguageServer/Handlers/Completion.fs index 2ee9696c..d789afae 100644 --- a/src/VisualBasicLanguageServer/Handlers/Completion.fs +++ b/src/VisualBasicLanguageServer/Handlers/Completion.fs @@ -76,7 +76,7 @@ module Completion = let defaultCo: obj = coType.GetField("Default") |> nonNull "Microsoft.CodeAnalysis.Completion.CompletionOptions.Default" - |> _.GetValue() + |> _.GetValue(null) { Object = defaultCo; CompletionOptionsType = coType } diff --git a/src/VisualBasicLanguageServer/State/ServerState.fs b/src/VisualBasicLanguageServer/State/ServerState.fs index 636d0799..3503c47f 100644 --- a/src/VisualBasicLanguageServer/State/ServerState.fs +++ b/src/VisualBasicLanguageServer/State/ServerState.fs @@ -138,8 +138,8 @@ let getDocumentForUriOfType state docType (u: string) = let matchingUserDocumentMaybe = match matchingUserDocuments with - | [d] -> Some (d, UserDocument) - | _ -> None + | d :: _ -> Some (d, UserDocument) + | [] -> None let matchingDecompiledDocumentMaybe = Map.tryFind u state.DecompiledMetadata From 9d0450ed32d7078fbe2f50a5cb13e7c8dc341bd7 Mon Sep 17 00:00:00 2001 From: Jason Adam Date: Thu, 9 Apr 2026 12:25:34 -0700 Subject: [PATCH 2/7] build script --- build.py | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 build.py diff --git a/build.py b/build.py new file mode 100644 index 00000000..b3ccbdf1 --- /dev/null +++ b/build.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +import subprocess +import shutil +import sys +from pathlib import Path + +PROJECT = Path(__file__).parent / "src" / "VisualBasicLanguageServer" / "VisualBasicLanguageServer.fsproj" +PUBLISH_DIR = Path(__file__).parent / "publish_output" +INSTALL_DIR = Path.home() / ".dotnet" / "tools" / "vb-ls-patched" +EXE_NAME = "VisualBasicLanguageServer.exe" + + +def run(*cmd): + print(f"$ {' '.join(str(c) for c in cmd)}") + subprocess.run([str(c) for c in cmd], check=True) + + +def main(): + # Clean previous publish output + if PUBLISH_DIR.exists(): + shutil.rmtree(PUBLISH_DIR) + + # Pack (produces nupkg) + run("dotnet", "pack", PROJECT, "--configuration", "Release") + + # Publish (produces the exe) + run( + "dotnet", "publish", PROJECT, + "--configuration", "Release", + "--output", PUBLISH_DIR, + ) + + src = PUBLISH_DIR / EXE_NAME + if not src.exists(): + print(f"ERROR: expected output not found at {src}", file=sys.stderr) + sys.exit(1) + + INSTALL_DIR.mkdir(parents=True, exist_ok=True) + dst = INSTALL_DIR / EXE_NAME + shutil.copy2(src, dst) + print(f"\nInstalled: {dst}") + + +if __name__ == "__main__": + main() From e4e6e5b8bf99e7f2751dc088292455d3a3f54e8d Mon Sep 17 00:00:00 2001 From: Jason Adam Date: Thu, 9 Apr 2026 12:29:57 -0700 Subject: [PATCH 3/7] updated required packages --- Directory.Packages.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 4a830265..93e94784 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -18,8 +18,8 @@ - - + + From 23cec10a124b3f81f93ae4c124cfa3c36a6d8141 Mon Sep 17 00:00:00 2001 From: jasonadam-innergy Date: Thu, 9 Apr 2026 12:48:11 -0700 Subject: [PATCH 4/7] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 1493a0bf..8e2373f8 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,8 @@ See [CHANGELOG.md](CHANGELOG.md) for the list of recent improvements/fixes. - vb-ls uses [ILSpy/ICSharpCode.Decompiler](https://github.com/icsharpcode/ILSpy) to decompile types in assemblies to C# source. # Installation -`dotnet tool install --global vb-ls` -See [vb-ls nuget page](https://www.nuget.org/packages/vb-ls/) +To install, run the python build script found in the root directory of the source once you have cloned the project. # Settings From b2114017e709574e4dc94a37dae5740ee1d80a6b Mon Sep 17 00:00:00 2001 From: Jason Adam Date: Thu, 9 Apr 2026 14:00:36 -0700 Subject: [PATCH 5/7] fixed missing .0 inside the global.json which was causing builds to unexpectedly fail when copying files on certain .NET 9 SDKs --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 883d5bef..4aa75dd3 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "9.0", + "version": "9.0.0", "rollForward": "minor" } } From cefa04ef9a711194e2abccf051f62fd1c2f8ece0 Mon Sep 17 00:00:00 2001 From: Jason Adam Date: Thu, 9 Apr 2026 15:07:34 -0700 Subject: [PATCH 6/7] the build.py script should now work on linux and include all needed files in the copy --- build.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/build.py b/build.py index b3ccbdf1..77c56971 100644 --- a/build.py +++ b/build.py @@ -7,7 +7,7 @@ PROJECT = Path(__file__).parent / "src" / "VisualBasicLanguageServer" / "VisualBasicLanguageServer.fsproj" PUBLISH_DIR = Path(__file__).parent / "publish_output" INSTALL_DIR = Path.home() / ".dotnet" / "tools" / "vb-ls-patched" -EXE_NAME = "VisualBasicLanguageServer.exe" +EXE_NAME = "VisualBasicLanguageServer" + (".exe" if sys.platform == "win32" else "") def run(*cmd): @@ -30,15 +30,15 @@ def main(): "--output", PUBLISH_DIR, ) - src = PUBLISH_DIR / EXE_NAME - if not src.exists(): - print(f"ERROR: expected output not found at {src}", file=sys.stderr) + if not (PUBLISH_DIR / EXE_NAME).exists(): + print(f"ERROR: expected output not found at {PUBLISH_DIR / EXE_NAME}", file=sys.stderr) sys.exit(1) INSTALL_DIR.mkdir(parents=True, exist_ok=True) - dst = INSTALL_DIR / EXE_NAME - shutil.copy2(src, dst) - print(f"\nInstalled: {dst}") + for src in PUBLISH_DIR.iterdir(): + dst = INSTALL_DIR / src.name + shutil.copy2(src, dst) + print(f"\nInstalled to: {INSTALL_DIR}") if __name__ == "__main__": From c66ba376e74840bba85823fb00fc2c6de9a2985f Mon Sep 17 00:00:00 2001 From: Jason Adam Date: Fri, 10 Apr 2026 11:20:08 -0700 Subject: [PATCH 7/7] updated git ignore to ignore output files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2b086d4f..9f94a9a7 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ obj .idea/ .config/ nupkg/ +publish_output/ \ No newline at end of file