Skip to content

Commit

Permalink
Rework with a simple LSP extension
Browse files Browse the repository at this point in the history
  • Loading branch information
kossnocorp committed Jan 4, 2025
1 parent 7e09d72 commit bd48f36
Show file tree
Hide file tree
Showing 15 changed files with 114 additions and 341 deletions.
22 changes: 22 additions & 0 deletions lsp/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const { join } = require("path");
const { existsSync } = require("fs");

module.exports.getBinPath = function getBinPath(
contextPath = import.meta.dirname
) {
const variation = `${process.platform}-${process.arch}`;
const binName = process.platform === "win32" ? "gts.exe" : "gts";
const binPath = join(
contextPath,
"node_modules",
"@genotype-lsp",
variation,
"bin",
binName
);

if (!existsSync(binPath))
throw new Error(`Genotype LSP binary not found at: ${binPath}`);

return binPath;
};
1 change: 1 addition & 0 deletions lsp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.6.0-alpha.1",
"license": "MIT",
"files": [],
"main": "index.js",
"optionalDependencies": {
"@genotype-lsp/darwin-arm64": "workspace:*",
"@genotype-lsp/darwin-x64": "workspace:*",
Expand Down
31 changes: 31 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions vscode/Justfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
install:
cargo install toml2json

build:
build: build-syntax build-extension

build-syntax:
toml2json ./src/syntax.toml --pretty > ./syntaxes/genotype.tmLanguage.json

version:
build-extension:
pnpm exec tsc

version version:
npm version {{version}}
cd client && npm version {{version}}
cd server && npm version {{version}}
Expand Down
53 changes: 0 additions & 53 deletions vscode/client/package-lock.json

This file was deleted.

21 changes: 0 additions & 21 deletions vscode/client/package.json

This file was deleted.

129 changes: 0 additions & 129 deletions vscode/client/src/extension.ts

This file was deleted.

12 changes: 0 additions & 12 deletions vscode/client/tsconfig.json

This file was deleted.

10 changes: 8 additions & 2 deletions vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"engines": {
"vscode": "^1.90.0"
},
"main": "./out/extension.js",
"displayName": "Genotype",
"publisher": "nocorp",
"categories": [
Expand Down Expand Up @@ -70,10 +71,15 @@
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -b",
"watch": "tsc -b -w",
"postinstall": "cd client && npm install && cd ../server && npm install && cd .."
"watch": "tsc -b -w"
},
"dependencies": {
"genotype-lsp": "workspace:*",
"vscode-languageclient": "^9.0.1"
},
"devDependencies": {
"@types/node": "^22.10.5",
"@types/vscode": "^1.96.0",
"typescript": "^5.7.2"
}
}
Loading

0 comments on commit bd48f36

Please sign in to comment.