[mlir][sparse] implement non-permutation MapRef encoding (#69406)
[llvm-project.git] / clang-tools-extra / clangd / test / completion-auto-trigger.test
blobcf7261e904330f5bc17dca130bf63797828afad0
1 # RUN: clangd -lit-test < %s | FileCheck -strict-whitespace %s
2 {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":123,"rootPath":"clangd","capabilities":{},"trace":"off"}}
3 ---
4 {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"test:///main.cpp","languageId":"cpp","version":1,"text":"namespace ns { int ns_member; } struct vector { int size; static int default_capacity; };\nvoid test(vector *a, vector *b) {\n  if (a > b) {} \n  a->size = 10;\n\n  a ? a : b;\n  ns::ns_member = 10;\n}"}}}
5 ---
6 {"jsonrpc":"2.0","id":1,"method":"textDocument/completion","params":{"textDocument":{"uri":"test:///main.cpp"},"position":{"line":2,"character":9},"context":{"triggerKind":2,"triggerCharacter":">"}}}
7 #      CHECK:  "id": 1,
8 # CHECK-NEXT:  "jsonrpc": "2.0"
9 # CHECK-NEXT:  "result": {
10 # CHECK-NEXT:    "isIncomplete": false,
11 # CHECK-NEXT:    "items": []
12 # CHECK-NEXT:  }
13 ---
14 {"jsonrpc":"2.0","id":2,"method":"textDocument/completion","params":{"textDocument":{"uri":"test:///main.cpp"},"position":{"line":3,"character":5},"context":{"triggerKind":2,"triggerCharacter":">"}}}
15 #      CHECK:  "id": 2,
16 # CHECK-NEXT:  "jsonrpc": "2.0"
17 # CHECK-NEXT:  "result": {
18 # CHECK-NEXT:    "isIncomplete": false,
19 # CHECK-NEXT:    "items": [
20 # CHECK-NEXT:       {
21 # CHECK-NEXT:        "detail": "int",
22 # CHECK-NEXT:        "filterText": "size",
23 # CHECK-NEXT:        "insertText": "size",
24 # CHECK-NEXT:        "insertTextFormat": 1,
25 # CHECK-NEXT:        "kind": 5,
26 # CHECK-NEXT:        "label": " size",
27 # CHECK-NEXT:        "score": {{[0-9]+.[0-9]+}},
28 # CHECK-NEXT:        "sortText": "{{.*}}size",
29 # CHECK-NEXT:        "textEdit": {
30 # CHECK-NEXT:          "newText": "size",
31 # CHECK-NEXT:          "range": {
32 # CHECK-NEXT:            "end": {
33 # CHECK-NEXT:              "character": 5,
34 # CHECK-NEXT:              "line": 3
35 # CHECK-NEXT:            },
36 # CHECK-NEXT:            "start": {
37 # CHECK-NEXT:              "character": 5,
38 # CHECK-NEXT:              "line": 3
39 # CHECK-NEXT:            }
40 # CHECK-NEXT:          }
41 # CHECK-NEXT:        }
42 # CHECK-NEXT:      },
43 # CHECK-NEXT:      {
44 # CHECK-NEXT:         "detail": "int",
45 # CHECK-NEXT:         "filterText": "default_capacity",
46 # CHECK-NEXT:         "insertText": "default_capacity",
47 # CHECK-NEXT:         "insertTextFormat": 1,
48 # CHECK-NEXT:         "kind": 10,
49 # CHECK-NEXT:         "label": " default_capacity",
50 # CHECK-NEXT:         "score": {{[0-9]+.[0-9]+}},
51 # CHECK-NEXT:         "sortText": "{{.*}}default_capacity",
52 # CHECK-NEXT:         "textEdit": {
53 # CHECK-NEXT:           "newText": "default_capacity",
54 # CHECK-NEXT:           "range": {
55 # CHECK-NEXT:             "end": {
56 # CHECK-NEXT:               "character": 5,
57 # CHECK-NEXT:               "line": 3
58 # CHECK-NEXT:             },
59 # CHECK-NEXT:             "start": {
60 # CHECK-NEXT:               "character": 5,
61 # CHECK-NEXT:               "line": 3
62 # CHECK-NEXT:             }
63 # CHECK-NEXT:           }
64 # CHECK-NEXT:         }
65 # CHECK-NEXT:       }
66 # CHECK-NEXT:     ]
67 # CHECK-NEXT:   }
68 ---
69 {"jsonrpc":"2.0","id":3,"method":"textDocument/completion","params":{"textDocument":{"uri":"test:///main.cpp"},"position":{"line":5,"character":9},"context":{"triggerKind":2,"triggerCharacter":":"}}}
70 #      CHECK:  "id": 3,
71 # CHECK-NEXT:  "jsonrpc": "2.0",
72 # CHECK-NEXT:  "result": {
73 # CHECK-NEXT:    "isIncomplete": false,
74 # CHECK-NEXT:    "items": []
75 # CHECK-NEXT:  }
76 ---
77 {"jsonrpc":"2.0","id":4,"method":"textDocument/completion","params":{"textDocument":{"uri":"test:///main.cpp"},"position":{"line":6,"character":6},"context":{"triggerKind":2,"triggerCharacter":":"}}}
78 ---
79 #      CHECK:  "id": 4,
80 # CHECK-NEXT:  "jsonrpc": "2.0"
81 # CHECK-NEXT:  "result": {
82 # CHECK-NEXT:    "isIncomplete": false,
83 # CHECK-NEXT:    "items": [
84 # CHECK-NEXT:      {
85 # CHECK-NEXT:        "detail": "int",
86 # CHECK-NEXT:        "filterText": "ns_member",
87 # CHECK-NEXT:        "insertText": "ns_member",
88 # CHECK-NEXT:        "insertTextFormat": 1,
89 # CHECK-NEXT:        "kind": 6,
90 # CHECK-NEXT:        "label": " ns_member",
91 # CHECK-NEXT:        "score": {{[0-9]+.[0-9]+}},
92 # CHECK-NEXT:        "sortText": "{{.*}}ns_member",
93 # CHECK-NEXT:        "textEdit": {
94 # CHECK-NEXT:          "newText": "ns_member",
95 # CHECK-NEXT:          "range": {
96 # CHECK-NEXT:            "end": {
97 # CHECK-NEXT:              "character": 6,
98 # CHECK-NEXT:              "line": 6
99 # CHECK-NEXT:            },
100 # CHECK-NEXT:            "start": {
101 # CHECK-NEXT:              "character": 6,
102 # CHECK-NEXT:              "line": 6
103 # CHECK-NEXT:            }
104 # CHECK-NEXT:          }
105 # CHECK-NEXT:        }
106 # CHECK-NEXT:      }
107 # CHECK-NEXT:    ]
108 # CHECK-NEXT:  }
109 {"jsonrpc":"2.0","id":5,"method":"shutdown"}
111 {"jsonrpc":"2.0","method":"exit"}