X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=editors%2Fcode%2Fpackage.json;h=9ab57d7dc5f387246fd5022329c09476321dddd9;hb=47fad0ed7328f1a39defe9b0e857fec7e042d6ae;hp=a5de30cfc0f5d80a6e01017f2953c53fef78f79c;hpb=8dd06ece20fb815be5e3b0f0586334d6ecb273c8;p=rust.git diff --git a/editors/code/package.json b/editors/code/package.json index a5de30cfc0f..9ab57d7dc5f 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -21,7 +21,7 @@ "Programming Languages" ], "engines": { - "vscode": "^1.57.0" + "vscode": "^1.63.0" }, "enableProposedApi": true, "scripts": { @@ -37,24 +37,23 @@ }, "dependencies": { "https-proxy-agent": "^5.0.0", - "node-fetch": "^2.6.1", + "node-fetch": "^3.0.3", "vscode-languageclient": "8.0.0-next.2", - "d3": "^7.1.0", + "d3": "^7.2.0", "d3-graphviz": "^4.0.0" }, "devDependencies": { "@types/node": "~14.17.5", - "@types/node-fetch": "^2.5.11", - "@types/vscode": "^1.57.0", - "@typescript-eslint/eslint-plugin": "^4.28.2", - "@typescript-eslint/parser": "^4.28.2", - "esbuild": "^0.12.19", - "eslint": "^7.30.0", + "@types/vscode": "~1.63.0", + "@typescript-eslint/eslint-plugin": "^5.5.0", + "@typescript-eslint/parser": "^5.5.0", + "@vscode/test-electron": "^1.6.2", + "esbuild": "^0.14.1", + "eslint": "^8.3.0", "tslib": "^2.3.0", - "typescript": "^4.3.5", + "typescript": "^4.5.2", "typescript-formatter": "^7.2.2", - "vsce": "^1.95.1", - "vscode-test": "^1.5.1" + "vsce": "^2.5.1" }, "activationEvents": [ "onLanguage:rust", @@ -172,6 +171,11 @@ "title": "Memory Usage (Clears Database)", "category": "Rust Analyzer" }, + { + "command": "rust-analyzer.shuffleCrateGraph", + "title": "Shuffle Crate Graph", + "category": "Rust Analyzer" + }, { "command": "rust-analyzer.reloadWorkspace", "title": "Reload workspace", @@ -588,7 +592,47 @@ }, "rust-analyzer.completion.snippets": { "markdownDescription": "Custom completion snippets.", - "default": {}, + "default": { + "Arc::new": { + "postfix": "arc", + "body": "Arc::new(${receiver})", + "requires": "std::sync::Arc", + "description": "Put the expression into an `Arc`", + "scope": "expr" + }, + "Rc::new": { + "postfix": "rc", + "body": "Rc::new(${receiver})", + "requires": "std::rc::Rc", + "description": "Put the expression into an `Rc`", + "scope": "expr" + }, + "Box::pin": { + "postfix": "pinbox", + "body": "Box::pin(${receiver})", + "requires": "std::boxed::Box", + "description": "Put the expression into a pinned `Box`", + "scope": "expr" + }, + "Ok": { + "postfix": "ok", + "body": "Ok(${receiver})", + "description": "Wrap the expression in a `Result::Ok`", + "scope": "expr" + }, + "Err": { + "postfix": "err", + "body": "Err(${receiver})", + "description": "Wrap the expression in a `Result::Err`", + "scope": "expr" + }, + "Some": { + "postfix": "some", + "body": "Some(${receiver})", + "description": "Wrap the expression in an `Option::Some`", + "scope": "expr" + } + }, "type": "object" }, "rust-analyzer.completion.postfix.enable": { @@ -1112,90 +1156,147 @@ } ], "semanticTokenTypes": [ + { + "id": "angle", + "description": "Style for < or >", + "superType": "punctuation" + }, + { + "id": "arithmetic", + "description": "Style for arithmetic operators", + "superType": "operator" + }, { "id": "attribute", "description": "Style for attributes" }, + { + "id": "attributeBracket", + "description": "Style for attribute invocation brackets, that is the `#[` and `]` tokens", + "superType": "punctuation" + }, + { + "id": "bitwise", + "description": "Style for bitwise operators", + "superType": "operator" + }, { "id": "boolean", "description": "Style for boolean literals", "superType": "keyword" }, + { + "id": "brace", + "description": "Style for { or }", + "superType": "punctuation" + }, + { + "id": "bracket", + "description": "Style for [ or ]", + "superType": "punctuation" + }, + { + "id": "builtinAttribute", + "description": "Style for builtin attributes", + "superType": "attribute" + }, { "id": "builtinType", "description": "Style for builtin types", "superType": "type" }, { - "id": "lifetime", - "description": "Style for lifetimes" + "id": "char", + "description": "Style for character literals", + "superType": "type" }, { - "id": "selfKeyword", - "description": "Style for the self keyword", - "superType": "keyword" + "id": "colon", + "description": "Style for :", + "superType": "punctuation" }, { - "id": "typeAlias", - "description": "Style for type aliases", - "superType": "type" + "id": "comma", + "description": "Style for ,", + "superType": "punctuation" }, { - "id": "union", - "description": "Style for C-style untagged unions", - "superType": "type" + "id": "comparison", + "description": "Style for comparison operators", + "superType": "operator" }, { - "id": "unresolvedReference", - "description": "Style for names which can not be resolved due to compilation errors" + "id": "constParameter", + "description": "Style for const generics" + }, + { + "id": "derive", + "description": "Style for derives", + "superType": "attribute" + }, + { + "id": "dot", + "description": "Style for .", + "superType": "punctuation" + }, + { + "id": "escapeSequence", + "description": "Style for char escapes in strings" }, { "id": "formatSpecifier", "description": "Style for {} placeholders in format strings" }, { - "id": "punctuation", - "description": "generic punctuation" + "id": "label", + "description": "Style for labels" }, { - "id": "parenthesis", - "description": "( or )", - "superType": "punctuation" + "id": "lifetime", + "description": "Style for lifetimes" }, { - "id": "bracket", - "description": "[ or ]", - "superType": "punctuation" + "id": "logical", + "description": "Style for logic operators", + "superType": "operator" }, { - "id": "brace", - "description": "{ or }", + "id": "operator", + "description": "Style for operators", "superType": "punctuation" }, { - "id": "angle", - "description": "< or >", + "id": "parenthesis", + "description": "Style for ( or )", "superType": "punctuation" }, { - "id": "comma", - "description": ",", - "superType": "punctuation" + "id": "punctuation", + "description": "Style for generic punctuation" }, { - "id": "colon", - "description": ":", - "superType": "punctuation" + "id": "selfKeyword", + "description": "Style for the self keyword", + "superType": "keyword" }, { "id": "semicolon", - "description": ";", + "description": "Style for ;", "superType": "punctuation" }, { - "id": "dot", - "description": ".", - "superType": "punctuation" + "id": "typeAlias", + "description": "Style for type aliases", + "superType": "type" + }, + { + "id": "union", + "description": "Style for C-style untagged unions", + "superType": "type" + }, + { + "id": "unresolvedReference", + "description": "Style for names which can not be resolved due to compilation errors" } ], "semanticTokenModifiers": [ @@ -1207,14 +1308,14 @@ "id": "attribute", "description": "Style for elements within attributes" }, - { - "id": "constant", - "description": "Style for compile-time constants" - }, { "id": "callable", "description": "Style for locals whose types implements one of the `Fn*` traits" }, + { + "id": "constant", + "description": "Style for compile-time constants" + }, { "id": "consuming", "description": "Style for locals that are being consumed when use in a function call" @@ -1224,8 +1325,8 @@ "description": "Style for control-flow related tokens, this includes the `?` operator" }, { - "id": "definition", - "description": "Style for mutable bindings" + "id": "crateRoot", + "description": "Style for names resolving to a crate root" }, { "id": "injected", @@ -1267,26 +1368,26 @@ "attribute": [ "meta.attribute.rust" ], - "function.attribute": [ - "entity.name.function.attribute.rust" - ], "boolean": [ "constant.language.boolean.rust" ], "builtinType": [ "support.type.primitive.rust" ], - "lifetime": [ - "storage.modifier.lifetime.rust" + "constParameter": [ + "constant.other.caps.rust" ], - "typeAlias": [ - "entity.name.type.typeAlias.rust" + "enum": [ + "entity.name.type.enum.rust" ], - "union": [ - "entity.name.type.union.rust" + "formatSpecifier": [ + "punctuation.section.embedded.rust" ], - "struct": [ - "entity.name.type.struct.rust" + "function": [ + "entity.name.function.rust" + ], + "interface": [ + "entity.name.type.trait.rust" ], "keyword": [ "keyword.other.rust" @@ -1294,12 +1395,27 @@ "keyword.controlFlow": [ "keyword.control.rust" ], + "lifetime": [ + "storage.modifier.lifetime.rust" + ], + "method": [ + "entity.name.function.rust" + ], + "struct": [ + "entity.name.type.struct.rust" + ], + "typeAlias": [ + "entity.name.type.declaration.rust" + ], + "union": [ + "entity.name.type.union.rust" + ], + "variable": [ + "variable.other.rust" + ], "variable.constant": [ "variable.other.constant.rust" ], - "formatSpecifier": [ - "punctuation.section.embedded.rust" - ], "*.mutable": [ "markup.underline" ]