@neo4j-cypher/language-server 2.0.0-next.21 → 2.0.0-next.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "cypher",
17
17
  "language server"
18
18
  ],
19
- "version": "2.0.0-next.21",
19
+ "version": "2.0.0-next.22",
20
20
  "main": "./dist/server.js",
21
21
  "types": "src/server.ts",
22
22
  "repository": {
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "engineStrict": true,
30
30
  "engines": {
31
- "node": ">=18.18.2"
31
+ "node": ">=22.15.0"
32
32
  },
33
33
  "bin": {
34
34
  "cypher-language-server": "./dist/cypher-language-server"
@@ -39,16 +39,19 @@
39
39
  "vscode-languageserver": "^8.1.0",
40
40
  "vscode-languageserver-textdocument": "^1.0.8",
41
41
  "workerpool": "^9.0.4",
42
- "@neo4j-cypher/language-support": "2.0.0-next.20",
43
- "@neo4j-cypher/query-tools": "2.0.0-next.20"
42
+ "@neo4j-cypher/language-support": "2.0.0-next.21",
43
+ "@neo4j-cypher/query-tools": "2.0.0-next.21",
44
+ "@neo4j-cypher/lint-worker": "2025.4.1-next.0"
44
45
  },
45
46
  "devDependencies": {
46
- "@types/lodash.debounce": "^4.0.9"
47
+ "@types/lodash.debounce": "^4.0.9",
48
+ "copyfiles": "^2.4.1"
47
49
  },
48
50
  "scripts": {
49
- "build": "tsc -b && pnpm bundle && pnpm make-executable && pnpm bundle-worker",
51
+ "build": "tsc -b && pnpm bundle && pnpm make-executable && pnpm copy-lint-worker",
52
+ "copy-lint-worker": "copyfiles -u 4 ../lint-worker/dist/cjs/lintWorker.cjs dist/",
50
53
  "bundle": "esbuild ./src/server.ts --bundle --format=cjs --platform=node --outfile=dist/cypher-language-server.js --minify --conditions=require",
51
- "bundle-worker": "esbuild ./src/lintWorker.ts --bundle --format=cjs --platform=node --conditions=require --outfile=dist/lintWorker.js --minify",
54
+ "dev": "tsc --watch",
52
55
  "make-executable": "cd dist && echo '#!/usr/bin/env node' > cypher-language-server && cat cypher-language-server.js >> cypher-language-server",
53
56
  "clean": "rm -rf {dist,tsconfig.tsbuildinfo}"
54
57
  }
package/src/formatting.ts CHANGED
@@ -16,7 +16,7 @@ export const formatDocument = (
16
16
  }
17
17
 
18
18
  const text = document.getText();
19
- const formattedText = formatQuery(text);
19
+ const formattedText = formatQuery(text).formattedQuery;
20
20
 
21
21
  if (text === formattedText) {
22
22
  return [];
package/src/linting.ts CHANGED
@@ -5,9 +5,9 @@ import { join } from 'path';
5
5
  import { Diagnostic } from 'vscode-languageserver';
6
6
  import { TextDocument } from 'vscode-languageserver-textdocument';
7
7
  import workerpool from 'workerpool';
8
- import { LinterTask, LintWorker } from './lintWorker';
8
+ import type { LinterTask, LintWorker } from '@neo4j-cypher/lint-worker';
9
9
 
10
- const pool = workerpool.pool(join(__dirname, 'lintWorker.js'), {
10
+ const pool = workerpool.pool(join(__dirname, 'lintWorker.cjs'), {
11
11
  minWorkers: 2,
12
12
  workerTerminateTimeout: 2000,
13
13
  });
package/src/lintWorker.ts DELETED
@@ -1,31 +0,0 @@
1
- import {
2
- DbSchema,
3
- lintCypherQuery as _lintCypherQuery,
4
- _internalFeatureFlags,
5
- } from '@neo4j-cypher/language-support';
6
- import workerpool from 'workerpool';
7
-
8
- function lintCypherQuery(
9
- query: string,
10
- dbSchema: DbSchema,
11
- featureFlags: { consoleCommands?: boolean; cypher25?: boolean } = {},
12
- ) {
13
- // We allow to override the consoleCommands feature flag
14
- if (featureFlags.consoleCommands !== undefined) {
15
- _internalFeatureFlags.consoleCommands = featureFlags.consoleCommands;
16
- }
17
- if (featureFlags.cypher25 !== undefined) {
18
- _internalFeatureFlags.cypher25 = featureFlags.cypher25;
19
- }
20
- return _lintCypherQuery(query, dbSchema);
21
- }
22
-
23
- workerpool.worker({ lintCypherQuery });
24
-
25
- type LinterArgs = Parameters<typeof lintCypherQuery>;
26
-
27
- export type LinterTask = workerpool.Promise<ReturnType<typeof lintCypherQuery>>;
28
-
29
- export type LintWorker = {
30
- lintCypherQuery: (...args: LinterArgs) => LinterTask;
31
- };