3
=============================== Тесты языкового клиента (json) ===============================
5
----- test/source/lsp/client/json/check-01.txt -----
12
----- test/source/lsp/client/json/check-02.txt -----
14
o "test/source/lsp/client/json/json/ex-01.json"
16
= textDocument/publishDiagnostics => {"jsonrpc_version":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"test/source/lsp/client/json/json/ex-01.json","version":0,"diagnostics":[]}}
17
= textDocument/documentSymbol => {"jsonrpc_version":"2.0","result":[],"id":2}
18
= textDocument/semanticTokens => {"jsonrpc_version":"2.0","result":{"data":[]},"id":3}
21
----- test/source/lsp/client/json/check-03.txt -----
23
o "test/source/lsp/client/json/json/ex-02.json"
24
o "test/source/lsp/client/json/json/ex-03.json"
26
c "test/source/lsp/client/json/json/ex-02.json"
27
c "test/source/lsp/client/json/json/ex-03.json"
29
= textDocument/publishDiagnostics => {"jsonrpc_version":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"test/source/lsp/client/json/json/ex-02.json","version":0,"diagnostics":[]}}
30
= textDocument/publishDiagnostics => {"jsonrpc_version":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"test/source/lsp/client/json/json/ex-03.json","version":0,"diagnostics":[]}}
31
= textDocument/documentSymbol => {"jsonrpc_version":"2.0","result":[],"id":2}
32
= textDocument/semanticTokens => {"jsonrpc_version":"2.0","result":{"data":[]},"id":3}
33
= textDocument/documentSymbol => {"jsonrpc_version":"2.0","result":[{"name":"\"1\"","detail":"\"1\" [2,5]","kind":13,"range":{"start":{"line":1,"character":4},"end":{"line":1,"character":7}},"selectionRange":{"start":{"line":1,"character":4},"end":{"line":1,"character":7}}},{"name":"\"2\"","detail":"\"2\" [3,5]","kind":13,"range":{"start":{"line":2,"character":4},"end":{"line":2,"character":7}},"selectionRange":{"start":{"line":2,"character":4},"end":{"line":2,"character":7}}},{"name":"\"3\"","detail":"\"3\" [4,5]","kind":13,"range":{"start":{"line":3,"character":4},"end":{"line":3,"character":7}},"selectionRange":{"start":{"line":3,"character":4},"end":{"line":3,"character":7}}},{"name":"\"4\"","detail":"\"4\" [5,5]","kind":13,"range":{"start":{"line":4,"character":4},"end":{"line":4,"character":7}},"selectionRange":{"start":{"line":4,"character":4},"end":{"line":4,"character":7}}},{"name":"\"5\"","detail":"\"5\" [6,5]","kind":13,"range":{"start":{"line":5,"character":4},"end":{"line":5,"character":7}},"selectionRange":{"start":{"line":5,"character":4},"end":{"line":5,"character":7}}},{"name":"\"1\"","detail":"\"1\" [7,9]","kind":13,"range":{"start":{"line":6,"character":8},"end":{"line":6,"character":11}},"selectionRange":{"start":{"line":6,"character":8},"end":{"line":6,"character":11}}},{"name":"\"2\"","detail":"\"2\" [8,9]","kind":13,"range":{"start":{"line":7,"character":8},"end":{"line":7,"character":11}},"selectionRange":{"start":{"line":7,"character":8},"end":{"line":7,"character":11}}},{"name":"\"6\"","detail":"\"6\" [10,5]","kind":13,"range":{"start":{"line":9,"character":4},"end":{"line":9,"character":7}},"selectionRange":{"start":{"line":9,"character":4},"end":{"line":9,"character":7}}}],"id":4}
34
= textDocument/semanticTokens => {"jsonrpc_version":"2.0","result":{"data":[1,4,3,0,0,2,4,3,0,0,3,4,3,0,0,4,4,3,0,0,5,4,3,0,0,6,8,3,0,0,7,8,3,0,0,9,4,3,0,0]},"id":5}
37
----- test/source/lsp/client/json/check-04.txt -----
39
o "test/source/lsp/client/json/json/check-01.json"
41
= textDocument/publishDiagnostics => {"jsonrpc_version":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"test/source/lsp/client/json/json/check-01.json","version":0,"diagnostics":[{"range":{"start":{"line":5,"character":4},"end":{"line":5,"character":7}},"severity":1,"source":"SIMODO/loom","message":"Member '2' is duplicated
Позиция разбора: test/source/lsp/client/json/json/check-01.json:6:5[6,8]"}]}}
42
= textDocument/documentSymbol => {"jsonrpc_version":"2.0","result":[{"name":"\"1\"","detail":"\"1\" [2,5]","kind":13,"range":{"start":{"line":1,"character":4},"end":{"line":1,"character":7}},"selectionRange":{"start":{"line":1,"character":4},"end":{"line":1,"character":7}}},{"name":"\"2\"","detail":"\"2\" [3,5]","kind":13,"range":{"start":{"line":2,"character":4},"end":{"line":2,"character":7}},"selectionRange":{"start":{"line":2,"character":4},"end":{"line":2,"character":7}}},{"name":"\"3\"","detail":"\"3\" [4,5]","kind":13,"range":{"start":{"line":3,"character":4},"end":{"line":3,"character":7}},"selectionRange":{"start":{"line":3,"character":4},"end":{"line":3,"character":7}}},{"name":"\"4\"","detail":"\"4\" [5,5]","kind":13,"range":{"start":{"line":4,"character":4},"end":{"line":4,"character":7}},"selectionRange":{"start":{"line":4,"character":4},"end":{"line":4,"character":7}}},{"name":"\"2\"","detail":"\"2\" [6,5]","kind":13,"range":{"start":{"line":5,"character":4},"end":{"line":5,"character":7}},"selectionRange":{"start":{"line":5,"character":4},"end":{"line":5,"character":7}}},{"name":"\"6\"","detail":"\"6\" [7,5]","kind":13,"range":{"start":{"line":6,"character":4},"end":{"line":6,"character":7}},"selectionRange":{"start":{"line":6,"character":4},"end":{"line":6,"character":7}}}],"id":2}
43
= textDocument/semanticTokens => {"jsonrpc_version":"2.0","result":{"data":[1,4,3,0,0,2,4,3,0,0,3,4,3,0,0,4,4,3,0,0,5,4,3,0,0,6,4,3,0,0]},"id":3}
46
=============================== Тесты языкового клиента (simodo) ===============================
48
----- test/source/lsp/client/simodo/script/check/00-blank/00.txt -----
55
----- test/source/lsp/client/simodo/script/check/01-open/01-blank.txt -----
57
o "test/source/lsp/client/simodo/script/examples/blank.simodo-script"
59
= textDocument/publishDiagnostics => {"jsonrpc_version":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"test/source/lsp/client/simodo/script/examples/blank.simodo-script","version":0,"diagnostics":[]}}
60
= textDocument/documentSymbol => {"jsonrpc_version":"2.0","result":[],"id":2}
61
= textDocument/semanticTokens => {"jsonrpc_version":"2.0","result":{"data":[]},"id":3}
64
----- test/source/lsp/client/simodo/script/check/01-open/02-bubble.txt -----
66
o "test/source/lsp/client/simodo/script/examples/bubble.simodo-script"
68
= textDocument/publishDiagnostics => {"jsonrpc_version":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"test/source/lsp/client/simodo/script/examples/bubble.simodo-script","version":0,"diagnostics":[]}}
69
= textDocument/documentSymbol => {"jsonrpc_version":"2.0","result":[{"name":"a","detail":"array : a","kind":13,"range":{"start":{"line":2,"character":11},"end":{"line":2,"character":12}},"selectionRange":{"start":{"line":2,"character":11},"end":{"line":2,"character":12}}}],"id":2}
70
= textDocument/semanticTokens => {"jsonrpc_version":"2.0","result":{"data":[2,0,3,11,0,2,4,4,10,1,2,11,1,0,2,4,0,5,11,0,4,6,1,0,1,6,0,3,11,0,6,4,3,10,1,6,10,1,0,2,6,12,2,11,0,6,15,5,10,1,7,4,3,11,0,7,8,3,10,1,7,14,1,0,2,7,16,2,11,0,7,19,5,10,1,7,25,1,0,1,8,8,2,11,0,8,11,1,0,1,8,13,1,0,1,8,18,1,0,1,8,20,1,0,1,9,12,3,11,0,9,16,4,10,1,9,23,1,0,2,9,27,1,0,1,9,29,1,0,1,10,12,1,0,1,10,14,1,0,1,10,19,1,0,1,10,21,1,0,1,11,12,1,0,1,11,14,1,0,1,11,19,1,0,1,14,0,5,11,0,14,6,1,0,1]},"id":3}
73
----- test/source/lsp/client/simodo/script/check/01-open/03-primes.txt -----
75
o "test/source/lsp/client/simodo/script/examples/bubble.simodo-script"
77
= textDocument/publishDiagnostics => {"jsonrpc_version":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"test/source/lsp/client/simodo/script/examples/bubble.simodo-script","version":0,"diagnostics":[]}}
78
= textDocument/documentSymbol => {"jsonrpc_version":"2.0","result":[{"name":"a","detail":"array : a","kind":13,"range":{"start":{"line":2,"character":11},"end":{"line":2,"character":12}},"selectionRange":{"start":{"line":2,"character":11},"end":{"line":2,"character":12}}}],"id":2}
79
= textDocument/semanticTokens => {"jsonrpc_version":"2.0","result":{"data":[2,0,3,11,0,2,4,4,10,1,2,11,1,0,2,4,0,5,11,0,4,6,1,0,1,6,0,3,11,0,6,4,3,10,1,6,10,1,0,2,6,12,2,11,0,6,15,5,10,1,7,4,3,11,0,7,8,3,10,1,7,14,1,0,2,7,16,2,11,0,7,19,5,10,1,7,25,1,0,1,8,8,2,11,0,8,11,1,0,1,8,13,1,0,1,8,18,1,0,1,8,20,1,0,1,9,12,3,11,0,9,16,4,10,1,9,23,1,0,2,9,27,1,0,1,9,29,1,0,1,10,12,1,0,1,10,14,1,0,1,10,19,1,0,1,10,21,1,0,1,11,12,1,0,1,11,14,1,0,1,11,19,1,0,1,14,0,5,11,0,14,6,1,0,1]},"id":3}
82
----- test/source/lsp/client/simodo/script/check/02-sf/01-bubble.txt -----
84
sf "test/source/lsp/client/simodo/script/examples/bubble.simodo-script"
88
----- test/source/lsp/client/simodo/script/check/03-hover/01-FunctionName-01.txt -----
90
o "test/source/lsp/client/simodo/script/examples/primes.simodo-script"
92
h "test/source/lsp/client/simodo/script/examples/primes.simodo-script" 6 10
94
= textDocument/publishDiagnostics => {"jsonrpc_version":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"test/source/lsp/client/simodo/script/examples/primes.simodo-script","version":0,"diagnostics":[]}}
95
= textDocument/documentSymbol => {"jsonrpc_version":"2.0","result":[{"name":"check_prime","detail":"fn check_prime (int : no) -> bool","kind":12,"range":{"start":{"line":6,"character":3},"end":{"line":13,"character":1}},"selectionRange":{"start":{"line":6,"character":3},"end":{"line":6,"character":14}}},{"name":"start","detail":"int : start = 1","kind":13,"range":{"start":{"line":15,"character":10},"end":{"line":15,"character":15}},"selectionRange":{"start":{"line":15,"character":10},"end":{"line":15,"character":15}}},{"name":"end","detail":"int : end = 1500","kind":13,"range":{"start":{"line":16,"character":10},"end":{"line":16,"character":13}},"selectionRange":{"start":{"line":16,"character":10},"end":{"line":16,"character":13}}}],"id":2}
96
= textDocument/semanticTokens => {"jsonrpc_version":"2.0","result":{"data":[6,0,2,11,0,6,3,11,5,2,6,15,3,10,1,6,21,2,0,10,6,28,4,10,1,8,4,3,11,0,8,8,3,10,1,8,14,1,0,2,8,16,2,11,0,8,19,5,10,1,8,28,2,0,1,9,8,2,11,0,10,12,6,11,0,10,19,5,13,0,12,4,6,11,0,12,11,4,13,0,15,0,3,11,0,15,4,3,10,1,15,10,5,0,2,16,0,3,11,0,16,4,3,10,1,16,10,3,0,2,18,0,5,11,0,18,40,5,0,1,18,57,3,0,1,20,0,3,11,0,20,4,3,10,1,20,10,1,0,2,20,12,2,11,0,20,15,5,10,1,20,21,5,0,1,20,27,3,0,1,21,4,2,11,0,21,7,11,6,1,21,19,1,0,1,22,8,5,11,0,22,14,1,0,1]},"id":3}
97
= textDocument/hover => {"jsonrpc_version":"2.0","result":{"contents":{"kind":"plaintext","value":"fn check_prime (int : no) -> bool
#{initial_value:<null>, origin:"variable", property:true, tethered:true}"},"range":{"start":{"line":6,"character":3},"end":{"line":6,"character":14}}},"id":4}
100
----- test/source/lsp/client/simodo/script/check/03-hover/02-VariableUse-01.txt -----
102
o "test/source/lsp/client/simodo/script/examples/primes.simodo-script"
104
h "test/source/lsp/client/simodo/script/examples/primes.simodo-script" 18 42
106
= textDocument/publishDiagnostics => {"jsonrpc_version":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"test/source/lsp/client/simodo/script/examples/primes.simodo-script","version":0,"diagnostics":[]}}
107
= textDocument/documentSymbol => {"jsonrpc_version":"2.0","result":[{"name":"check_prime","detail":"fn check_prime (int : no) -> bool","kind":12,"range":{"start":{"line":6,"character":3},"end":{"line":13,"character":1}},"selectionRange":{"start":{"line":6,"character":3},"end":{"line":6,"character":14}}},{"name":"start","detail":"int : start = 1","kind":13,"range":{"start":{"line":15,"character":10},"end":{"line":15,"character":15}},"selectionRange":{"start":{"line":15,"character":10},"end":{"line":15,"character":15}}},{"name":"end","detail":"int : end = 1500","kind":13,"range":{"start":{"line":16,"character":10},"end":{"line":16,"character":13}},"selectionRange":{"start":{"line":16,"character":10},"end":{"line":16,"character":13}}}],"id":2}
108
= textDocument/semanticTokens => {"jsonrpc_version":"2.0","result":{"data":[6,0,2,11,0,6,3,11,5,2,6,15,3,10,1,6,21,2,0,10,6,28,4,10,1,8,4,3,11,0,8,8,3,10,1,8,14,1,0,2,8,16,2,11,0,8,19,5,10,1,8,28,2,0,1,9,8,2,11,0,10,12,6,11,0,10,19,5,13,0,12,4,6,11,0,12,11,4,13,0,15,0,3,11,0,15,4,3,10,1,15,10,5,0,2,16,0,3,11,0,16,4,3,10,1,16,10,3,0,2,18,0,5,11,0,18,40,5,0,1,18,57,3,0,1,20,0,3,11,0,20,4,3,10,1,20,10,1,0,2,20,12,2,11,0,20,15,5,10,1,20,21,5,0,1,20,27,3,0,1,21,4,2,11,0,21,7,11,6,1,21,19,1,0,1,22,8,5,11,0,22,14,1,0,1]},"id":3}
109
= textDocument/hover => {"jsonrpc_version":"2.0","result":{"contents":{"kind":"plaintext","value":"int : start = 1
#{initial_value:0, origin:"variable", property:true}"},"range":{"start":{"line":18,"character":40},"end":{"line":18,"character":45}}},"id":4}
112
----- test/source/lsp/client/simodo/script/check/03-hover/02-VariableUse-02.txt -----
114
o "test/source/lsp/client/simodo/script/examples/primes.simodo-script"
116
h "test/source/lsp/client/simodo/script/examples/primes.simodo-script" 20 24
118
= textDocument/publishDiagnostics => {"jsonrpc_version":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"test/source/lsp/client/simodo/script/examples/primes.simodo-script","version":0,"diagnostics":[]}}
119
= textDocument/documentSymbol => {"jsonrpc_version":"2.0","result":[{"name":"check_prime","detail":"fn check_prime (int : no) -> bool","kind":12,"range":{"start":{"line":6,"character":3},"end":{"line":13,"character":1}},"selectionRange":{"start":{"line":6,"character":3},"end":{"line":6,"character":14}}},{"name":"start","detail":"int : start = 1","kind":13,"range":{"start":{"line":15,"character":10},"end":{"line":15,"character":15}},"selectionRange":{"start":{"line":15,"character":10},"end":{"line":15,"character":15}}},{"name":"end","detail":"int : end = 1500","kind":13,"range":{"start":{"line":16,"character":10},"end":{"line":16,"character":13}},"selectionRange":{"start":{"line":16,"character":10},"end":{"line":16,"character":13}}}],"id":2}
120
= textDocument/semanticTokens => {"jsonrpc_version":"2.0","result":{"data":[6,0,2,11,0,6,3,11,5,2,6,15,3,10,1,6,21,2,0,10,6,28,4,10,1,8,4,3,11,0,8,8,3,10,1,8,14,1,0,2,8,16,2,11,0,8,19,5,10,1,8,28,2,0,1,9,8,2,11,0,10,12,6,11,0,10,19,5,13,0,12,4,6,11,0,12,11,4,13,0,15,0,3,11,0,15,4,3,10,1,15,10,5,0,2,16,0,3,11,0,16,4,3,10,1,16,10,3,0,2,18,0,5,11,0,18,40,5,0,1,18,57,3,0,1,20,0,3,11,0,20,4,3,10,1,20,10,1,0,2,20,12,2,11,0,20,15,5,10,1,20,21,5,0,1,20,27,3,0,1,21,4,2,11,0,21,7,11,6,1,21,19,1,0,1,22,8,5,11,0,22,14,1,0,1]},"id":3}
121
= textDocument/hover => {"jsonrpc_version":"2.0","result":{"contents":{"kind":"plaintext","value":"int : start = 1
#{initial_value:0, origin:"variable", property:true}"},"range":{"start":{"line":20,"character":21},"end":{"line":20,"character":26}}},"id":4}
124
----- test/source/lsp/client/simodo/script/check/03-hover/03-VariableDeclare-01.txt -----
126
o "test/source/lsp/client/simodo/script/examples/primes.simodo-script"
128
h "test/source/lsp/client/simodo/script/examples/primes.simodo-script" 15 12
130
= textDocument/publishDiagnostics => {"jsonrpc_version":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"test/source/lsp/client/simodo/script/examples/primes.simodo-script","version":0,"diagnostics":[]}}
131
= textDocument/documentSymbol => {"jsonrpc_version":"2.0","result":[{"name":"check_prime","detail":"fn check_prime (int : no) -> bool","kind":12,"range":{"start":{"line":6,"character":3},"end":{"line":13,"character":1}},"selectionRange":{"start":{"line":6,"character":3},"end":{"line":6,"character":14}}},{"name":"start","detail":"int : start = 1","kind":13,"range":{"start":{"line":15,"character":10},"end":{"line":15,"character":15}},"selectionRange":{"start":{"line":15,"character":10},"end":{"line":15,"character":15}}},{"name":"end","detail":"int : end = 1500","kind":13,"range":{"start":{"line":16,"character":10},"end":{"line":16,"character":13}},"selectionRange":{"start":{"line":16,"character":10},"end":{"line":16,"character":13}}}],"id":2}
132
= textDocument/semanticTokens => {"jsonrpc_version":"2.0","result":{"data":[6,0,2,11,0,6,3,11,5,2,6,15,3,10,1,6,21,2,0,10,6,28,4,10,1,8,4,3,11,0,8,8,3,10,1,8,14,1,0,2,8,16,2,11,0,8,19,5,10,1,8,28,2,0,1,9,8,2,11,0,10,12,6,11,0,10,19,5,13,0,12,4,6,11,0,12,11,4,13,0,15,0,3,11,0,15,4,3,10,1,15,10,5,0,2,16,0,3,11,0,16,4,3,10,1,16,10,3,0,2,18,0,5,11,0,18,40,5,0,1,18,57,3,0,1,20,0,3,11,0,20,4,3,10,1,20,10,1,0,2,20,12,2,11,0,20,15,5,10,1,20,21,5,0,1,20,27,3,0,1,21,4,2,11,0,21,7,11,6,1,21,19,1,0,1,22,8,5,11,0,22,14,1,0,1]},"id":3}
133
= textDocument/hover => {"jsonrpc_version":"2.0","result":{"contents":{"kind":"plaintext","value":"int : start = 1
#{initial_value:0, origin:"variable", property:true}"},"range":{"start":{"line":15,"character":10},"end":{"line":15,"character":15}}},"id":4}
136
----- test/source/lsp/client/simodo/script/check/04-goto/01-VariableUse-01.txt -----
138
o "test/source/lsp/client/simodo/script/examples/primes.simodo-script"
140
go "test/source/lsp/client/simodo/script/examples/primes.simodo-script" 18 42
142
= textDocument/publishDiagnostics => {"jsonrpc_version":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"test/source/lsp/client/simodo/script/examples/primes.simodo-script","version":0,"diagnostics":[]}}
143
= textDocument/documentSymbol => {"jsonrpc_version":"2.0","result":[{"name":"check_prime","detail":"fn check_prime (int : no) -> bool","kind":12,"range":{"start":{"line":6,"character":3},"end":{"line":13,"character":1}},"selectionRange":{"start":{"line":6,"character":3},"end":{"line":6,"character":14}}},{"name":"start","detail":"int : start = 1","kind":13,"range":{"start":{"line":15,"character":10},"end":{"line":15,"character":15}},"selectionRange":{"start":{"line":15,"character":10},"end":{"line":15,"character":15}}},{"name":"end","detail":"int : end = 1500","kind":13,"range":{"start":{"line":16,"character":10},"end":{"line":16,"character":13}},"selectionRange":{"start":{"line":16,"character":10},"end":{"line":16,"character":13}}}],"id":2}
144
= textDocument/semanticTokens => {"jsonrpc_version":"2.0","result":{"data":[6,0,2,11,0,6,3,11,5,2,6,15,3,10,1,6,21,2,0,10,6,28,4,10,1,8,4,3,11,0,8,8,3,10,1,8,14,1,0,2,8,16,2,11,0,8,19,5,10,1,8,28,2,0,1,9,8,2,11,0,10,12,6,11,0,10,19,5,13,0,12,4,6,11,0,12,11,4,13,0,15,0,3,11,0,15,4,3,10,1,15,10,5,0,2,16,0,3,11,0,16,4,3,10,1,16,10,3,0,2,18,0,5,11,0,18,40,5,0,1,18,57,3,0,1,20,0,3,11,0,20,4,3,10,1,20,10,1,0,2,20,12,2,11,0,20,15,5,10,1,20,21,5,0,1,20,27,3,0,1,21,4,2,11,0,21,7,11,6,1,21,19,1,0,1,22,8,5,11,0,22,14,1,0,1]},"id":3}
145
= textDocument/definition => {"jsonrpc_version":"2.0","result":{"uri":"test/source/lsp/client/simodo/script/examples/primes.simodo-script","range":{"start":{"line":15,"character":10},"end":{"line":15,"character":15}}},"id":4}