[mlir][py] Enable loading only specified dialects during creation. (#121421)
[llvm-project.git] / mlir / test / mlir-pdll-lsp-server / definition.test
blobd978737102c563efdaf884deac30ea42f86165d2
1 // RUN: mlir-pdll-lsp-server -lit-test < %s | FileCheck %s
2 {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"pdll","capabilities":{},"trace":"off"}}
3 // -----
4 {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{
5   "uri":"test:///foo.pdll",
6   "languageId":"pdll",
7   "version":1,
8   "text":"Pattern FooPattern {\nlet root: Op<toy.test>;\nerase root;\n}"
9 }}}
10 // -----
11 {"jsonrpc":"2.0","id":1,"method":"textDocument/definition","params":{
12   "textDocument":{"uri":"test:///foo.pdll"},
13   "position":{"line":0,"character":12}
15 //      CHECK:  "id": 1
16 // CHECK-NEXT:  "jsonrpc": "2.0",
17 // CHECK-NEXT:  "result": [
18 // CHECK-NEXT:    {
19 // CHECK-NEXT:      "range": {
20 // CHECK-NEXT:        "end": {
21 // CHECK-NEXT:          "character": 18,
22 // CHECK-NEXT:          "line": 0
23 // CHECK-NEXT:        },
24 // CHECK-NEXT:        "start": {
25 // CHECK-NEXT:          "character": 8,
26 // CHECK-NEXT:          "line": 0
27 // CHECK-NEXT:        }
28 // CHECK-NEXT:      },
29 // CHECK-NEXT:      "uri": "{{.*}}/foo.pdll"
30 // CHECK-NEXT:    }
31 // -----
32 {"jsonrpc":"2.0","id":2,"method":"textDocument/definition","params":{
33   "textDocument":{"uri":"test:///foo.pdll"},
34   "position":{"line":2,"character":8}
36 //      CHECK:  "id": 2
37 // CHECK-NEXT:  "jsonrpc": "2.0",
38 // CHECK-NEXT:  "result": [
39 // CHECK-NEXT:    {
40 // CHECK-NEXT:      "range": {
41 // CHECK-NEXT:        "end": {
42 // CHECK-NEXT:          "character": 8,
43 // CHECK-NEXT:          "line": 1
44 // CHECK-NEXT:        },
45 // CHECK-NEXT:        "start": {
46 // CHECK-NEXT:          "character": 4,
47 // CHECK-NEXT:          "line": 1
48 // CHECK-NEXT:        }
49 // CHECK-NEXT:      },
50 // CHECK-NEXT:      "uri": "{{.*}}/foo.pdll"
51 // CHECK-NEXT:    }
52 // -----
53 {"jsonrpc":"2.0","id":3,"method":"shutdown"}
54 // -----
55 {"jsonrpc":"2.0","method":"exit"}