tenseleyflow/dlm-lsp / c3e7d39

Browse files

Route all commands through @server.command for unified dispatch

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
c3e7d397c71815e959ead5008499061a295b70e3
Parents
467b5d6
Tree
18175f5

4 changed files

StatusFile+-
M pyproject.toml 1 1
M src/dlm_lsp/__init__.py 1 1
M src/dlm_lsp/server.py 13 8
M uv.lock 18 18
pyproject.tomlmodified
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44
 
55
 [project]
66
 name = "dlm-lsp"
7
-version = "0.1.0"
7
+version = "0.1.1"
88
 description = "Language Server Protocol backend for .dlm files"
99
 readme = "README.md"
1010
 requires-python = ">=3.11"
src/dlm_lsp/__init__.pymodified
@@ -1,3 +1,3 @@
11
 """dlm-lsp: Language Server Protocol backend for .dlm files."""
22
 
3
-__version__ = "0.1.0"
3
+__version__ = "0.1.1"
src/dlm_lsp/server.pymodified
@@ -126,21 +126,26 @@ def _on_code_action(
126126
 
127127
 
128128
 # ---------------------------------------------------------------------------
129
-# Commands
129
+# Commands (all via @server.command so pygls dispatches naturally)
130130
 # ---------------------------------------------------------------------------
131131
 
132132
 
133
-@server.feature(
134
-    lsp.WORKSPACE_EXECUTE_COMMAND,
135
-    lsp.ExecuteCommandOptions(commands=["dlm.setBaseModel", "dlm.addSourceDirective"]),
136
-)
137
-def _on_execute_command(ls: DlmLanguageServer, params: lsp.ExecuteCommandParams) -> Any:
133
+@server.command("dlm.setBaseModel")
134
+def _cmd_set_base_model(ls: DlmLanguageServer, args: list[Any]) -> None:
135
+    from dlm_lsp.commands import execute_command
136
+
137
+    edit = execute_command(ls.state, "dlm.setBaseModel", args)
138
+    if edit is not None:
139
+        ls.workspace_apply_edit(lsp.ApplyWorkspaceEditParams(edit=edit))
140
+
141
+
142
+@server.command("dlm.addSourceDirective")
143
+def _cmd_add_source(ls: DlmLanguageServer, args: list[Any]) -> None:
138144
     from dlm_lsp.commands import execute_command
139145
 
140
-    edit = execute_command(ls.state, params.command, params.arguments)
146
+    edit = execute_command(ls.state, "dlm.addSourceDirective", args)
141147
     if edit is not None:
142148
         ls.workspace_apply_edit(lsp.ApplyWorkspaceEditParams(edit=edit))
143
-    return None
144149
 
145150
 
146151
 # ---------------------------------------------------------------------------
uv.lockmodified
@@ -473,7 +473,7 @@ name = "cuda-bindings"
473473
 version = "13.2.0"
474474
 source = { registry = "https://pypi.org/simple" }
475475
 dependencies = [
476
-    { name = "cuda-pathfinder" },
476
+    { name = "cuda-pathfinder", marker = "sys_platform != 'emscripten' and sys_platform != 'win32'" },
477477
 ]
478478
 wheels = [
479479
     { url = "https://files.pythonhosted.org/packages/e0/a9/3a8241c6e19483ac1f1dcf5c10238205dcb8a6e9d0d4d4709240dff28ff4/cuda_bindings-13.2.0-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:721104c603f059780d287969be3d194a18d0cc3b713ed9049065a1107706759d", size = 5730273, upload-time = "2026-03-11T00:12:37.18Z" },
@@ -506,37 +506,37 @@ wheels = [
506506
 
507507
 [package.optional-dependencies]
508508
 cublas = [
509
-    { name = "nvidia-cublas", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
509
+    { name = "nvidia-cublas", marker = "sys_platform == 'linux'" },
510510
 ]
511511
 cudart = [
512
-    { name = "nvidia-cuda-runtime", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
512
+    { name = "nvidia-cuda-runtime", marker = "sys_platform == 'linux'" },
513513
 ]
514514
 cufft = [
515
-    { name = "nvidia-cufft", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
515
+    { name = "nvidia-cufft", marker = "sys_platform == 'linux'" },
516516
 ]
517517
 cufile = [
518518
     { name = "nvidia-cufile", marker = "sys_platform == 'linux'" },
519519
 ]
520520
 cupti = [
521
-    { name = "nvidia-cuda-cupti", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
521
+    { name = "nvidia-cuda-cupti", marker = "sys_platform == 'linux'" },
522522
 ]
523523
 curand = [
524
-    { name = "nvidia-curand", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
524
+    { name = "nvidia-curand", marker = "sys_platform == 'linux'" },
525525
 ]
526526
 cusolver = [
527
-    { name = "nvidia-cusolver", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
527
+    { name = "nvidia-cusolver", marker = "sys_platform == 'linux'" },
528528
 ]
529529
 cusparse = [
530
-    { name = "nvidia-cusparse", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
530
+    { name = "nvidia-cusparse", marker = "sys_platform == 'linux'" },
531531
 ]
532532
 nvjitlink = [
533
-    { name = "nvidia-nvjitlink", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
533
+    { name = "nvidia-nvjitlink", marker = "sys_platform == 'linux'" },
534534
 ]
535535
 nvrtc = [
536
-    { name = "nvidia-cuda-nvrtc", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
536
+    { name = "nvidia-cuda-nvrtc", marker = "sys_platform == 'linux'" },
537537
 ]
538538
 nvtx = [
539
-    { name = "nvidia-nvtx", marker = "sys_platform == 'linux' or sys_platform == 'win32'" },
539
+    { name = "nvidia-nvtx", marker = "sys_platform == 'linux'" },
540540
 ]
541541
 
542542
 [[package]]
@@ -651,7 +651,7 @@ docs = [
651651
 
652652
 [[package]]
653653
 name = "dlm-lsp"
654
-version = "0.1.0"
654
+version = "0.1.1"
655655
 source = { editable = "." }
656656
 dependencies = [
657657
     { name = "dlm" },
@@ -1444,7 +1444,7 @@ name = "nvidia-cudnn-cu13"
14441444
 version = "9.19.0.56"
14451445
 source = { registry = "https://pypi.org/simple" }
14461446
 dependencies = [
1447
-    { name = "nvidia-cublas" },
1447
+    { name = "nvidia-cublas", marker = "sys_platform != 'emscripten' and sys_platform != 'win32'" },
14481448
 ]
14491449
 wheels = [
14501450
     { url = "https://files.pythonhosted.org/packages/f1/84/26025437c1e6b61a707442184fa0c03d083b661adf3a3eecfd6d21677740/nvidia_cudnn_cu13-9.19.0.56-py3-none-manylinux_2_27_aarch64.whl", hash = "sha256:6ed29ffaee1176c612daf442e4dd6cfeb6a0caa43ddcbeb59da94953030b1be4", size = 433781201, upload-time = "2026-02-03T20:40:53.805Z" },
@@ -1456,7 +1456,7 @@ name = "nvidia-cufft"
14561456
 version = "12.0.0.61"
14571457
 source = { registry = "https://pypi.org/simple" }
14581458
 dependencies = [
1459
-    { name = "nvidia-nvjitlink" },
1459
+    { name = "nvidia-nvjitlink", marker = "sys_platform != 'emscripten' and sys_platform != 'win32'" },
14601460
 ]
14611461
 wheels = [
14621462
     { url = "https://files.pythonhosted.org/packages/8b/ae/f417a75c0259e85c1d2f83ca4e960289a5f814ed0cea74d18c353d3e989d/nvidia_cufft-12.0.0.61-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:2708c852ef8cd89d1d2068bdbece0aa188813a0c934db3779b9b1faa8442e5f5", size = 214053554, upload-time = "2025-09-04T08:31:38.196Z" },
@@ -1486,9 +1486,9 @@ name = "nvidia-cusolver"
14861486
 version = "12.0.4.66"
14871487
 source = { registry = "https://pypi.org/simple" }
14881488
 dependencies = [
1489
-    { name = "nvidia-cublas" },
1490
-    { name = "nvidia-cusparse" },
1491
-    { name = "nvidia-nvjitlink" },
1489
+    { name = "nvidia-cublas", marker = "sys_platform != 'emscripten' and sys_platform != 'win32'" },
1490
+    { name = "nvidia-cusparse", marker = "sys_platform != 'emscripten' and sys_platform != 'win32'" },
1491
+    { name = "nvidia-nvjitlink", marker = "sys_platform != 'emscripten' and sys_platform != 'win32'" },
14921492
 ]
14931493
 wheels = [
14941494
     { url = "https://files.pythonhosted.org/packages/c8/c3/b30c9e935fc01e3da443ec0116ed1b2a009bb867f5324d3f2d7e533e776b/nvidia_cusolver-12.0.4.66-py3-none-manylinux_2_27_aarch64.whl", hash = "sha256:02c2457eaa9e39de20f880f4bd8820e6a1cfb9f9a34f820eb12a155aa5bc92d2", size = 223467760, upload-time = "2025-09-04T08:33:04.222Z" },
@@ -1500,7 +1500,7 @@ name = "nvidia-cusparse"
15001500
 version = "12.6.3.3"
15011501
 source = { registry = "https://pypi.org/simple" }
15021502
 dependencies = [
1503
-    { name = "nvidia-nvjitlink" },
1503
+    { name = "nvidia-nvjitlink", marker = "sys_platform != 'emscripten' and sys_platform != 'win32'" },
15041504
 ]
15051505
 wheels = [
15061506
     { url = "https://files.pythonhosted.org/packages/f8/94/5c26f33738ae35276672f12615a64bd008ed5be6d1ebcb23579285d960a9/nvidia_cusparse-12.6.3.3-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:80bcc4662f23f1054ee334a15c72b8940402975e0eab63178fc7e670aa59472c", size = 162155568, upload-time = "2025-09-04T08:33:42.864Z" },