1 // RUN: mlir-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.mlir",
8 "text":"module {\nfunc.func private @foo()\n}"
11 {"jsonrpc":"2.0","id":1,"method":"textDocument/documentSymbol","params":{
12 "textDocument":{"uri":"test:///foo.mlir"}
15 // CHECK-NEXT: "jsonrpc": "2.0",
16 // CHECK-NEXT: "result": [
18 // CHECK-NEXT: "children": [
20 // CHECK-NEXT: "kind": 12,
21 // CHECK-NEXT: "name": "foo",
22 // CHECK-NEXT: "range": {
23 // CHECK-NEXT: "end": {
24 // CHECK-NEXT: "character": {{.*}},
25 // CHECK-NEXT: "line": {{.*}}
27 // CHECK-NEXT: "start": {
28 // CHECK-NEXT: "character": {{.*}},
29 // CHECK-NEXT: "line": {{.*}}
32 // CHECK-NEXT: "selectionRange": {
33 // CHECK-NEXT: "end": {
34 // CHECK-NEXT: "character": 9,
35 // CHECK-NEXT: "line": {{.*}}
37 // CHECK-NEXT: "start": {
38 // CHECK-NEXT: "character": {{.*}},
39 // CHECK-NEXT: "line": {{.*}}
44 // CHECK-NEXT: "kind": 3,
45 // CHECK-NEXT: "name": "<builtin.module>",
46 // CHECK-NEXT: "range": {
47 // CHECK-NEXT: "end": {
48 // CHECK-NEXT: "character": {{.*}},
49 // CHECK-NEXT: "line": {{.*}}
51 // CHECK-NEXT: "start": {
52 // CHECK-NEXT: "character": {{.*}},
53 // CHECK-NEXT: "line": {{.*}}
56 // CHECK-NEXT: "selectionRange": {
57 // CHECK-NEXT: "end": {
58 // CHECK-NEXT: "character": {{.*}},
59 // CHECK-NEXT: "line": {{.*}}
61 // CHECK-NEXT: "start": {
62 // CHECK-NEXT: "character": {{.*}},
63 // CHECK-NEXT: "line": {{.*}}
69 {"jsonrpc":"2.0","id":3,"method":"shutdown"}
71 {"jsonrpc":"2.0","method":"exit"}