@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.
@@ -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 = applySyntaxColouring(document);
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 = signatureHelp(query, schema, caretPosition);
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
- parserWrapper.setSymbolsInfo({
39
+ config.languageService.setSymbolsInfo({
41
40
  query,
42
41
  symbolTables: result.symbolTables,
43
42
  });