1 // RUN: mlir-pdll-lsp-server -lit-test < %s | FileCheck -strict-whitespace %s
2 {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootUri":"test:///workspace","capabilities":{"textDocument":{"documentSymbol":{"hierarchicalDocumentSymbolSupport":true}}},"trace":"off"}}
4 {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{
5 "uri":"test:///foo.pdll",
8 "text":"Pattern Foo {\nerase op<foo.op>;\n}\nConstraint Cst() -> Op{\nreturn op<toy.test>;\n}\n\nRewrite SomeRewrite() -> Op {\nreturn op: Op;\n}"
11 {"jsonrpc":"2.0","id":1,"method":"textDocument/documentSymbol","params":{
12 "textDocument":{"uri":"test:///foo.pdll"}
15 // CHECK-NEXT: "jsonrpc": "2.0",
16 // CHECK-NEXT: "result": [
18 // CHECK-NEXT: "kind": 5,
19 // CHECK-NEXT: "name": "Foo",
20 // CHECK-NEXT: "range": {
21 // CHECK-NEXT: "end": {
22 // CHECK-NEXT: "character": 1,
23 // CHECK-NEXT: "line": 2
25 // CHECK-NEXT: "start": {
26 // CHECK-NEXT: "character": 8,
27 // CHECK-NEXT: "line": 0
30 // CHECK-NEXT: "selectionRange": {
31 // CHECK-NEXT: "end": {
32 // CHECK-NEXT: "character": 11,
33 // CHECK-NEXT: "line": 0
35 // CHECK-NEXT: "start": {
36 // CHECK-NEXT: "character": 8,
37 // CHECK-NEXT: "line": 0
42 // CHECK-NEXT: "kind": 12,
43 // CHECK-NEXT: "name": "Cst",
44 // CHECK-NEXT: "range": {
45 // CHECK-NEXT: "end": {
46 // CHECK-NEXT: "character": 14,
47 // CHECK-NEXT: "line": 3
49 // CHECK-NEXT: "start": {
50 // CHECK-NEXT: "character": 11,
51 // CHECK-NEXT: "line": 3
54 // CHECK-NEXT: "selectionRange": {
55 // CHECK-NEXT: "end": {
56 // CHECK-NEXT: "character": 14,
57 // CHECK-NEXT: "line": 3
59 // CHECK-NEXT: "start": {
60 // CHECK-NEXT: "character": 11,
61 // CHECK-NEXT: "line": 3
66 // CHECK-NEXT: "kind": 12,
67 // CHECK-NEXT: "name": "SomeRewrite",
68 // CHECK-NEXT: "range": {
69 // CHECK-NEXT: "end": {
70 // CHECK-NEXT: "character": 19,
71 // CHECK-NEXT: "line": 7
73 // CHECK-NEXT: "start": {
74 // CHECK-NEXT: "character": 8,
75 // CHECK-NEXT: "line": 7
78 // CHECK-NEXT: "selectionRange": {
79 // CHECK-NEXT: "end": {
80 // CHECK-NEXT: "character": 19,
81 // CHECK-NEXT: "line": 7
83 // CHECK-NEXT: "start": {
84 // CHECK-NEXT: "character": 8,
85 // CHECK-NEXT: "line": 7
91 {"jsonrpc":"2.0","id":3,"method":"shutdown"}
93 {"jsonrpc":"2.0","method":"exit"}