Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
client/out
server/out
server/src/perlnavigator.ts
browser-ext/out
node_modules
client/server
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@
"install-browser": "cd browser-ext && npm install",
"postinstall": "npm run-script install-client && npm run-script install-server && npm run-script install-browser",
"ci-client": "cd client && npm ci",
"ci-server": "cd server && npm ci",
"ci-server": "node update-version.js && cd server && npm ci",
"ci-all": "npm ci && npm run ci-client && npm run ci-server",
"clean": "rm -rf ./node-modules ./server/node-modules ./client/node-modules",
"foo": "(cd client && npm ci && cd ../); (cd server && npm c )",
Expand Down
11 changes: 11 additions & 0 deletions server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ import { getPerlAssetsPath } from "./assets";

var LRU = require("lru-cache");

import { VERSION, NAME } from "./perlnavigator";

if (process.argv.includes ("--version")) {
console.log(NAME + " " + VERSION);
process.exit(0);
}

// It the editor doesn't request node-ipc, use stdio instead. Make sure this runs before createConnection
if (process.argv.length <= 2) {
process.argv.push("--stdio");
Expand Down Expand Up @@ -82,6 +89,10 @@ connection.onInitialize(async (params: InitializeParams) => {
triggerCharacters: ["(", ",", ")"],
},
},
serverInfo: {
name: NAME,
version: VERSION,
}
};
if (hasWorkspaceFolderCapability) {
result.capabilities.workspace = {
Expand Down
10 changes: 10 additions & 0 deletions update-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const fs = require("node:fs");
const pkg = require("./package.json");

const content = `
export const VERSION = "${pkg.version}";
export const NAME = "${pkg.name}";
`;

fs.writeFileSync("server/src/perlnavigator.ts", content);
console.log("Generated server/src/perlnavigator.ts");