Răsfoiți Sursa

Add pyright lsp for Python (#551)

Co-authored-by: Max Rabin <[email protected]>
Max Rabin 7 luni în urmă
părinte
comite
3d71be2b45
1 a modificat fișierele cu 20 adăugiri și 0 ștergeri
  1. 20 0
      packages/opencode/src/lsp/server.ts

+ 20 - 0
packages/opencode/src/lsp/server.ts

@@ -123,4 +123,24 @@ export namespace LSPServer {
       }
     },
   }
+
+  export const Pyright: Info = {
+    id: "pyright",
+    extensions: [".py", ".pyi"],
+    async spawn() {
+      const proc = spawn(
+        BunProc.which(),
+        ["x", "pyright-langserver", "--stdio"],
+        {
+          env: {
+            ...process.env,
+            BUN_BE_BUN: "1",
+          },
+        },
+      )
+      return {
+        process: proc,
+      }
+    },
+  }
 }