@neo4j-cypher/react-codemirror 2.0.0-next.33 → 2.0.0-next.34
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/CHANGELOG.md +12 -0
- package/dist/src/CypherEditor.d.ts +15 -1
- package/dist/src/CypherEditor.js +65 -1
- package/dist/src/CypherEditor.js.map +1 -1
- package/dist/src/lang-cypher/autocomplete.js +5 -2
- package/dist/src/lang-cypher/autocomplete.js.map +1 -1
- package/dist/src/lang-cypher/contants.test.js +2 -2
- package/dist/src/lang-cypher/contants.test.js.map +1 -1
- package/dist/src/lang-cypher/langCypher.d.ts +2 -1
- package/dist/src/lang-cypher/langCypher.js.map +1 -1
- package/dist/src/lang-cypher/lintWorker.mjs +151 -149
- package/dist/src/lang-cypher/parser-adapter.js +1 -2
- package/dist/src/lang-cypher/parser-adapter.js.map +1 -1
- package/dist/src/lang-cypher/signatureHelp.js +1 -2
- package/dist/src/lang-cypher/signatureHelp.js.map +1 -1
- package/dist/src/lang-cypher/syntaxValidation.js +1 -2
- package/dist/src/lang-cypher/syntaxValidation.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/src/CypherEditor.tsx +86 -1
- package/src/lang-cypher/autocomplete.ts +6 -7
- package/src/lang-cypher/contants.test.ts +2 -2
- package/src/lang-cypher/langCypher.ts +5 -1
- package/src/lang-cypher/lintWorker.mjs +151 -149
- package/src/lang-cypher/parser-adapter.ts +2 -5
- package/src/lang-cypher/signatureHelp.ts +5 -2
- package/src/lang-cypher/syntaxValidation.ts +1 -2
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { Facet } from '@codemirror/state';
|
|
2
2
|
import { Input, NodeType, Parser, PartialParse, Tree } from '@lezer/common';
|
|
3
|
-
import {
|
|
4
|
-
applySyntaxColouring,
|
|
5
|
-
ParsedCypherToken,
|
|
6
|
-
} from '@neo4j-cypher/language-support';
|
|
3
|
+
import { ParsedCypherToken } from '@neo4j-cypher/language-support';
|
|
7
4
|
|
|
8
5
|
import Prism from 'prismjs';
|
|
9
6
|
import {
|
|
@@ -75,7 +72,7 @@ export class ParserAdapter extends Parser {
|
|
|
75
72
|
|
|
76
73
|
private antlrParse(document: string) {
|
|
77
74
|
const startTime = performance.now();
|
|
78
|
-
const tokens =
|
|
75
|
+
const tokens = this.config.languageService.highlightSyntax(document);
|
|
79
76
|
const timeTaken = performance.now() - startTime;
|
|
80
77
|
if (timeTaken > 300) {
|
|
81
78
|
this.config.setUseLightVersion?.(true);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { EditorState, StateField } from '@codemirror/state';
|
|
2
2
|
import { showTooltip, Tooltip } from '@codemirror/view';
|
|
3
|
-
import { signatureHelp } from '@neo4j-cypher/language-support';
|
|
4
3
|
import {
|
|
5
4
|
MarkupContent,
|
|
6
5
|
SignatureInformation,
|
|
@@ -107,7 +106,11 @@ function getSignatureHelpTooltip(
|
|
|
107
106
|
const triggerCharacter = getTriggerCharacter(query, caretPosition);
|
|
108
107
|
|
|
109
108
|
if (triggerCharacter === '(' || triggerCharacter === ',') {
|
|
110
|
-
const signatureHelpInfo =
|
|
109
|
+
const signatureHelpInfo = config.languageService.getSignatureHelp(
|
|
110
|
+
query,
|
|
111
|
+
schema,
|
|
112
|
+
{ caretPosition },
|
|
113
|
+
);
|
|
111
114
|
const activeSignature = signatureHelpInfo.activeSignature;
|
|
112
115
|
const signatures = signatureHelpInfo.signatures;
|
|
113
116
|
const activeParameter = signatureHelpInfo.activeParameter;
|
|
@@ -4,7 +4,6 @@ import { DiagnosticSeverity, DiagnosticTag } from 'vscode-languageserver-types';
|
|
|
4
4
|
import workerpool from 'workerpool';
|
|
5
5
|
import type { CypherConfig } from './langCypher';
|
|
6
6
|
import type { LintWorker } from '@neo4j-cypher/lint-worker';
|
|
7
|
-
import { parserWrapper } from '@neo4j-cypher/language-support';
|
|
8
7
|
|
|
9
8
|
const WorkerURL = new URL('./lintWorker.mjs', import.meta.url).pathname;
|
|
10
9
|
|
|
@@ -37,7 +36,7 @@ export const cypherLinter: (config: CypherConfig) => Extension = (config) =>
|
|
|
37
36
|
);
|
|
38
37
|
|
|
39
38
|
if (result.symbolTables) {
|
|
40
|
-
|
|
39
|
+
config.languageService.setSymbolsInfo({
|
|
41
40
|
query,
|
|
42
41
|
symbolTables: result.symbolTables,
|
|
43
42
|
});
|