Start LSP 3.17 support

This commit is contained in:
Jeremy Kolb 2021-02-13 13:54:39 -05:00
parent 425c56aa52
commit 8105418b25
7 changed files with 28 additions and 33 deletions

11
Cargo.lock generated
View File

@ -98,12 +98,6 @@ dependencies = [
"rustc-demangle",
]
[[package]]
name = "base64"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff"
[[package]]
name = "base_db"
version = "0.0.0"
@ -840,11 +834,10 @@ dependencies = [
[[package]]
name = "lsp-types"
version = "0.86.0"
version = "0.87.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2a5c40d566f2704dac30859bca152217583fc94fd5b178d8baba915e1abd382"
checksum = "05ee10a6da8f7ca2eb2881258d23ef3576da85cbd19b314da8e9028eb68eedf0"
dependencies = [
"base64",
"bitflags",
"serde",
"serde_json",

View File

@ -22,7 +22,7 @@ env_logger = { version = "0.8.1", default-features = false }
itertools = "0.10.0"
jod-thread = "0.1.0"
log = "0.4.8"
lsp-types = { version = "0.86.0", features = ["proposed"] }
lsp-types = { version = "0.87.0", features = ["proposed"] }
parking_lot = "0.11.0"
pico-args = "0.4.0"
oorandom = "11.1.2"

View File

@ -127,6 +127,7 @@ fn run_server() -> Result<()> {
name: String::from("rust-analyzer"),
version: Some(String::from(env!("REV"))),
}),
offset_encoding: None,
};
let initialize_result = serde_json::to_value(initialize_result).unwrap();

View File

@ -34,6 +34,8 @@ pub fn server_capabilities(client_caps: &ClientCapabilities) -> ServerCapabiliti
completion_provider: Some(CompletionOptions {
resolve_provider: completions_resolve_provider(client_caps),
trigger_characters: Some(vec![":".to_string(), ".".to_string()]),
all_commit_characters: None,
completion_item: None,
work_done_progress_options: WorkDoneProgressOptions { work_done_progress: None },
}),
signature_help_provider: Some(SignatureHelpOptions {
@ -58,7 +60,6 @@ pub fn server_capabilities(client_caps: &ClientCapabilities) -> ServerCapabiliti
more_trigger_character: Some(vec![".".to_string(), ">".to_string()]),
}),
selection_range_provider: Some(SelectionRangeProviderCapability::Simple(true)),
semantic_highlighting: None,
folding_range_provider: Some(FoldingRangeProviderCapability::Simple(true)),
rename_provider: Some(OneOf::Right(RenameOptions {
prepare_provider: Some(true),

View File

@ -195,9 +195,9 @@
}
},
"@types/vscode": {
"version": "1.52.0",
"resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.52.0.tgz",
"integrity": "sha512-Kt3bvWzAvvF/WH9YEcrCICDp0Z7aHhJGhLJ1BxeyNP6yRjonWqWnAIh35/pXAjswAnWOABrYlF7SwXR9+1nnLA==",
"version": "1.53.0",
"resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.53.0.tgz",
"integrity": "sha512-XjFWbSPOM0EKIT2XhhYm3D3cx3nn3lshMUcWNy1eqefk+oqRuBq8unVb6BYIZqXy9lQZyeUl7eaBCOZWv+LcXQ==",
"dev": true
},
"@typescript-eslint/eslint-plugin": {
@ -2364,33 +2364,33 @@
}
},
"vscode-jsonrpc": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0.tgz",
"integrity": "sha512-wnJA4BnEjOSyFMvjZdpiOwhSq9uDoK8e/kpRJDTaMYzwlkrhG1fwDIZI94CLsLzlCK5cIbMMtFlJlfR57Lavmg=="
"version": "6.1.0-next.1",
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.1.0-next.1.tgz",
"integrity": "sha512-2s1qEg8N97p8pooHnA8xgR4vnslCTJuE3rQqSQeJuSDklFcQSn9yW8gOinH/1vKeWiPuzHTG9FFty91v4v9Pag=="
},
"vscode-languageclient": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-7.0.0.tgz",
"integrity": "sha512-P9AXdAPlsCgslpP9pRxYPqkNYV7Xq8300/aZDpO35j1fJm/ncize8iGswzYlcvFw5DQUx4eVk+KvfXdL0rehNg==",
"version": "7.1.0-next.1",
"resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-7.1.0-next.1.tgz",
"integrity": "sha512-pMdMyJ5e3CfdyvtDsj6ytTO+WcmrvtrFJWvBk4rZnIKmA3aCjrqTYI0XSWN/Cf4kcaV1J2+fTZf/2RcP2SzDiQ==",
"requires": {
"minimatch": "^3.0.4",
"semver": "^7.3.4",
"vscode-languageserver-protocol": "3.16.0"
"vscode-languageserver-protocol": "3.17.0-next.1"
}
},
"vscode-languageserver-protocol": {
"version": "3.16.0",
"resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0.tgz",
"integrity": "sha512-sdeUoAawceQdgIfTI+sdcwkiK2KU+2cbEYA0agzM2uqaUy2UpnnGHtWTHVEtS0ES4zHU0eMFRGN+oQgDxlD66A==",
"version": "3.17.0-next.1",
"resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.0-next.1.tgz",
"integrity": "sha512-cbFKGk+Q7HQ5RDdf6qiQrRv9qxR/87hBm/GrfLcQ5rmHPJOXg//ZYCXEQF+wSJNmcc6IrnET2cHJUxlZYHUEXA==",
"requires": {
"vscode-jsonrpc": "6.0.0",
"vscode-languageserver-types": "3.16.0"
"vscode-jsonrpc": "6.1.0-next.1",
"vscode-languageserver-types": "3.17.0-next.1"
}
},
"vscode-languageserver-types": {
"version": "3.16.0",
"resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz",
"integrity": "sha512-k8luDIWJWyenLc5ToFQQMaSrqCHiLwyKPHKPQZ5zz21vM+vIVUSvsRpcbiECH4WR88K2XZqc4ScRcZ7nk/jbeA=="
"version": "3.17.0-next.1",
"resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.0-next.1.tgz",
"integrity": "sha512-VGzh06oynbYa6JbTKUbxOEZN7CYEtWhN7DK5wfzUpeCJl8X8xZX39g2PVfpqXrIEduu7dcJgK007KgnX9tHNKA=="
},
"vscode-test": {
"version": "1.4.1",

View File

@ -21,7 +21,7 @@
"Programming Languages"
],
"engines": {
"vscode": "^1.52.0"
"vscode": "^1.53.0"
},
"enableProposedApi": true,
"scripts": {
@ -36,7 +36,7 @@
},
"dependencies": {
"node-fetch": "^2.6.1",
"vscode-languageclient": "7.0.0"
"vscode-languageclient": "^7.1.0-next.1"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^17.0.0",
@ -45,7 +45,7 @@
"@types/mocha": "^8.0.4",
"@types/node": "~12.12.6",
"@types/node-fetch": "^2.5.7",
"@types/vscode": "^1.52.0",
"@types/vscode": "^1.53.0",
"@typescript-eslint/eslint-plugin": "^4.9.0",
"@typescript-eslint/parser": "^4.9.0",
"eslint": "^7.15.0",

View File

@ -79,7 +79,7 @@ export function createClient(serverPath: string, cwd: string, extraEnv: Env): lc
return hover;
},
(error) => {
client.handleFailedRequest(lc.HoverRequest.type, error, null);
client.handleFailedRequest(lc.HoverRequest.type, token, error, null);
return Promise.resolve(null);
});
},