Skip to content

Commit

Permalink
Merge branch 'master' into mdbook-yolo
Browse files Browse the repository at this point in the history
  • Loading branch information
joshrotenberg committed Nov 12, 2023
2 parents f160f31 + 92d9ca7 commit 0861100
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions crates/ide/src/expand_macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ pub struct ExpandedMacro {

// Feature: Expand Macro Recursively
//
// Shows the full macro expansion of the macro at current cursor.
// Shows the full macro expansion of the macro at the current caret position.
//
// | Editor | Action Name |
// |---------|-------------|
// | VS Code | **rust-analyzer: Expand macro recursively** |
//
// ![Expand Macro Recursively](/img/features/expand_macro_recursively.gif)
// ![Expand Macro Recursively](https://user-images.githubusercontent.com/48062697/113020648-b3973180-917a-11eb-84a9-ecb921293dc5.gif)
pub(crate) fn expand_macro(db: &RootDatabase, position: FilePosition) -> Option<ExpandedMacro> {
let sema = Semantics::new(db);
let file = sema.parse(position.file_id);
Expand Down
1 change: 1 addition & 0 deletions crates/load-cargo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ impl ProjectFolders {
let entry = {
let mut dirs = vfs::loader::Directories::default();
dirs.extensions.push("rs".into());
dirs.extensions.push("toml".into());
dirs.include.extend(root.include);
dirs.exclude.extend(root.exclude);
for excl in global_excludes {
Expand Down
5 changes: 3 additions & 2 deletions docs/dev/lsp-extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ export interface TextDocumentEdit {
}
```

When applying such code action or text edit, the editor should insert snippet, with tab stops and placeholder.
At the moment, rust-analyzer guarantees that only a single edit will have `InsertTextFormat.Snippet`.
When applying such code action or text edit, the editor should insert snippet, with tab stops and placeholders.
At the moment, rust-analyzer guarantees that only a single `TextDocumentEdit` will have edits which can be `InsertTextFormat.Snippet`.
Any additional `TextDocumentEdit`s will only have edits which are `InsertTextFormat.PlainText`.

### Example

Expand Down
2 changes: 1 addition & 1 deletion editors/code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
},
{
"command": "rust-analyzer.expandMacro",
"title": "Expand macro recursively",
"title": "Expand macro recursively at caret",
"category": "rust-analyzer"
},
{
Expand Down

0 comments on commit 0861100

Please sign in to comment.