roots
{ "capabilities": { "roots": { "listChanged": true } } }
listChanged
roots/list
{ "jsonrpc": "2.0", "id": 1, "method": "roots/list" }
{ "jsonrpc": "2.0", "id": 1, "result": { "roots": [ { "uri": "file:///home/user/projects/myproject", "name": "My Project" } ] } }
{ "jsonrpc": "2.0", "method": "notifications/roots/list_changed" }
uri
file://
name
{ "uri": "file:///home/user/projects/myproject", "name": "My Project" }
[ { "uri": "file:///home/user/repos/frontend", "name": "Frontend Repository" }, { "uri": "file:///home/user/repos/backend", "name": "Backend Repository" } ]
-32601
-32603
{ "jsonrpc": "2.0", "id": 1, "error": { "code": -32601, "message": "Roots not supported", "data": { "reason": "Client does not have roots capability" } } }
此页面有帮助吗?