@neo4j-cypher/react-codemirror 2.0.0-next.1 → 2.0.0-next.10
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 +79 -0
- package/README.md +4 -1
- package/dist/{types/CypherEditor.d.ts → CypherEditor.d.ts} +69 -8
- package/dist/CypherEditor.js +300 -0
- package/dist/CypherEditor.js.map +1 -0
- package/dist/CypherEditor.test.js +151 -0
- package/dist/CypherEditor.test.js.map +1 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +2 -0
- package/dist/constants.js.map +1 -0
- package/dist/e2e_tests/autoCompletion.spec.js +267 -0
- package/dist/e2e_tests/autoCompletion.spec.js.map +1 -0
- package/dist/e2e_tests/configuration.spec.js +83 -0
- package/dist/e2e_tests/configuration.spec.js.map +1 -0
- package/dist/e2e_tests/debounce.spec.js +65 -0
- package/dist/e2e_tests/debounce.spec.js.map +1 -0
- package/dist/e2e_tests/e2eUtils.js +60 -0
- package/dist/e2e_tests/e2eUtils.js.map +1 -0
- package/dist/e2e_tests/extraKeybindings.spec.js +43 -0
- package/dist/e2e_tests/extraKeybindings.spec.js.map +1 -0
- package/dist/e2e_tests/historyNavigation.spec.js +227 -0
- package/dist/e2e_tests/historyNavigation.spec.js.map +1 -0
- package/dist/e2e_tests/performanceTest.spec.d.ts +6 -0
- package/dist/e2e_tests/performanceTest.spec.js +96 -0
- package/dist/e2e_tests/performanceTest.spec.js.map +1 -0
- package/dist/e2e_tests/sanityChecks.spec.js +53 -0
- package/dist/e2e_tests/sanityChecks.spec.js.map +1 -0
- package/dist/e2e_tests/signatureHelp.spec.js +179 -0
- package/dist/e2e_tests/signatureHelp.spec.js.map +1 -0
- package/dist/e2e_tests/snippets.spec.js +62 -0
- package/dist/e2e_tests/snippets.spec.js.map +1 -0
- package/dist/e2e_tests/syntaxHighlighting.spec.d.ts +1 -0
- package/dist/e2e_tests/syntaxHighlighting.spec.js +90 -0
- package/dist/e2e_tests/syntaxHighlighting.spec.js.map +1 -0
- package/dist/e2e_tests/syntaxValidation.spec.d.ts +1 -0
- package/dist/e2e_tests/syntaxValidation.spec.js +79 -0
- package/dist/e2e_tests/syntaxValidation.spec.js.map +1 -0
- package/dist/historyNavigation.d.ts +7 -0
- package/dist/historyNavigation.js +163 -0
- package/dist/historyNavigation.js.map +1 -0
- package/dist/{types/icons.d.ts → icons.d.ts} +1 -1
- package/dist/icons.js +62 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/lang-cypher/autocomplete.d.ts +6 -0
- package/dist/lang-cypher/autocomplete.js +124 -0
- package/dist/lang-cypher/autocomplete.js.map +1 -0
- package/dist/{types/lang-cypher → lang-cypher}/constants.d.ts +9 -0
- package/dist/lang-cypher/constants.js +65 -0
- package/dist/lang-cypher/constants.js.map +1 -0
- package/dist/lang-cypher/contants.test.d.ts +1 -0
- package/dist/lang-cypher/contants.test.js +103 -0
- package/dist/lang-cypher/contants.test.js.map +1 -0
- package/dist/lang-cypher/createCypherTheme.js +179 -0
- package/dist/lang-cypher/createCypherTheme.js.map +1 -0
- package/dist/lang-cypher/langCypher.d.ts +14 -0
- package/dist/lang-cypher/langCypher.js +30 -0
- package/dist/lang-cypher/langCypher.js.map +1 -0
- package/dist/lang-cypher/lintWorker.d.ts +8 -0
- package/dist/lang-cypher/lintWorker.js +4 -0
- package/dist/lang-cypher/lintWorker.js.map +1 -0
- package/dist/lang-cypher/parser-adapter.d.ts +19 -0
- package/dist/lang-cypher/parser-adapter.js +113 -0
- package/dist/lang-cypher/parser-adapter.js.map +1 -0
- package/dist/lang-cypher/signatureHelp.d.ts +4 -0
- package/dist/lang-cypher/signatureHelp.js +94 -0
- package/dist/lang-cypher/signatureHelp.js.map +1 -0
- package/dist/lang-cypher/syntaxValidation.d.ts +5 -0
- package/dist/lang-cypher/syntaxValidation.js +69 -0
- package/dist/lang-cypher/syntaxValidation.js.map +1 -0
- package/dist/lang-cypher/themeIcons.js +22 -0
- package/dist/lang-cypher/themeIcons.js.map +1 -0
- package/dist/lang-cypher/utils.d.ts +2 -0
- package/dist/lang-cypher/utils.js +10 -0
- package/dist/lang-cypher/utils.js.map +1 -0
- package/dist/ndlTokensCopy.js +380 -0
- package/dist/ndlTokensCopy.js.map +1 -0
- package/dist/ndlTokensCopy.test.d.ts +1 -0
- package/dist/ndlTokensCopy.test.js +12 -0
- package/dist/ndlTokensCopy.test.js.map +1 -0
- package/dist/neo4jSetup.js +120 -0
- package/dist/neo4jSetup.js.map +1 -0
- package/dist/{types/themes.d.ts → themes.d.ts} +1 -1
- package/dist/themes.js +114 -0
- package/dist/themes.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +30 -31
- package/src/CypherEditor.test.tsx +200 -0
- package/src/CypherEditor.tsx +292 -41
- package/src/constants.ts +1 -0
- package/src/e2e_tests/autoCompletion.spec.tsx +472 -0
- package/src/e2e_tests/configuration.spec.tsx +111 -0
- package/src/e2e_tests/debounce.spec.tsx +101 -0
- package/src/e2e_tests/{e2e-utils.ts → e2eUtils.ts} +11 -1
- package/src/e2e_tests/{extra-keybindings.spec.tsx → extraKeybindings.spec.tsx} +1 -3
- package/src/e2e_tests/historyNavigation.spec.tsx +315 -0
- package/src/e2e_tests/performanceTest.spec.tsx +158 -0
- package/src/e2e_tests/{sanity-checks.spec.tsx → sanityChecks.spec.tsx} +7 -22
- package/src/e2e_tests/signatureHelp.spec.tsx +380 -0
- package/src/e2e_tests/snippets.spec.tsx +92 -0
- package/src/e2e_tests/{syntax-highlighting.spec.tsx → syntaxHighlighting.spec.tsx} +1 -3
- package/src/e2e_tests/{syntax-validation.spec.tsx → syntaxValidation.spec.tsx} +6 -7
- package/src/{repl-mode.ts → historyNavigation.ts} +7 -30
- package/src/icons.ts +3 -0
- package/src/index.ts +5 -2
- package/src/lang-cypher/autocomplete.ts +107 -15
- package/src/lang-cypher/constants.ts +23 -0
- package/src/lang-cypher/contants.test.ts +6 -2
- package/src/lang-cypher/{create-cypher-theme.ts → createCypherTheme.ts} +41 -2
- package/src/lang-cypher/langCypher.ts +53 -0
- package/src/lang-cypher/lintWorker.ts +14 -0
- package/src/lang-cypher/parser-adapter.ts +145 -0
- package/src/lang-cypher/signatureHelp.ts +133 -0
- package/src/lang-cypher/syntaxValidation.ts +96 -0
- package/src/lang-cypher/utils.ts +9 -0
- package/src/{ndl-tokens-copy.test.ts → ndlTokensCopy.test.ts} +2 -1
- package/src/{neo4j-setup.tsx → neo4jSetup.tsx} +51 -1
- package/src/themes.ts +4 -2
- package/src/viteEnv.d.ts +1 -0
- package/dist/cjs/index.cjs +0 -1443
- package/dist/cjs/index.cjs.map +0 -7
- package/dist/esm/index.mjs +0 -1466
- package/dist/esm/index.mjs.map +0 -7
- package/dist/types/e2e_tests/mock-data.d.ts +0 -3779
- package/dist/types/index.d.ts +0 -4
- package/dist/types/lang-cypher/ParserAdapter.d.ts +0 -14
- package/dist/types/lang-cypher/autocomplete.d.ts +0 -3
- package/dist/types/lang-cypher/lang-cypher.d.ts +0 -7
- package/dist/types/lang-cypher/syntax-validation.d.ts +0 -3
- package/dist/types/repl-mode.d.ts +0 -8
- package/dist/types/tsconfig.tsbuildinfo +0 -1
- package/src/e2e_tests/auto-completion.spec.tsx +0 -232
- package/src/e2e_tests/history-navigation.spec.tsx +0 -144
- package/src/e2e_tests/mock-data.ts +0 -4310
- package/src/e2e_tests/performance-test.spec.tsx +0 -71
- package/src/lang-cypher/ParserAdapter.ts +0 -92
- package/src/lang-cypher/lang-cypher.ts +0 -32
- package/src/lang-cypher/syntax-validation.ts +0 -24
- /package/dist/{types/e2e_tests/auto-completion.spec.d.ts → CypherEditor.test.d.ts} +0 -0
- /package/dist/{types/e2e_tests/extra-keybindings.spec.d.ts → e2e_tests/autoCompletion.spec.d.ts} +0 -0
- /package/dist/{types/e2e_tests/history-navigation.spec.d.ts → e2e_tests/configuration.spec.d.ts} +0 -0
- /package/dist/{types/e2e_tests/performance-test.spec.d.ts → e2e_tests/debounce.spec.d.ts} +0 -0
- /package/dist/{types/e2e_tests/e2e-utils.d.ts → e2e_tests/e2eUtils.d.ts} +0 -0
- /package/dist/{types/e2e_tests/sanity-checks.spec.d.ts → e2e_tests/extraKeybindings.spec.d.ts} +0 -0
- /package/dist/{types/e2e_tests/syntax-highlighting.spec.d.ts → e2e_tests/historyNavigation.spec.d.ts} +0 -0
- /package/dist/{types/e2e_tests/syntax-validation.spec.d.ts → e2e_tests/sanityChecks.spec.d.ts} +0 -0
- /package/dist/{types/lang-cypher/contants.test.d.ts → e2e_tests/signatureHelp.spec.d.ts} +0 -0
- /package/dist/{types/ndl-tokens-copy.test.d.ts → e2e_tests/snippets.spec.d.ts} +0 -0
- /package/dist/{types/lang-cypher/create-cypher-theme.d.ts → lang-cypher/createCypherTheme.d.ts} +0 -0
- /package/dist/{types/lang-cypher/theme-icons.d.ts → lang-cypher/themeIcons.d.ts} +0 -0
- /package/dist/{types/ndl-tokens-copy.d.ts → ndlTokensCopy.d.ts} +0 -0
- /package/dist/{types/neo4j-setup.d.ts → neo4jSetup.d.ts} +0 -0
- /package/src/lang-cypher/{theme-icons.ts → themeIcons.ts} +0 -0
- /package/src/{ndl-tokens-copy.ts → ndlTokensCopy.ts} +0 -0
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
import { testData } from '@neo4j-cypher/language-support';
|
|
2
|
+
import { expect, test } from '@playwright/experimental-ct-react';
|
|
3
|
+
import { Locator } from 'playwright/test';
|
|
4
|
+
import { CypherEditor } from '../CypherEditor';
|
|
5
|
+
|
|
6
|
+
test.use({ viewport: { width: 1000, height: 500 } });
|
|
7
|
+
|
|
8
|
+
type TooltipExpectations = {
|
|
9
|
+
includes?: string[];
|
|
10
|
+
excludes?: string[];
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
function testTooltip(tooltip: Locator, expectations: TooltipExpectations) {
|
|
14
|
+
const includes = expectations.includes ?? [];
|
|
15
|
+
const excludes = expectations.excludes ?? [];
|
|
16
|
+
|
|
17
|
+
const included = Promise.all(
|
|
18
|
+
includes.map((text) => {
|
|
19
|
+
return expect(tooltip).toContainText(text, {
|
|
20
|
+
timeout: 2000,
|
|
21
|
+
});
|
|
22
|
+
}),
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const excluded = Promise.all(
|
|
26
|
+
excludes.map((text) => {
|
|
27
|
+
return expect(tooltip).not.toContainText(text, {
|
|
28
|
+
timeout: 2000,
|
|
29
|
+
});
|
|
30
|
+
}),
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
return Promise.all([included, excluded]);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
test('Signature help works for functions', async ({ page, mount }) => {
|
|
37
|
+
const query = 'RETURN abs(';
|
|
38
|
+
|
|
39
|
+
await mount(
|
|
40
|
+
<CypherEditor
|
|
41
|
+
value={query}
|
|
42
|
+
schema={testData.mockSchema}
|
|
43
|
+
autofocus={true}
|
|
44
|
+
/>,
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
await expect(page.locator('.cm-signature-help-panel')).toBeVisible({
|
|
48
|
+
timeout: 2000,
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
test('Signature help works for procedures', async ({ page, mount }) => {
|
|
53
|
+
const query = 'CALL apoc.import.csv(';
|
|
54
|
+
|
|
55
|
+
await mount(
|
|
56
|
+
<CypherEditor
|
|
57
|
+
value={query}
|
|
58
|
+
schema={testData.mockSchema}
|
|
59
|
+
autofocus={true}
|
|
60
|
+
/>,
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
await expect(page.locator('.cm-signature-help-panel')).toBeVisible({
|
|
64
|
+
timeout: 2000,
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
test('Signature help shows the description for the first argument', async ({
|
|
69
|
+
page,
|
|
70
|
+
mount,
|
|
71
|
+
}) => {
|
|
72
|
+
const query = 'CALL apoc.import.csv(';
|
|
73
|
+
|
|
74
|
+
await mount(
|
|
75
|
+
<CypherEditor
|
|
76
|
+
value={query}
|
|
77
|
+
schema={testData.mockSchema}
|
|
78
|
+
autofocus={true}
|
|
79
|
+
/>,
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
const tooltip = page.locator('.cm-signature-help-panel');
|
|
83
|
+
|
|
84
|
+
await testTooltip(tooltip, {
|
|
85
|
+
includes: [
|
|
86
|
+
'nodes :: LIST<MAP>',
|
|
87
|
+
'Imports `NODE` and `RELATIONSHIP` values with the given labels and types from the provided CSV file',
|
|
88
|
+
],
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
test('Signature help shows the description for the first argument when the cursor is at that position', async ({
|
|
93
|
+
page,
|
|
94
|
+
mount,
|
|
95
|
+
}) => {
|
|
96
|
+
const query = 'CALL apoc.import.csv()';
|
|
97
|
+
|
|
98
|
+
await mount(
|
|
99
|
+
<CypherEditor value={query} schema={testData.mockSchema} offset={21} />,
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
const tooltip = page.locator('.cm-signature-help-panel');
|
|
103
|
+
|
|
104
|
+
await testTooltip(tooltip, {
|
|
105
|
+
includes: [
|
|
106
|
+
'nodes :: LIST<MAP>',
|
|
107
|
+
'Imports `NODE` and `RELATIONSHIP` values with the given labels and types from the provided CSV file',
|
|
108
|
+
],
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
test('Signature help shows the description for the second argument', async ({
|
|
113
|
+
page,
|
|
114
|
+
mount,
|
|
115
|
+
}) => {
|
|
116
|
+
const query = 'CALL apoc.import.csv(nodes,';
|
|
117
|
+
|
|
118
|
+
await mount(
|
|
119
|
+
<CypherEditor
|
|
120
|
+
value={query}
|
|
121
|
+
schema={testData.mockSchema}
|
|
122
|
+
autofocus={true}
|
|
123
|
+
/>,
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
const tooltip = page.locator('.cm-signature-help-panel');
|
|
127
|
+
|
|
128
|
+
await testTooltip(tooltip, {
|
|
129
|
+
includes: [
|
|
130
|
+
'rels :: LIST<MAP>',
|
|
131
|
+
'Imports `NODE` and `RELATIONSHIP` values with the given labels and types from the provided CSV file',
|
|
132
|
+
],
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
test('Signature help shows the description for the second argument when the cursor is at that position', async ({
|
|
137
|
+
page,
|
|
138
|
+
mount,
|
|
139
|
+
}) => {
|
|
140
|
+
const query = 'CALL apoc.import.csv(nodes,)';
|
|
141
|
+
|
|
142
|
+
await mount(
|
|
143
|
+
<CypherEditor value={query} schema={testData.mockSchema} offset={27} />,
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
const tooltip = page.locator('.cm-signature-help-panel');
|
|
147
|
+
|
|
148
|
+
await testTooltip(tooltip, {
|
|
149
|
+
includes: [
|
|
150
|
+
'rels :: LIST<MAP>',
|
|
151
|
+
'Imports `NODE` and `RELATIONSHIP` values with the given labels and types from the provided CSV file',
|
|
152
|
+
],
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
test('Signature help shows the description for the second argument when the cursor is at that position, even after whitespaces', async ({
|
|
157
|
+
page,
|
|
158
|
+
mount,
|
|
159
|
+
}) => {
|
|
160
|
+
const query = 'CALL apoc.import.csv(nodes, )';
|
|
161
|
+
|
|
162
|
+
await mount(
|
|
163
|
+
<CypherEditor value={query} schema={testData.mockSchema} offset={28} />,
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
const tooltip = page.locator('.cm-signature-help-panel');
|
|
167
|
+
|
|
168
|
+
await testTooltip(tooltip, {
|
|
169
|
+
includes: [
|
|
170
|
+
'rels :: LIST<MAP>',
|
|
171
|
+
'Imports `NODE` and `RELATIONSHIP` values with the given labels and types from the provided CSV file',
|
|
172
|
+
],
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
test('Signature help shows description for arguments with a space following a separator', async ({
|
|
177
|
+
page,
|
|
178
|
+
mount,
|
|
179
|
+
}) => {
|
|
180
|
+
const query = 'CALL apoc.import.csv(nodes, ';
|
|
181
|
+
|
|
182
|
+
await mount(
|
|
183
|
+
<CypherEditor
|
|
184
|
+
value={query}
|
|
185
|
+
schema={testData.mockSchema}
|
|
186
|
+
autofocus={true}
|
|
187
|
+
/>,
|
|
188
|
+
);
|
|
189
|
+
|
|
190
|
+
const tooltip = page.locator('.cm-signature-help-panel');
|
|
191
|
+
|
|
192
|
+
await testTooltip(tooltip, {
|
|
193
|
+
includes: [
|
|
194
|
+
'rels :: LIST<MAP>',
|
|
195
|
+
'Imports `NODE` and `RELATIONSHIP` values with the given labels and types from the provided CSV file',
|
|
196
|
+
],
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
test('Signature help shows the description for the third argument', async ({
|
|
201
|
+
page,
|
|
202
|
+
mount,
|
|
203
|
+
}) => {
|
|
204
|
+
const query = 'CALL apoc.import.csv(nodes, rels,';
|
|
205
|
+
|
|
206
|
+
await mount(
|
|
207
|
+
<CypherEditor
|
|
208
|
+
value={query}
|
|
209
|
+
schema={testData.mockSchema}
|
|
210
|
+
autofocus={true}
|
|
211
|
+
/>,
|
|
212
|
+
);
|
|
213
|
+
|
|
214
|
+
const tooltip = page.locator('.cm-signature-help-panel');
|
|
215
|
+
|
|
216
|
+
await testTooltip(tooltip, {
|
|
217
|
+
includes: [
|
|
218
|
+
'config :: MAP',
|
|
219
|
+
'Imports `NODE` and `RELATIONSHIP` values with the given labels and types from the provided CSV file',
|
|
220
|
+
],
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
test('Signature help works on multiline queries', async ({ page, mount }) => {
|
|
225
|
+
const query = `CALL apoc.import.csv(
|
|
226
|
+
nodes,
|
|
227
|
+
rels,
|
|
228
|
+
`;
|
|
229
|
+
|
|
230
|
+
await mount(
|
|
231
|
+
<CypherEditor
|
|
232
|
+
value={query}
|
|
233
|
+
schema={testData.mockSchema}
|
|
234
|
+
autofocus={true}
|
|
235
|
+
/>,
|
|
236
|
+
);
|
|
237
|
+
|
|
238
|
+
const tooltip = page.locator('.cm-signature-help-panel');
|
|
239
|
+
|
|
240
|
+
await testTooltip(tooltip, {
|
|
241
|
+
includes: [
|
|
242
|
+
'config :: MAP',
|
|
243
|
+
'Imports `NODE` and `RELATIONSHIP` values with the given labels and types from the provided CSV file',
|
|
244
|
+
],
|
|
245
|
+
});
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
test('Signature help only shows the description past the last argument', async ({
|
|
249
|
+
page,
|
|
250
|
+
mount,
|
|
251
|
+
}) => {
|
|
252
|
+
const query = 'CALL apoc.import.csv(nodes, rels, config,';
|
|
253
|
+
|
|
254
|
+
await mount(
|
|
255
|
+
<CypherEditor
|
|
256
|
+
value={query}
|
|
257
|
+
schema={testData.mockSchema}
|
|
258
|
+
autofocus={true}
|
|
259
|
+
/>,
|
|
260
|
+
);
|
|
261
|
+
1;
|
|
262
|
+
|
|
263
|
+
const tooltip = page.locator('.cm-signature-help-panel');
|
|
264
|
+
|
|
265
|
+
await testTooltip(tooltip, {
|
|
266
|
+
includes: [
|
|
267
|
+
'apoc.import.csv(nodes :: LIST<MAP>, rels :: LIST<MAP>, config :: MAP)',
|
|
268
|
+
'Imports `NODE` and `RELATIONSHIP` values with the given labels and types from the provided CSV file.',
|
|
269
|
+
],
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
test('Signature help does not show any help when method finished', async ({
|
|
274
|
+
page,
|
|
275
|
+
mount,
|
|
276
|
+
}) => {
|
|
277
|
+
const query = 'CALL apoc.import.csv(nodes, rels, config)';
|
|
278
|
+
|
|
279
|
+
await mount(
|
|
280
|
+
<CypherEditor
|
|
281
|
+
value={query}
|
|
282
|
+
schema={testData.mockSchema}
|
|
283
|
+
autofocus={true}
|
|
284
|
+
/>,
|
|
285
|
+
);
|
|
286
|
+
|
|
287
|
+
await expect(page.locator('.cm-signature-help-panel')).not.toBeVisible({
|
|
288
|
+
timeout: 2000,
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
test('Signature help does not blow up on empty query', async ({
|
|
293
|
+
page,
|
|
294
|
+
mount,
|
|
295
|
+
}) => {
|
|
296
|
+
const query = '';
|
|
297
|
+
|
|
298
|
+
await mount(
|
|
299
|
+
<CypherEditor
|
|
300
|
+
value={query}
|
|
301
|
+
schema={testData.mockSchema}
|
|
302
|
+
autofocus={true}
|
|
303
|
+
/>,
|
|
304
|
+
);
|
|
305
|
+
|
|
306
|
+
await expect(page.locator('.cm-signature-help-panel')).not.toBeVisible({
|
|
307
|
+
timeout: 2000,
|
|
308
|
+
});
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
test('Signature help is shown below the text by default', async ({
|
|
312
|
+
page,
|
|
313
|
+
mount,
|
|
314
|
+
}) => {
|
|
315
|
+
// We need to introduce new lines to make sure there's
|
|
316
|
+
// enough space to show the tooltip above
|
|
317
|
+
const query = '\n\n\n\n\n\n\nRETURN abs(';
|
|
318
|
+
|
|
319
|
+
await mount(
|
|
320
|
+
<CypherEditor
|
|
321
|
+
value={query}
|
|
322
|
+
schema={testData.mockSchema}
|
|
323
|
+
autofocus={true}
|
|
324
|
+
/>,
|
|
325
|
+
);
|
|
326
|
+
|
|
327
|
+
await expect(
|
|
328
|
+
page.locator('.cm-signature-help-panel.cm-tooltip-below'),
|
|
329
|
+
).toBeVisible({
|
|
330
|
+
timeout: 2000,
|
|
331
|
+
});
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
test('Setting showSignatureTooltipBelow to true shows the signature help above the text', async ({
|
|
335
|
+
page,
|
|
336
|
+
mount,
|
|
337
|
+
}) => {
|
|
338
|
+
// We need to introduce new lines to make sure there's
|
|
339
|
+
// enough space to show the tooltip above
|
|
340
|
+
const query = '\n\n\n\n\n\n\nRETURN abs(';
|
|
341
|
+
|
|
342
|
+
await mount(
|
|
343
|
+
<CypherEditor
|
|
344
|
+
value={query}
|
|
345
|
+
schema={testData.mockSchema}
|
|
346
|
+
showSignatureTooltipBelow={true}
|
|
347
|
+
autofocus={true}
|
|
348
|
+
/>,
|
|
349
|
+
);
|
|
350
|
+
|
|
351
|
+
await expect(
|
|
352
|
+
page.locator('.cm-signature-help-panel.cm-tooltip-below'),
|
|
353
|
+
).toBeVisible({
|
|
354
|
+
timeout: 2000,
|
|
355
|
+
});
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
test('Setting showSignatureTooltipBelow to false shows the signature help above the text', async ({
|
|
359
|
+
page,
|
|
360
|
+
mount,
|
|
361
|
+
}) => {
|
|
362
|
+
// We need to introduce new lines to make sure there's
|
|
363
|
+
// enough space to show the tooltip above
|
|
364
|
+
const query = '\n\n\n\n\n\n\nRETURN abs(';
|
|
365
|
+
|
|
366
|
+
await mount(
|
|
367
|
+
<CypherEditor
|
|
368
|
+
value={query}
|
|
369
|
+
schema={testData.mockSchema}
|
|
370
|
+
showSignatureTooltipBelow={false}
|
|
371
|
+
autofocus={true}
|
|
372
|
+
/>,
|
|
373
|
+
);
|
|
374
|
+
|
|
375
|
+
await expect(
|
|
376
|
+
page.locator('.cm-signature-help-panel.cm-tooltip-above'),
|
|
377
|
+
).toBeVisible({
|
|
378
|
+
timeout: 2000,
|
|
379
|
+
});
|
|
380
|
+
});
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { expect, test } from '@playwright/experimental-ct-react';
|
|
2
|
+
import { CypherEditor } from '../CypherEditor';
|
|
3
|
+
|
|
4
|
+
test('can complete pattern snippet', async ({ page, mount }) => {
|
|
5
|
+
await mount(<CypherEditor />);
|
|
6
|
+
const textField = page.getByRole('textbox');
|
|
7
|
+
|
|
8
|
+
await textField.fill('MATCH ()-[]->()');
|
|
9
|
+
|
|
10
|
+
await page.locator('.cm-tooltip-autocomplete').getByText('-[]->()').click();
|
|
11
|
+
await expect(page.locator('.cm-tooltip-autocomplete')).not.toBeVisible();
|
|
12
|
+
|
|
13
|
+
await textField.press('Tab');
|
|
14
|
+
await textField.press('Tab');
|
|
15
|
+
|
|
16
|
+
await expect(textField).toHaveText('MATCH ()-[]->()-[ ]->( )');
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
test('can navigate snippet', async ({ page, mount }) => {
|
|
20
|
+
await mount(<CypherEditor />);
|
|
21
|
+
const textField = page.getByRole('textbox');
|
|
22
|
+
|
|
23
|
+
await textField.fill('CREATE INDEX abc FOR ()');
|
|
24
|
+
|
|
25
|
+
await page
|
|
26
|
+
.locator('.cm-tooltip-autocomplete')
|
|
27
|
+
.getByText('-[]-()', { exact: true })
|
|
28
|
+
.click();
|
|
29
|
+
await expect(page.locator('.cm-tooltip-autocomplete')).not.toBeVisible();
|
|
30
|
+
await expect(page.locator('.cm-snippetField')).toHaveCount(2);
|
|
31
|
+
|
|
32
|
+
await textField.press('Tab');
|
|
33
|
+
await textField.press('Shift+Tab');
|
|
34
|
+
|
|
35
|
+
await expect(textField).toHaveText('CREATE INDEX abc FOR ()-[ ]-( )');
|
|
36
|
+
|
|
37
|
+
await textField.press('a');
|
|
38
|
+
await expect(textField).toHaveText('CREATE INDEX abc FOR ()-[a]-( )');
|
|
39
|
+
|
|
40
|
+
await textField.press('Escape');
|
|
41
|
+
await textField.press('Escape');
|
|
42
|
+
await expect(page.locator('.cm-snippetField')).toHaveCount(0);
|
|
43
|
+
await textField.press('Tab');
|
|
44
|
+
await expect(textField).toHaveText('CREATE INDEX abc FOR ()-[a ]-( )');
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
test('can accept completion inside pattern snippet', async ({
|
|
48
|
+
page,
|
|
49
|
+
mount,
|
|
50
|
+
}) => {
|
|
51
|
+
await mount(<CypherEditor schema={{ labels: ['City'] }} />);
|
|
52
|
+
const textField = page.getByRole('textbox');
|
|
53
|
+
|
|
54
|
+
await textField.fill('MATCH ()-[]->()');
|
|
55
|
+
|
|
56
|
+
await page.locator('.cm-tooltip-autocomplete').getByText('-[]->()').click();
|
|
57
|
+
await expect(page.locator('.cm-tooltip-autocomplete')).not.toBeVisible();
|
|
58
|
+
|
|
59
|
+
// move to node
|
|
60
|
+
await textField.press('Tab');
|
|
61
|
+
|
|
62
|
+
// get & accept completion
|
|
63
|
+
await textField.press(':');
|
|
64
|
+
await expect(
|
|
65
|
+
page.locator('.cm-tooltip-autocomplete').getByText('City'),
|
|
66
|
+
).toBeVisible();
|
|
67
|
+
|
|
68
|
+
await textField.press('Tab');
|
|
69
|
+
await expect(page.locator('.cm-tooltip-autocomplete')).not.toBeVisible();
|
|
70
|
+
|
|
71
|
+
// tab out of the snippet
|
|
72
|
+
await textField.press('Tab');
|
|
73
|
+
|
|
74
|
+
await expect(textField).toHaveText('MATCH ()-[]->()-[ ]->(:City)');
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
test('does not automatically open completion panel for expressions after snippet trigger char', async ({
|
|
78
|
+
page,
|
|
79
|
+
mount,
|
|
80
|
+
}) => {
|
|
81
|
+
await mount(<CypherEditor />);
|
|
82
|
+
const textField = page.getByRole('textbox');
|
|
83
|
+
|
|
84
|
+
await textField.fill('RETURN (1)');
|
|
85
|
+
|
|
86
|
+
// expect the panel to not show up
|
|
87
|
+
await expect(page.locator('.cm-tooltip-autocomplete')).not.toBeVisible();
|
|
88
|
+
|
|
89
|
+
// unless manually triggered
|
|
90
|
+
await textField.press('Control+ ');
|
|
91
|
+
await expect(page.locator('.cm-tooltip-autocomplete')).toBeVisible();
|
|
92
|
+
});
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { expect, test } from '@playwright/experimental-ct-react';
|
|
2
2
|
import { CypherEditor } from '../CypherEditor';
|
|
3
3
|
import { darkThemeConstants, lightThemeConstants } from '../themes';
|
|
4
|
-
import { CypherEditorPage } from './
|
|
5
|
-
|
|
6
|
-
test.use({ viewport: { width: 500, height: 500 } });
|
|
4
|
+
import { CypherEditorPage } from './e2eUtils';
|
|
7
5
|
|
|
8
6
|
test('light theme highlighting', async ({ page, mount }) => {
|
|
9
7
|
const editorPage = new CypherEditorPage(page);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { expect, test } from '@playwright/experimental-ct-react';
|
|
2
2
|
import { CypherEditor } from '../CypherEditor';
|
|
3
|
-
import { CypherEditorPage } from './
|
|
3
|
+
import { CypherEditorPage } from './e2eUtils';
|
|
4
4
|
|
|
5
5
|
test.use({ viewport: { width: 1000, height: 500 } });
|
|
6
6
|
test('Prop lint set to false disables syntax validation', async ({
|
|
@@ -16,8 +16,7 @@ test('Prop lint set to false disables syntax validation', async ({
|
|
|
16
16
|
});
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
test.skip('Can turn linting back on', async ({ page, mount }) => {
|
|
19
|
+
test('Can turn linting back on', async ({ page, mount }) => {
|
|
21
20
|
const editorPage = new CypherEditorPage(page);
|
|
22
21
|
const query = 'METCH (n) RETURN n';
|
|
23
22
|
|
|
@@ -27,7 +26,7 @@ test.skip('Can turn linting back on', async ({ page, mount }) => {
|
|
|
27
26
|
timeout: 2000,
|
|
28
27
|
});
|
|
29
28
|
|
|
30
|
-
await component.update(<CypherEditor value={query} lint />);
|
|
29
|
+
await component.update(<CypherEditor value={query} lint={true} />);
|
|
31
30
|
|
|
32
31
|
await editorPage.getEditor().fill('METCH (n) RETURN n');
|
|
33
32
|
|
|
@@ -107,7 +106,7 @@ test('Semantic errors are correctly accumulated', async ({ page, mount }) => {
|
|
|
107
106
|
|
|
108
107
|
await editorPage.checkErrorMessage(
|
|
109
108
|
'MATCH (n)',
|
|
110
|
-
'Query cannot conclude with MATCH (must be a RETURN clause, an update clause, a unit subquery call, or a procedure call with no YIELD)',
|
|
109
|
+
'Query cannot conclude with MATCH (must be a RETURN clause, a FINISH clause, an update clause, a unit subquery call, or a procedure call with no YIELD).',
|
|
111
110
|
);
|
|
112
111
|
|
|
113
112
|
await editorPage.checkErrorMessage(
|
|
@@ -127,7 +126,7 @@ test('Multiline errors are correctly placed', async ({ page, mount }) => {
|
|
|
127
126
|
|
|
128
127
|
await editorPage.checkErrorMessage(
|
|
129
128
|
'MATCH (n)',
|
|
130
|
-
'Query cannot conclude with MATCH (must be a RETURN clause, an update clause, a unit subquery call, or a procedure call with no YIELD)',
|
|
129
|
+
'Query cannot conclude with MATCH (must be a RETURN clause, a FINISH clause, an update clause, a unit subquery call, or a procedure call with no YIELD)',
|
|
131
130
|
);
|
|
132
131
|
|
|
133
132
|
await editorPage.checkErrorMessage(
|
|
@@ -147,7 +146,7 @@ test('Validation errors are correctly overlapped', async ({ page, mount }) => {
|
|
|
147
146
|
|
|
148
147
|
await editorPage.checkErrorMessage(
|
|
149
148
|
'-1',
|
|
150
|
-
'Query cannot conclude with CALL (must be a RETURN clause, an update clause, a unit subquery call, or a procedure call with no YIELD)',
|
|
149
|
+
'Query cannot conclude with CALL (must be a RETURN clause, a FINISH clause, an update clause, a unit subquery call, or a procedure call with no YIELD).',
|
|
151
150
|
);
|
|
152
151
|
|
|
153
152
|
await editorPage.checkErrorMessage(
|
|
@@ -77,11 +77,11 @@ const historyState = StateField.define<HistoryState>({
|
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
} else if (effect.is(
|
|
80
|
+
} else if (effect.is(replaceHistory)) {
|
|
81
81
|
return {
|
|
82
82
|
...value,
|
|
83
83
|
index: DRAFT_ENTRY_INDEX,
|
|
84
|
-
history:
|
|
84
|
+
history: effect.value,
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
87
|
}
|
|
@@ -91,13 +91,13 @@ const historyState = StateField.define<HistoryState>({
|
|
|
91
91
|
|
|
92
92
|
type HistoryNavigation = 'BACK' | 'FORWARDS';
|
|
93
93
|
const moveInHistory = StateEffect.define<HistoryNavigation>();
|
|
94
|
-
const
|
|
94
|
+
export const replaceHistory = StateEffect.define<string[]>();
|
|
95
95
|
|
|
96
96
|
function navigateHistory(view: EditorView, direction: HistoryNavigation) {
|
|
97
97
|
view.dispatch(
|
|
98
98
|
view.state.update({
|
|
99
99
|
effects: moveInHistory.of(direction),
|
|
100
|
-
selection: { anchor: view.state.doc.length },
|
|
100
|
+
selection: { anchor: direction === 'BACK' ? 0 : view.state.doc.length },
|
|
101
101
|
}),
|
|
102
102
|
);
|
|
103
103
|
|
|
@@ -116,39 +116,16 @@ function navigateHistory(view: EditorView, direction: HistoryNavigation) {
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
type ReplProps = {
|
|
119
|
-
|
|
120
|
-
initialHistory?: string[];
|
|
121
|
-
onNewHistoryEntry?: (historyEntry: string) => void;
|
|
119
|
+
history?: string[];
|
|
122
120
|
};
|
|
123
121
|
|
|
124
|
-
export const replMode = ({
|
|
125
|
-
onExecute,
|
|
126
|
-
onNewHistoryEntry,
|
|
127
|
-
initialHistory,
|
|
128
|
-
}: ReplProps): Extension[] => {
|
|
122
|
+
export const replMode = ({ history }: ReplProps): Extension[] => {
|
|
129
123
|
return [
|
|
130
124
|
historyState.init(() => ({
|
|
131
125
|
...historyInitialState,
|
|
132
|
-
history
|
|
126
|
+
history,
|
|
133
127
|
})),
|
|
134
128
|
keymap.of([
|
|
135
|
-
{
|
|
136
|
-
key: 'Ctrl-Enter',
|
|
137
|
-
mac: 'Mod-Enter',
|
|
138
|
-
preventDefault: true,
|
|
139
|
-
run: (view) => {
|
|
140
|
-
const doc = view.state.doc.toString();
|
|
141
|
-
if (doc.trim() !== '') {
|
|
142
|
-
onExecute?.(doc);
|
|
143
|
-
onNewHistoryEntry?.(doc);
|
|
144
|
-
view.dispatch({
|
|
145
|
-
effects: pushToHistory.of(doc),
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
return true;
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
129
|
{
|
|
153
130
|
key: 'ArrowUp',
|
|
154
131
|
preventDefault: true,
|
package/src/icons.ts
CHANGED
|
@@ -23,6 +23,7 @@ export type CompletionItemIcons =
|
|
|
23
23
|
| 'Struct'
|
|
24
24
|
| 'Event'
|
|
25
25
|
| 'Operator'
|
|
26
|
+
| 'Console'
|
|
26
27
|
| 'TypeParameter';
|
|
27
28
|
|
|
28
29
|
export function getIconForType(iconTypeString = 'Text', isDarkTheme = false) {
|
|
@@ -51,6 +52,7 @@ export function getIconForType(iconTypeString = 'Text', isDarkTheme = false) {
|
|
|
51
52
|
Struct: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M2.00024 2L1.00024 3V6L2.00024 7H14.0002L15.0002 6V3L14.0002 2H2.00024ZM2.00024 3H3.00024H13.0002H14.0002V4V5V6H13.0002H3.00024H2.00024V5V4V3ZM1.00024 10L2.00024 9H5.00024L6.00024 10V13L5.00024 14H2.00024L1.00024 13V10ZM3.00024 10H2.00024V11V12V13H3.00024H4.00024H5.00024V12V11V10H4.00024H3.00024ZM10.0002 10L11.0002 9H14.0002L15.0002 10V13L14.0002 14H11.0002L10.0002 13V10ZM12.0002 10H11.0002V11V12V13H12.0002H13.0002H14.0002V12V11V10H13.0002H12.0002Z" fill="#424242"/> </svg>`,
|
|
52
53
|
Event: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M7.41379 1.55996L8.31177 1H11.6059L12.4243 2.57465L10.2358 6H12.0176L12.7365 7.69512L5.61967 15L4.01699 13.837L6.11967 10H4.89822L4.00024 8.55996L7.41379 1.55996ZM7.78058 9L4.90078 14.3049L12.0176 7H8.31177L11.6059 2H8.31177L4.89822 9H7.78058Z" fill="#D67E00"/> </svg>`,
|
|
53
54
|
Operator: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M2.87313 1.10023C3.20793 1.23579 3.4757 1.498 3.61826 1.82988C3.69056 1.99959 3.72699 2.18242 3.72526 2.36688C3.72642 2.54999 3.69 2.7314 3.61826 2.89988C3.51324 3.14567 3.33807 3.35503 3.11466 3.50177C2.89126 3.64851 2.62955 3.72612 2.36226 3.72488C2.17948 3.72592 1.99842 3.68951 1.83026 3.61788C1.58322 3.51406 1.37252 3.33932 1.22478 3.11575C1.07704 2.89219 0.99891 2.62984 1.00026 2.36188C0.999374 2.17921 1.03543 1.99825 1.10626 1.82988C1.24362 1.50314 1.50353 1.24323 1.83026 1.10588C2.16357 0.966692 2.53834 0.964661 2.87313 1.10023ZM2.57526 2.86488C2.70564 2.80913 2.80951 2.70526 2.86526 2.57488C2.89314 2.50838 2.90742 2.43698 2.90726 2.36488C2.90838 2.2654 2.88239 2.1675 2.8321 2.08167C2.7818 1.99584 2.70909 1.92531 2.62176 1.87767C2.53443 1.83002 2.43577 1.80705 2.33638 1.81121C2.23698 1.81537 2.1406 1.8465 2.05755 1.90128C1.97451 1.95606 1.90794 2.03241 1.865 2.12215C1.82205 2.21188 1.80434 2.31161 1.81376 2.41065C1.82319 2.50968 1.85939 2.60428 1.9185 2.6843C1.9776 2.76433 2.05738 2.82675 2.14926 2.86488C2.28574 2.92089 2.43878 2.92089 2.57526 2.86488ZM6.43019 1.1095L1.10992 6.42977L1.79581 7.11567L7.11608 1.7954L6.43019 1.1095ZM11.5002 8.99999H12.5002V11.5H15.0002V12.5H12.5002V15H11.5002V12.5H9.00024V11.5H11.5002V8.99999ZM5.76801 9.52509L6.47512 10.2322L4.70735 12L6.47512 13.7677L5.76801 14.4748L4.00024 12.7071L2.23248 14.4748L1.52537 13.7677L3.29314 12L1.52537 10.2322L2.23248 9.52509L4.00024 11.2929L5.76801 9.52509ZM7.11826 5.32988C7.01466 5.08268 6.83997 4.87183 6.61636 4.72406C6.39275 4.57629 6.13028 4.49826 5.86226 4.49988C5.6796 4.49899 5.49864 4.53505 5.33026 4.60588C5.00353 4.74323 4.74362 5.00314 4.60626 5.32988C4.53612 5.49478 4.49922 5.67191 4.49766 5.8511C4.4961 6.0303 4.52992 6.20804 4.59718 6.37414C4.66443 6.54024 4.76381 6.69143 4.88961 6.81906C5.0154 6.94669 5.16515 7.04823 5.33026 7.11788C5.49892 7.18848 5.67993 7.22484 5.86276 7.22484C6.0456 7.22484 6.22661 7.18848 6.39526 7.11788C6.64225 7.01388 6.85295 6.83913 7.00082 6.61563C7.1487 6.39213 7.22713 6.12987 7.22626 5.86188C7.22679 5.67905 7.19005 5.49803 7.11826 5.32988ZM6.36526 6.07488C6.3379 6.13937 6.29854 6.19808 6.24926 6.24788C6.19932 6.29724 6.14066 6.33691 6.07626 6.36488C6.00878 6.39297 5.93635 6.40725 5.86326 6.40688C5.79015 6.40744 5.71769 6.39315 5.65026 6.36488C5.58565 6.33729 5.52693 6.29757 5.47726 6.24788C5.42715 6.19856 5.38738 6.13975 5.36026 6.07488C5.30425 5.9384 5.30425 5.78536 5.36026 5.64888C5.41561 5.51846 5.51965 5.41477 5.65026 5.35988C5.71761 5.33126 5.79008 5.31663 5.86326 5.31688C5.93642 5.31685 6.00884 5.33147 6.07626 5.35988C6.14062 5.38749 6.19928 5.42682 6.24926 5.47588C6.2981 5.52603 6.33741 5.58465 6.36526 5.64888C6.39364 5.7163 6.40827 5.78872 6.40827 5.86188C6.40827 5.93503 6.39364 6.00745 6.36526 6.07488ZM14.0002 3H10.0002V4H14.0002V3Z" fill="#424242"/> </svg>`,
|
|
55
|
+
Console: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M1.00024 1H15.0002V15H1.00024V1ZM2.00024 14H14.0002V2H2.00024V14ZM4.00032 5.70709L4.70743 4.99999L8.24296 8.53552L7.53585 9.24263L7.53583 9.2426L4.70735 12.0711L4.00024 11.364L6.82872 8.53549L4.00032 5.70709Z" fill="#424242"/> </svg>`,
|
|
54
56
|
TypeParameter: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M11.0003 6H10.0003V5.5C10.0003 5.22386 9.7764 5 9.50026 5H8.47926V10.5C8.47926 10.7761 8.70312 11 8.97926 11H9.47926V12H6.47926V11H6.97926C7.2554 11 7.47926 10.7761 7.47926 10.5V5H6.50026C6.22412 5 6.00026 5.22386 6.00026 5.5V6H5.00026V4H11.0003V6ZM13.9145 8.0481L12.4522 6.58581L13.1593 5.87871L14.9751 7.69454V8.40165L13.2074 10.1694L12.5003 9.46231L13.9145 8.0481ZM3.54835 9.4623L2.08605 8.00002L3.50026 6.58581L2.79316 5.8787L1.02539 7.64647V8.35357L2.84124 10.1694L3.54835 9.4623Z" fill="#424242"/> </svg>`,
|
|
55
57
|
};
|
|
56
58
|
|
|
@@ -79,6 +81,7 @@ export function getIconForType(iconTypeString = 'Text', isDarkTheme = false) {
|
|
|
79
81
|
Struct: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M2 2L1 3V6L2 7H14L15 6V3L14 2H2ZM2 3H3H13H14V4V5V6H13H3H2V5V4V3ZM1 10L2 9H5L6 10V13L5 14H2L1 13V10ZM3 10H2V11V12V13H3H4H5V12V11V10H4H3ZM10 10L11 9H14L15 10V13L14 14H11L10 13V10ZM12 10H11V11V12V13H12H13H14V12V11V10H13H12Z" fill="#C5C5C5"/> </svg>`,
|
|
80
82
|
Event: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M7.41354 1.55996L8.31152 1H11.6056L12.424 2.57465L10.2356 6H12.0174L12.7363 7.69512L5.61943 15L4.01675 13.837L6.11943 10H4.89798L4 8.55996L7.41354 1.55996ZM7.78033 9L4.90054 14.3049L12.0174 7H8.31152L11.6056 2H8.31152L4.89798 9H7.78033Z" fill="#EE9D28"/> </svg>`,
|
|
81
83
|
Operator: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M2.87289 1.10023C3.20768 1.23579 3.47545 1.498 3.61802 1.82988C3.69032 1.99959 3.72675 2.18242 3.72502 2.36688C3.72617 2.54999 3.68975 2.7314 3.61802 2.89988C3.51299 3.14567 3.33782 3.35503 3.11442 3.50177C2.89102 3.64851 2.6293 3.72612 2.36202 3.72488C2.17924 3.72592 1.99818 3.68951 1.83002 3.61788C1.58298 3.51406 1.37227 3.33932 1.22453 3.11575C1.0768 2.89219 0.998666 2.62984 1.00002 2.36188C0.99913 2.17921 1.03519 1.99825 1.10602 1.82988C1.24337 1.50314 1.50328 1.24323 1.83002 1.10588C2.16332 0.966692 2.53809 0.964661 2.87289 1.10023ZM2.57502 2.86488C2.7054 2.80913 2.80927 2.70526 2.86502 2.57488C2.8929 2.50838 2.90718 2.43698 2.90702 2.36488C2.90813 2.2654 2.88215 2.1675 2.83185 2.08167C2.78156 1.99584 2.70884 1.92531 2.62151 1.87767C2.53418 1.83002 2.43553 1.80705 2.33614 1.81121C2.23674 1.81537 2.14035 1.8465 2.05731 1.90128C1.97426 1.95606 1.9077 2.03241 1.86475 2.12215C1.8218 2.21188 1.80409 2.31161 1.81352 2.41065C1.82294 2.50968 1.85915 2.60428 1.91825 2.6843C1.97736 2.76433 2.05713 2.82675 2.14902 2.86488C2.28549 2.92089 2.43854 2.92089 2.57502 2.86488ZM6.42995 1.1095L1.10967 6.42977L1.79557 7.11567L7.11584 1.7954L6.42995 1.1095ZM11.5 8.99999H12.5V11.5H15V12.5H12.5V15H11.5V12.5H9V11.5H11.5V8.99999ZM5.76777 9.52509L6.47487 10.2322L4.70711 12L6.47487 13.7677L5.76777 14.4748L4 12.7071L2.23223 14.4748L1.52513 13.7677L3.29289 12L1.52513 10.2322L2.23223 9.52509L4 11.2929L5.76777 9.52509ZM7.11802 5.32988C7.01442 5.08268 6.83973 4.87183 6.61612 4.72406C6.3925 4.57629 6.13004 4.49826 5.86202 4.49988C5.67935 4.49899 5.49839 4.53505 5.33002 4.60588C5.00328 4.74323 4.74337 5.00314 4.60602 5.32988C4.53588 5.49478 4.49897 5.67191 4.49741 5.8511C4.49586 6.0303 4.52967 6.20804 4.59693 6.37414C4.66419 6.54024 4.76356 6.69143 4.88936 6.81906C5.01516 6.94669 5.1649 7.04823 5.33002 7.11788C5.49867 7.18848 5.67968 7.22484 5.86252 7.22484C6.04535 7.22484 6.22636 7.18848 6.39502 7.11788C6.64201 7.01388 6.8527 6.83913 7.00058 6.61563C7.14845 6.39213 7.22689 6.12987 7.22602 5.86188C7.22655 5.67905 7.1898 5.49803 7.11802 5.32988ZM6.36502 6.07488C6.33766 6.13937 6.29829 6.19808 6.24902 6.24788C6.19908 6.29724 6.14042 6.33691 6.07602 6.36488C6.00854 6.39297 5.93611 6.40725 5.86302 6.40688C5.78991 6.40744 5.71744 6.39315 5.65002 6.36488C5.58541 6.33729 5.52668 6.29757 5.47702 6.24788C5.42691 6.19856 5.38713 6.13975 5.36002 6.07488C5.30401 5.9384 5.30401 5.78536 5.36002 5.64888C5.41536 5.51846 5.51941 5.41477 5.65002 5.35988C5.71737 5.33126 5.78984 5.31663 5.86302 5.31688C5.93618 5.31685 6.0086 5.33147 6.07602 5.35988C6.14037 5.38749 6.19904 5.42682 6.24902 5.47588C6.29786 5.52603 6.33717 5.58465 6.36502 5.64888C6.3934 5.7163 6.40802 5.78872 6.40802 5.86188C6.40802 5.93503 6.3934 6.00745 6.36502 6.07488ZM14 3H10V4H14V3Z" fill="#C5C5C5"/> </svg>`,
|
|
84
|
+
Console: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M1 1H15V15H1V1ZM2 14H14V2H2V14ZM4.00008 5.70709L4.70718 4.99999L8.24272 8.53552L7.53561 9.24263L7.53558 9.2426L4.70711 12.0711L4 11.364L6.82848 8.53549L4.00008 5.70709Z" fill="#C5C5C5"/> </svg>`,
|
|
82
85
|
TypeParameter: `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> <path fill-rule="evenodd" clip-rule="evenodd" d="M11 6H10V5.5C10 5.22386 9.77616 5 9.50001 5H8.47902V10.5C8.47902 10.7761 8.70288 11 8.97902 11H9.47902V12H6.47902V11H6.97902C7.25516 11 7.47902 10.7761 7.47902 10.5V5H6.50001C6.22387 5 6.00001 5.22386 6.00001 5.5V6H5.00001V4H11V6ZM13.9142 8.0481L12.4519 6.58581L13.159 5.87871L14.9749 7.69454V8.40165L13.2071 10.1694L12.5 9.46231L13.9142 8.0481ZM3.5481 9.4623L2.08581 8.00002L3.50002 6.58581L2.79291 5.8787L1.02515 7.64647V8.35357L2.841 10.1694L3.5481 9.4623Z" fill="#C5C5C5"/> </svg>`,
|
|
83
86
|
};
|
|
84
87
|
const iconType = iconTypeString as CompletionItemIcons;
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {
|
|
2
|
+
CypherParser,
|
|
3
|
+
_internalFeatureFlags,
|
|
4
|
+
} from '@neo4j-cypher/language-support';
|
|
2
5
|
export { CypherEditor } from './CypherEditor';
|
|
3
|
-
export { cypher } from './lang-cypher/
|
|
6
|
+
export { cypher } from './lang-cypher/langCypher';
|
|
4
7
|
export { darkThemeConstants, lightThemeConstants } from './themes';
|