Skip to content

Commit 4b7acf8

Browse files
committed
chore: Stabilize goto definition
1 parent 18a494d commit 4b7acf8

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ You can customize the Roughly extension in VS Code through the following setting
134134
// Pass custom arguments; defaults to ["server"]
135135
"roughly.args": ["server", "--verbose"],
136136
// Enable experimental features
137-
"roughly.experimentalFeatures": ["goto_definition", "range_formatting"],
137+
"roughly.experimentalFeatures": ["rename", "range_formatting"],
138138
}
139139
```
140140

@@ -177,7 +177,6 @@ Roughly includes several experimental features that can be enabled in the VS Cod
177177
| Name | Description |
178178
| ------------------ | -------------------------------- |
179179
| `all` | Enable all experimental features |
180-
| `goto_definition` | Jump to symbol definitions |
181180
| `goto_references` | Find all references to a symbol |
182181
| `range_formatting` | Format selected code ranges |
183182
| `rename` | Rename symbols |

crates/roughly/src/cli.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -488,19 +488,22 @@ pub fn parse_experimental_flags(flags: &[impl AsRef<str>]) -> ExperimentalFeatur
488488
for flag in flags.iter().flat_map(|flag| flag.as_ref().split(' ')) {
489489
match flag {
490490
"all" => {
491-
features.goto_definition = true;
492491
features.goto_references = true;
493492
features.range_formatting = true;
494493
features.rename = true;
495494
features.unused = true;
496495
}
497-
"goto_definition" => features.goto_definition = true,
498496
"goto_references" => features.goto_references = true,
499497
"range_formatting" => features.range_formatting = true,
500498
"rename" => features.rename = true,
501499
"unused" => features.unused = true,
500+
"goto_definition" => {
501+
warn(&format!(
502+
"The '{flag}' flag has been stabilized. You can remove it."
503+
));
504+
}
502505
unknown => {
503-
warn(&format!("unknown experimental feature: {unknown}"));
506+
warn(&format!("unknown experimental feature: '{unknown}'"));
504507
}
505508
}
506509
}

crates/roughly/src/config.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ impl ConfigToml {
9090

9191
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)]
9292
pub struct ExperimentalFeatures {
93-
pub goto_definition: bool,
9493
pub goto_references: bool,
9594
pub range_formatting: bool,
9695
pub rename: bool,

crates/roughly/src/server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ impl LanguageServer for ServerState {
149149
trigger_characters: Some(vec!["$".into(), "@".into(), ":".into()]),
150150
..Default::default()
151151
}),
152-
definition_provider: Some(OneOf::Left(self.experimental_features.goto_definition)),
152+
definition_provider: Some(OneOf::Left(true)),
153153
document_formatting_provider: Some(OneOf::Left(true)),
154154
document_range_formatting_provider: Some(OneOf::Left(
155155
self.experimental_features.range_formatting,

docs/src/content/docs/language-server.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ You can customize the Roughly extension in VS Code through the following setting
105105
// Pass custom arguments; defaults to ["server"]
106106
"roughly.args": ["server", "--verbose"],
107107
// Enable experimental features
108-
"roughly.experimentalFeatures": ["goto_definition", "range_formatting"],
108+
"roughly.experimentalFeatures": ["rename", "range_formatting"],
109109
}
110110
```
111111

editors/code/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Roughly aims to support the following language server features (some are experim
1717
- Index global variables, S4 and R6 classes/methods
1818
- Search current document - <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>O</kbd> *in VS Code*
1919
- Search global workspace - <kbd>Ctrl</kbd> + <kbd>T</kbd> *in VS Code*
20-
- Go to definition *(🧪 experimental)*
20+
- Go to definition
2121
- Find all references *(🧪 experimental)*
2222

2323
- **Diagnostics**
@@ -50,7 +50,7 @@ You can customize the Roughly extension in VS Code through the following setting
5050
// Pass custom arguments; defaults to ["server"]
5151
"roughly.args": ["server", "--verbose"],
5252
// Enable experimental features
53-
"roughly.experimentalFeatures": ["goto_definition", "range_formatting"],
53+
"roughly.experimentalFeatures": ["rename", "range_formatting"],
5454
}
5555
```
5656

0 commit comments

Comments
 (0)