[mod] re-org

This commit is contained in:
Andy Bunce 2025-08-06 14:57:52 +01:00
parent 198bd66c09
commit 784010fbdc
32 changed files with 114 additions and 14 deletions

25
docs/protocol.md Normal file
View file

@ -0,0 +1,25 @@
lsp websocket messages
```json
{"jsonrpc":"2.0","id":0,
"method":"initialize",
"params":{"capabilities":{"textDocument":{"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"synchronization":{"dynamicRegistration":true,"willSave":false,"didSave":false,"willSaveWaitUntil":false},"formatting":{"dynamicRegistration":true},"completion":{"dynamicRegistration":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":false,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":false,"preselectSupport":false},"contextSupport":false},"signatureHelp":{"signatureInformation":{"documentationFormat":["markdown","plaintext"],"activeParameterSupport":true}},"documentHighlight":{"dynamicRegistration":true},"semanticTokens":{"multilineTokenSupport":false,"overlappingTokenSupport":false,"tokenTypes":[],"tokenModifiers":[],"formats":["relative"],"requests":{"full":{"delta":false},"range":true},"augmentsSyntaxTokens":true}},"workspace":{"didChangeConfiguration":{"dynamicRegistration":true}}},"processId":null,"rootUri":"","workspaceFolders":null}
}
```
<=
{"jsonrpc":"2.0","id":0,
"result":{"capabilities":{"textDocumentSync":2,"completionProvider":{"resolveProvider":false,"triggerCharacters":["\"",":"]},"hoverProvider":true,"documentSymbolProvider":true,"documentRangeFormattingProvider":false,"colorProvider":{},"foldingRangeProvider":true,"selectionRangeProvider":true,"documentLinkProvider":{}}}
}
{"jsonrpc":"2.0","method":"initialized","params":{}}
{"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{}}}
<=
{"jsonrpc":"2.0",
"method":"textDocument/publishDiagnostics",
"params":{"uri":"session1.json","diagnostics":[]}
}
<=
{"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"session1.json","diagnostics":[{"range":{"start":{"line":2,"character":7},"end":{"line":2,"character":16}},"message":"Expected comma","severity":1,"code":514,"source":"json"}]}}

View file

@ -0,0 +1,15 @@
{
"jsonrpc": "2.0",
"method": "textDocument/didChange",
"params": {
"textDocument": {
"uri": "file:///some/file.xml",
"version": 1
},
"contentChanges": [
{
"text": "3+1f"
}
]
}
}

View file

@ -0,0 +1,25 @@
{
"jsonrpc": "2.0",
"method": "textDocument/didChange",
"params": {
"textDocument": {
"uri": "file:///some/file.xml",
"version": 2
},
"contentChanges": [
{
"range": {
"start": {
"line": 1,
"character": 4
},
"end": {
"line": 1,
"character": 4
}
},
"text": "d"
}
]
}
}

View file

@ -0,0 +1,12 @@
{
"jsonrpc": "2.0",
"method": "textDocument/didOpen",
"params": {
"textDocument": {
"uri": "file:///some/file.xml",
"languageId": "xml",
"text": "<foo at=42><bar>test</bar></foo>vvvbvbvbvbvbv\nvv\n\nvcccccccccccccc\n",
"version": 0
}
}
}

View file

@ -0,0 +1,14 @@
{
"jsonrpc": "2.0",
"id": 2,
"method": "textDocument/hover",
"params": {
"textDocument": {
"uri": "file:///session1.json"
},
"position": {
"line": 2,
"character": 22
}
}
}

View file

@ -0,0 +1,68 @@
{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"processId": null,
"clientInfo": {
"name": "@codemirror/lsp-client"
},
"rootUri": null,
"capabilities": {
"general": {
"markdown": {
"parser": "marked"
}
},
"textDocument": {
"completion": {
"completionItem": {
"snippetSupport": true,
"documentationFormat": [
"plaintext",
"markdown"
],
"insertReplaceSupport": false
},
"completionList": {
"itemDefaults": [
"commitCharacters",
"editRange",
"insertTextFormat"
]
},
"completionItemKind": {
"valueSet": []
},
"contextSupport": true
},
"hover": {
"contentFormat": [
"markdown",
"plaintext"
]
},
"formatting": {},
"rename": {},
"signatureHelp": {
"contextSupport": true,
"signatureInformation": {
"documentationFormat": [
"markdown",
"plaintext"
],
"parameterInformation": {
"labelOffsetSupport": true
},
"activeParameterSupport": true
}
},
"definition": {},
"declaration": {},
"implementation": {},
"typeDefinition": {},
"references": {}
}
}
}
}

View file

@ -0,0 +1,32 @@
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"capabilities": {
"textDocumentSync": 2,
"completionProvider": {
"resolveProvider": false,
"triggerCharacters": [
"\"",
":"
],
"documentSelector": [
{
"language": "xquery"
}
]
},
"hoverProvider": true,
"documentSymbolProvider": true,
"documentRangeFormattingProvider": false,
"colorProvider": {},
"foldingRangeProvider": true,
"selectionRangeProvider": true,
"documentLinkProvider": {},
"serverInfo": {
"name": "My Custom Language Server",
"version": "1.0.0"
}
}
}
}

View file

@ -0,0 +1,5 @@
{
"jsonrpc": "2.0"
}

2
docs/sample.msg/test.xq Normal file
View file

@ -0,0 +1,2 @@
"hover/client.json"
=>json:doc({"format":"w3"})