Skip to content

Commit f332eaf

Browse files
committed
Makes the thing work
1 parent acb4415 commit f332eaf

File tree

2 files changed

+67
-15
lines changed

2 files changed

+67
-15
lines changed

packages/vscode-extension/syntaxes/cypher.adoc.json

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,44 @@
33
"injectionSelector": "L:text.asciidoc -meta.embedded.block",
44
"patterns": [
55
{
6-
"begin": "\\[(source),\\s*(cypher)\\]",
7-
"name": "markup.fenced_code.block.markdown",
8-
"end": "(-{4})",
6+
"name": "markup.code.cypher.asciidoc",
7+
"begin": "^\\[(source)(,|#)\\s*(?i:(cypher))([^\\]]+)*\\]\\s*$",
98
"beginCaptures": {
109
"1": {
11-
"name": "entity.name.function.asciidoc"
12-
},
13-
"2": {
14-
"name": "markup.meta.attribute-list.asciidoc"
10+
"name": "markup.meta.attribute-list.asciidoc entity.name.function.asciidoc"
1511
},
1612
"3": {
17-
"name": "markup.raw.asciidoc"
18-
}
19-
},
20-
"endCaptures": {
21-
"1": {
22-
"name": "punctuation.definition.markdown"
13+
"name": "markup.meta.attribute-list.asciidoc markup.heading.asciidoc"
14+
},
15+
"4": {
16+
"name": "markup.meta.attribute-list.asciidoc markup.heading.asciidoc"
2317
}
2418
},
2519
"patterns": [
2620
{
27-
"include": "source.cypher"
21+
"comment": "listing block",
22+
"begin": "^(-{4,})\\s*$",
23+
"contentName": "source.block.cypher",
24+
"patterns": [
25+
{
26+
"include": "source.cypher"
27+
}
28+
],
29+
"end": "^(\\1)$"
30+
},
31+
{
32+
"comment": "open block",
33+
"begin": "^(-{2})\\s*$",
34+
"contentName": "source.embedded.cypher",
35+
"patterns": [
36+
{
37+
"include": "source.cypher"
38+
}
39+
],
40+
"end": "^(\\1)$"
2841
}
29-
]
42+
],
43+
"end": "((?<=--|\\.\\.\\.\\.)$|^\\s*$)"
3044
}
3145
]
3246
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[source,java]
2+
----
3+
import org.neo4j.cypherdsl.parser.CypherParser;
4+
5+
public class Demo {
6+
public static void main(String...a) {
7+
var node = CypherParser.parseNode("(m:Movie)");
8+
}
9+
}
10+
----
11+
Some random text
12+
13+
14+
[source,cypher]
15+
----
16+
/* This is a
17+
multiline comment
18+
*/
19+
MATCH (u1:CommerceUser{user_id:$seller_id}),
20+
(u2:CommerceUser{user_id:$customer_id}),
21+
p = allShortestPaths((u1)-[:PURCHASE*..10]->(u2))
22+
WHERE u1 <> u2
23+
WITH
24+
// This is a single line comment
25+
reduce(output = [], n IN relationships(p) | output + n.create_time.epochMillis ) as relsDate,
26+
reduce(output = [], n IN nodes(p) | output + n ) as nodes,
27+
"double quoted string" as a,
28+
'single quoted string' as b
29+
RETURN relsDate, nodes
30+
LIMIT $limit
31+
----
32+
33+
Some other text
34+
35+
[source,cypher,indent=0,tabsize=4]
36+
----
37+
MATCH (n) RETURN n
38+
----

0 commit comments

Comments
 (0)