X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=editors%2Fcode%2Fpackage.json;h=9ab57d7dc5f387246fd5022329c09476321dddd9;hb=47fad0ed7328f1a39defe9b0e857fec7e042d6ae;hp=4b6e5ef33328fca19b10c1844ad65adfe61661e2;hpb=b7afb6fc6ce6c94379c57d3bb64fea2a2064eeac;p=rust.git diff --git a/editors/code/package.json b/editors/code/package.json index 4b6e5ef3332..9ab57d7dc5f 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -21,7 +21,7 @@ "Programming Languages" ], "engines": { - "vscode": "^1.61.0" + "vscode": "^1.63.0" }, "enableProposedApi": true, "scripts": { @@ -44,7 +44,7 @@ }, "devDependencies": { "@types/node": "~14.17.5", - "@types/vscode": "^1.61.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", @@ -592,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": {