Clean up the redundant hints code and config

This commit is contained in:
Kirill Bulatov 2022-02-12 01:03:32 +02:00 committed by Laurențiu Nicola
parent 0b69717ab6
commit 9c0c199e96
3 changed files with 9 additions and 91 deletions

View file

@ -414,11 +414,11 @@ pub(crate) fn inlay_hint(line_index: &LineIndex, inlay_hint: InlayHint) -> lsp_e
lsp_ext::InlayHint {
label: inlay_hint.label.to_string(),
position: position(line_index, inlay_hint.range.end()),
kind: Some(match inlay_hint.kind {
InlayKind::ParameterHint => lsp_ext::InlayHintKind::PARAMETER,
InlayKind::TypeHint => lsp_ext::InlayHintKind::TYPE,
InlayKind::ChainingHint => lsp_ext::InlayHintKind::TYPE,
}),
kind: match inlay_hint.kind {
InlayKind::ParameterHint => Some(lsp_ext::InlayHintKind::PARAMETER),
InlayKind::TypeHint => Some(lsp_ext::InlayHintKind::TYPE),
InlayKind::ChainingHint => None,
},
tooltip: Some("test description".to_string()),
padding_left: Some(true),
padding_right: Some(true),

View file

@ -23,9 +23,7 @@
"engines": {
"vscode": "^1.64.0"
},
"enabledApiProposals": [
"inlayHints"
],
"enabledApiProposals": [],
"scripts": {
"vscode:prepublish": "npm run build-base -- --minify",
"package": "vsce package -o rust-analyzer.vsix",
@ -35,8 +33,7 @@
"lint": "tsfmt --verify && eslint -c .eslintrc.js --ext ts ./src ./tests",
"fix": " tsfmt -r && eslint -c .eslintrc.js --ext ts ./src ./tests --fix",
"pretest": "tsc && npm run build",
"test": "node ./out/tests/runTests.js",
"postinstall": "vscode-dts dev"
"test": "node ./out/tests/runTests.js"
},
"dependencies": {
"vscode-languageclient": "8.0.0-next.12",
@ -54,8 +51,7 @@
"tslib": "^2.3.0",
"typescript": "^4.5.5",
"typescript-formatter": "^7.2.2",
"vsce": "^2.6.7",
"vscode-dts": "^0.3.3"
"vsce": "^2.6.7"
},
"activationEvents": [
"onLanguage:rust",
@ -302,11 +298,6 @@
"default": true,
"description": "Whether to show inlay hints."
},
"rust-analyzer.inlayHints.smallerHints": {
"type": "boolean",
"default": true,
"description": "Whether inlay hints font size should be smaller than editor's font size."
},
"rust-analyzer.server.path": {
"type": [
"null",
@ -1087,78 +1078,6 @@
}
],
"colors": [
{
"id": "rust_analyzer.inlayHints.foreground",
"description": "Foreground color of inlay hints (is overriden by more specific rust_analyzer.inlayHints.foreground.* configurations)",
"defaults": {
"dark": "#A0A0A0F0",
"light": "#747474",
"highContrast": "#BEBEBE"
}
},
{
"id": "rust_analyzer.inlayHints.background",
"description": "Background color of inlay hints (is overriden by more specific rust_analyzer.inlayHints.background.* configurations)",
"defaults": {
"dark": "#11223300",
"light": "#11223300",
"highContrast": "#11223300"
}
},
{
"id": "rust_analyzer.inlayHints.foreground.typeHints",
"description": "Foreground color of inlay type hints for variables (overrides rust_analyzer.inlayHints.foreground)",
"defaults": {
"dark": "rust_analyzer.inlayHints.foreground",
"light": "rust_analyzer.inlayHints.foreground",
"highContrast": "rust_analyzer.inlayHints.foreground"
}
},
{
"id": "rust_analyzer.inlayHints.foreground.chainingHints",
"description": "Foreground color of inlay type hints for method chains (overrides rust_analyzer.inlayHints.foreground)",
"defaults": {
"dark": "rust_analyzer.inlayHints.foreground",
"light": "rust_analyzer.inlayHints.foreground",
"highContrast": "rust_analyzer.inlayHints.foreground"
}
},
{
"id": "rust_analyzer.inlayHints.foreground.parameterHints",
"description": "Foreground color of function parameter name inlay hints at the call site (overrides rust_analyzer.inlayHints.foreground)",
"defaults": {
"dark": "rust_analyzer.inlayHints.foreground",
"light": "rust_analyzer.inlayHints.foreground",
"highContrast": "rust_analyzer.inlayHints.foreground"
}
},
{
"id": "rust_analyzer.inlayHints.background.typeHints",
"description": "Background color of inlay type hints for variables (overrides rust_analyzer.inlayHints.background)",
"defaults": {
"dark": "rust_analyzer.inlayHints.background",
"light": "rust_analyzer.inlayHints.background",
"highContrast": "rust_analyzer.inlayHints.background"
}
},
{
"id": "rust_analyzer.inlayHints.background.chainingHints",
"description": "Background color of inlay type hints for method chains (overrides rust_analyzer.inlayHints.background)",
"defaults": {
"dark": "rust_analyzer.inlayHints.background",
"light": "rust_analyzer.inlayHints.background",
"highContrast": "rust_analyzer.inlayHints.background"
}
},
{
"id": "rust_analyzer.inlayHints.background.parameterHints",
"description": "Background color of function parameter name inlay hints at the call site (overrides rust_analyzer.inlayHints.background)",
"defaults": {
"dark": "rust_analyzer.inlayHints.background",
"light": "rust_analyzer.inlayHints.background",
"highContrast": "rust_analyzer.inlayHints.background"
}
},
{
"id": "rust_analyzer.syntaxTreeBorder",
"description": "Color of the border displayed in the Rust source code for the selected syntax node (see \"Show Syntax Tree\" command)",

View file

@ -22,7 +22,6 @@
],
"include": [
"src",
"tests",
"vscode.proposed.inlayHints.d.ts"
"tests"
]
}