🧪 test: add LSP json fixtures and provider suite
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"method": "$/cancelRequest",
|
||||
"params": {
|
||||
"id": "nonexistent"
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": 1,
|
||||
"id": 2,
|
||||
"method": "textDocument/completion",
|
||||
"params": {
|
||||
"textDocument": {
|
||||
"uri": "file:///home/cobia/test_lsp/1.tsl"
|
||||
"uri": "{{MAIN_UNIT_URI}}"
|
||||
},
|
||||
"position": {
|
||||
"line": 2,
|
||||
"character": 5
|
||||
"line": 0,
|
||||
"character": 0
|
||||
},
|
||||
"context": {
|
||||
"triggerKind": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": 3,
|
||||
"method": "completionItem/resolve",
|
||||
"params": {
|
||||
"label": "Widget",
|
||||
"data": {
|
||||
"ctx": "new",
|
||||
"class": "Widget",
|
||||
"unit": "MainUnit",
|
||||
"uri": "{{MAIN_UNIT_URI}}"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": 4,
|
||||
"method": "textDocument/definition",
|
||||
"params": {
|
||||
"textDocument": {
|
||||
"uri": "{{MAIN_UNIT_URI}}"
|
||||
},
|
||||
"position": {
|
||||
"line": 72,
|
||||
"character": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,24 +3,24 @@
|
||||
"method": "textDocument/didChange",
|
||||
"params": {
|
||||
"textDocument": {
|
||||
"uri": "file:///home/cobia/test_lsp/1.tsl",
|
||||
"version": 4
|
||||
"uri": "{{MAIN_UNIT_URI}}",
|
||||
"version": 2
|
||||
},
|
||||
"contentChanges": [
|
||||
{
|
||||
"range": {
|
||||
"start": {
|
||||
"line": 2,
|
||||
"character": 4
|
||||
"line": 0,
|
||||
"character": 0
|
||||
},
|
||||
"end": {
|
||||
"line": 2,
|
||||
"character": 4
|
||||
"line": 0,
|
||||
"character": 0
|
||||
}
|
||||
},
|
||||
"rangeLength": 0,
|
||||
"text": "e"
|
||||
"text": " "
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"method": "textDocument/didClose",
|
||||
"params": {
|
||||
"textDocument": {
|
||||
"uri": "{{MAIN_UNIT_URI}}"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"method": "textDocument/didOpen",
|
||||
"params": {
|
||||
"textDocument": {
|
||||
"uri": "{{MAIN_UNIT_URI}}",
|
||||
"languageId": "tsl",
|
||||
"version": 1,
|
||||
"text": {{MAIN_UNIT_TEXT}}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,10 +3,10 @@
|
||||
"method": "textDocument/didOpen",
|
||||
"params": {
|
||||
"textDocument": {
|
||||
"uri": "file:///home/cobia/test_lsp/1.tsl",
|
||||
"uri": "{{MAIN_UNIT_URI}}",
|
||||
"languageId": "tsl",
|
||||
"version": 1,
|
||||
"text": "function aaa();\nbegin\nend;"
|
||||
"text": {{MAIN_UNIT_TEXT}}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"method": "exit"
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": 0,
|
||||
"id": 1,
|
||||
"method": "initialize",
|
||||
"params": {
|
||||
"processId": 61310,
|
||||
@@ -9,8 +9,8 @@
|
||||
"version": "1.102.0"
|
||||
},
|
||||
"locale": "en",
|
||||
"rootPath": "/home/cobia/test_lsp",
|
||||
"rootUri": "file:///home/cobia/test_lsp",
|
||||
"rootPath": "{{WORKSPACE_PATH}}",
|
||||
"rootUri": "{{WORKSPACE_URI}}",
|
||||
"capabilities": {
|
||||
"workspace": {
|
||||
"applyEdit": true,
|
||||
@@ -479,7 +479,7 @@
|
||||
"trace": "off",
|
||||
"workspaceFolders": [
|
||||
{
|
||||
"uri": "file:///home/cobia/test_lsp",
|
||||
"uri": "{{WORKSPACE_URI}}",
|
||||
"name": "test_lsp"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"method": "initialized",
|
||||
"params": {}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": 6,
|
||||
"method": "textDocument/references",
|
||||
"params": {
|
||||
"textDocument": {
|
||||
"uri": "{{RENAME_CASE_URI}}"
|
||||
},
|
||||
"position": {
|
||||
"line": 1,
|
||||
"character": 0
|
||||
},
|
||||
"context": {
|
||||
"includeDeclaration": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": 5,
|
||||
"method": "textDocument/rename",
|
||||
"params": {
|
||||
"textDocument": {
|
||||
"uri": "{{RENAME_CASE_URI}}"
|
||||
},
|
||||
"position": {
|
||||
"line": 1,
|
||||
"character": 0
|
||||
},
|
||||
"newName": "renamed"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
initialize.json
|
||||
initialized.json
|
||||
setTrace.json
|
||||
didOpen.json
|
||||
completion.json
|
||||
completion_resolve.json
|
||||
definition.json
|
||||
rename.json
|
||||
references.json
|
||||
didChange.json
|
||||
cancelRequest.json
|
||||
didClose.json
|
||||
shutdown.json
|
||||
exit.json
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"method": "$/setTrace",
|
||||
"params": {
|
||||
"value": "verbose"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": 7,
|
||||
"method": "shutdown"
|
||||
}
|
||||
Reference in New Issue
Block a user