Skip to content

Commit 00f4899

Browse files
committed
adoc to mdbook
adoc to mdbook ignore built book base manual, iconv/pandoc outputs (tmp) use top level .gitignore introduction put images here quickstart placeholder installation sections add troubleshooting configuration static docs, dynamic next security non cargo privacy editor features communication license remove links and old chapter move contributing to this guide contributing images local .gitignore intermediate files, no longer needed ignore generated files increase toc heading to include 3s move generated config docs to markdown disable playground play in rust sections move generated assist docs to markdown link from adoc to md relocate assist generated file move generated diagnostic docs to markdown move feature docs to markdown ignore generated, keep directory ignore generated remove old docs remove docs/user more ignore shenanigans fix lsp-extensions path again
1 parent 6ba2590 commit 00f4899

File tree

128 files changed

+1667
-2341
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+1667
-2341
lines changed

.gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ crates/*/target
77
*.log
88
*.iml
99
.vscode/settings.json
10-
generated_assists.adoc
11-
generated_features.adoc
12-
generated_diagnostic.adoc
1310
.DS_Store
1411
/out/
1512
/dump.lsif

crates/ide-assists/src/handlers/auto_import.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use crate::{AssistContext, AssistId, AssistKind, Assists, GroupLabel};
3838
// use super::AssistContext;
3939
// ```
4040
//
41-
// .Import Granularity
41+
// #### Import Granularity
4242
//
4343
// It is possible to configure how use-trees are merged with the `imports.granularity.group` setting.
4444
// It has the following configurations:
@@ -52,7 +52,7 @@ use crate::{AssistContext, AssistId, AssistKind, Assists, GroupLabel};
5252
//
5353
// In `VS Code` the configuration for this is `rust-analyzer.imports.granularity.group`.
5454
//
55-
// .Import Prefix
55+
// #### Import Prefix
5656
//
5757
// The style of imports in the same crate is configurable through the `imports.prefix` setting.
5858
// It has the following configurations:
@@ -66,7 +66,7 @@ use crate::{AssistContext, AssistId, AssistKind, Assists, GroupLabel};
6666
//
6767
// In `VS Code` the configuration for this is `rust-analyzer.imports.prefix`.
6868
//
69-
// image::https://user-images.githubusercontent.com/48062697/113020673-b85be580-917a-11eb-9022-59585f35d4f8.gif[]
69+
// ![Auto Import](/img/features/auto_import.gif)
7070

7171
// Assist: auto_import
7272
//

crates/ide-assists/src/tests/sourcegen.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ r#####"
5555
"sourcegen_assists_docs",
5656
assists.into_iter().map(|it| it.to_string()).collect::<Vec<_>>().join("\n\n"),
5757
);
58-
let dst = project_root().join("docs/user/generated_assists.adoc");
58+
let dst = project_root().join("docs/manual/generated/assists.md");
5959
fs::write(dst, contents).unwrap();
6060
}
6161
}
@@ -139,7 +139,7 @@ impl fmt::Display for Assist {
139139
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
140140
let _ = writeln!(
141141
f,
142-
"[discrete]\n=== `{}`
142+
"### {}\n\n
143143
**Source:** {}",
144144
self.id, self.location,
145145
);
@@ -150,13 +150,15 @@ impl fmt::Display for Assist {
150150
let _ = writeln!(
151151
f,
152152
"
153-
{}
153+
> {}
154+
155+
#### Before
154156
155-
.Before
156157
```rust
157158
{}```
158159
159-
.After
160+
#### After
161+
160162
```rust
161163
{}```",
162164
section.doc,

crates/ide-completion/src/completions/flyimport.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -83,27 +83,27 @@ use super::Completions;
8383
// NOTE: currently, if an assoc item comes from a trait that's not currently imported, and it also has an unresolved and/or partially-qualified path,
8484
// no imports will be proposed.
8585
//
86-
// .Fuzzy search details
86+
// #### Fuzzy search details
8787
//
8888
// To avoid an excessive amount of the results returned, completion input is checked for inclusion in the names only
8989
// (i.e. in `HashMap` in the `std::collections::HashMap` path).
9090
// For the same reasons, avoids searching for any path imports for inputs with their length less than 2 symbols
9191
// (but shows all associated items for any input length).
9292
//
93-
// .Import configuration
93+
// #### Import configuration
9494
//
9595
// It is possible to configure how use-trees are merged with the `imports.granularity.group` setting.
9696
// Mimics the corresponding behavior of the `Auto Import` feature.
9797
//
98-
// .LSP and performance implications
98+
// #### LSP and performance implications
9999
//
100100
// The feature is enabled only if the LSP client supports LSP protocol version 3.16+ and reports the `additionalTextEdits`
101101
// (case-sensitive) resolve client capability in its client capabilities.
102102
// This way the server is able to defer the costly computations, doing them for a selected completion item only.
103103
// For clients with no such support, all edits have to be calculated on the completion request, including the fuzzy search completion ones,
104104
// which might be slow ergo the feature is automatically disabled.
105105
//
106-
// .Feature toggle
106+
// #### Feature toggle
107107
//
108108
// The feature can be forcefully turned off in the settings with the `rust-analyzer.completion.autoimport.enable` flag.
109109
// Note that having this flag set to `true` does not guarantee that the feature is enabled: your client needs to have the corresponding

crates/ide-completion/src/completions/postfix/format_like.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// ** `logw` -> `log::warn!(...)`
1515
// ** `loge` -> `log::error!(...)`
1616
//
17-
// image::https://user-images.githubusercontent.com/48062697/113020656-b560f500-917a-11eb-87de-02991f61beb8.gif[]
17+
// ![Format String Completion](/img/features/format_string_completion.gif)
1818

1919
use ide_db::{
2020
syntax_helpers::format_string_exprs::{parse_format_exprs, with_placeholders},

crates/ide-completion/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ pub use crate::{
7272
//
7373
// There also snippet completions:
7474
//
75-
// .Expressions
75+
// #### Expressions
7676
// - `pd` -> `eprintln!(" = {:?}", );`
7777
// - `ppd` -> `eprintln!(" = {:#?}", );`
7878
//
79-
// .Items
79+
// #### Items
8080
// - `tfn` -> `#[test] fn feature(){}`
8181
// - `tmod` ->
8282
// ```rust
@@ -93,7 +93,7 @@ pub use crate::{
9393
// Those are the additional completion options with automatic `use` import and options from all project importable items,
9494
// fuzzy matched against the completion input.
9595
//
96-
// image::https://user-images.githubusercontent.com/48062697/113020667-b72ab880-917a-11eb-8778-716cf26a0eb3.gif[]
96+
// ![Magic Completions](/img/features/magic_completions.gif)
9797

9898
/// Main entry point for completion. We run completion as a two-phase process.
9999
///

crates/ide-completion/src/snippet.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
//
99
// A custom snippet can be defined by adding it to the `rust-analyzer.completion.snippets.custom` object respectively.
1010
//
11-
// [source,json]
12-
// ----
11+
// ```json
1312
// {
1413
// "rust-analyzer.completion.snippets.custom": {
1514
// "thread spawn": {
@@ -25,7 +24,7 @@
2524
// }
2625
// }
2726
// }
28-
// ----
27+
// ```
2928
//
3029
// In the example above:
3130
//
@@ -55,8 +54,8 @@
5554
//
5655
// For the VSCode editor, rust-analyzer also ships with a small set of defaults which can be removed
5756
// by overwriting the settings object mentioned above, the defaults are:
58-
// [source,json]
59-
// ----
57+
//
58+
// ```json
6059
// {
6160
// "Arc::new": {
6261
// "postfix": "arc",
@@ -98,7 +97,7 @@
9897
// "scope": "expr"
9998
// }
10099
// }
101-
// ----
100+
// ```
102101

103102
use ide_db::imports::import_assets::LocatedImport;
104103
use itertools::Itertools;

crates/ide-db/src/apply_change.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,11 @@ impl RootDatabase {
4444
//
4545
// Clears rust-analyzer's internal database and prints memory usage statistics.
4646
//
47-
// |===
48-
// | Editor | Action Name
47+
// | Editor | Action Name |
48+
// |--------|--------------|
49+
// | VS Code | **rust-analyzer: Memory Usage (Clears Database)** |
4950
//
50-
// | VS Code | **rust-analyzer: Memory Usage (Clears Database)**
51-
// |===
52-
// image::https://user-images.githubusercontent.com/48062697/113065592-08559f00-91b1-11eb-8c96-64b88068ec02.gif[]
51+
// ![Memory Usage](/img/features/memory_usage.gif)
5352
pub fn per_query_memory_usage(&mut self) -> Vec<(String, Bytes, usize)> {
5453
let mut acc: Vec<(String, Bytes, usize)> = vec![];
5554

crates/ide-db/src/symbol_index.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,9 @@ impl<DB> std::ops::Deref for Snap<DB> {
184184
// the filtering via the `rust-analyzer.workspace.symbol.search.scope` and
185185
// `rust-analyzer.workspace.symbol.search.kind` settings.
186186
//
187-
// |===
188-
// | Editor | Shortcut
189-
//
190-
// | VS Code | kbd:[Ctrl+T]
191-
// |===
187+
// | Editor | Shortcut |
188+
// |---------|----------|
189+
// | VS Code | <kbd>Ctrl+T</kbd>
192190
pub fn world_symbols(db: &RootDatabase, query: Query) -> Vec<FileSymbol> {
193191
let _p = profile::span("world_symbols").detail(|| query.query.clone());
194192

crates/ide-diagnostics/src/tests/sourcegen.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fn sourcegen_diagnostic_docs() {
1010
let contents =
1111
diagnostics.into_iter().map(|it| it.to_string()).collect::<Vec<_>>().join("\n\n");
1212
let contents = sourcegen::add_preamble("sourcegen_diagnostic_docs", contents);
13-
let dst = project_root().join("docs/user/generated_diagnostic.adoc");
13+
let dst = project_root().join("docs/manual/generated/diagnostic.md");
1414
fs::write(dst, contents).unwrap();
1515
}
1616

@@ -68,6 +68,6 @@ fn is_valid_diagnostic_name(diagnostic: &str) -> Result<(), String> {
6868

6969
impl fmt::Display for Diagnostic {
7070
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
71-
writeln!(f, "=== {}\n**Source:** {}\n{}", self.id, self.location, self.doc)
71+
writeln!(f, "### {}\n\n**Source:** {}\n\n{}\n\n", self.id, self.location, self.doc)
7272
}
7373
}

crates/ide-ssr/src/lib.rs

+7-11
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,10 @@
3535
//
3636
// Supported constraints:
3737
//
38-
// |===
39-
// | Constraint | Restricts placeholder
40-
//
41-
// | kind(literal) | Is a literal (e.g. `42` or `"forty two"`)
42-
// | not(a) | Negates the constraint `a`
43-
// |===
38+
// | Constraint | Restricts placeholder |
39+
// |---------------|-----------------------|
40+
// | kind(literal) | Is a literal (e.g. `42` or `"forty two"`) |
41+
// | not(a) | Negates the constraint `a` |
4442
//
4543
// Available via the command `rust-analyzer.ssr`.
4644
//
@@ -54,11 +52,9 @@
5452
// String::from((y + 5).foo(z))
5553
// ```
5654
//
57-
// |===
58-
// | Editor | Action Name
59-
//
60-
// | VS Code | **rust-analyzer: Structural Search Replace**
61-
// |===
55+
// | Editor | Action Name |
56+
// |--------|---------------|
57+
// | VS Code | **rust-analyzer: Structural Search Replace** |
6258
//
6359
// Also available as an assist, by writing a comment containing the structural
6460
// search and replace rule. You will only see the assist if the comment can

crates/ide/src/annotations.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ mod fn_references;
2222
// Provides user with annotations above items for looking up references or impl blocks
2323
// and running/debugging binaries.
2424
//
25-
// image::https://user-images.githubusercontent.com/48062697/113020672-b7c34f00-917a-11eb-8f6e-858735660a0e.png[]
25+
// ![Annotations](/img/features/annotations.png)
2626
#[derive(Debug)]
2727
pub struct Annotation {
2828
pub range: TextRange,

crates/ide/src/doc_links.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,9 @@ pub(crate) fn remove_links(markdown: &str) -> String {
124124
// The simplest way to use this feature is via the context menu. Right-click on
125125
// the selected item. The context menu opens. Select **Open Docs**.
126126
//
127-
// |===
128-
// | Editor | Action Name
129-
//
130-
// | VS Code | **rust-analyzer: Open Docs**
131-
// |===
127+
// | Editor | Action Name |
128+
// |---------|------------|
129+
// | VS Code | **rust-analyzer: Open Docs** |
132130
pub(crate) fn external_docs(
133131
db: &RootDatabase,
134132
position: &FilePosition,

crates/ide/src/expand_macro.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@ pub struct ExpandedMacro {
1616
//
1717
// Shows the full macro expansion of the macro at current cursor.
1818
//
19-
// |===
20-
// | Editor | Action Name
19+
// | Editor | Action Name |
20+
// |---------|-------------|
21+
// | VS Code | **rust-analyzer: Expand macro recursively** |
2122
//
22-
// | VS Code | **rust-analyzer: Expand macro recursively**
23-
// |===
24-
//
25-
// image::https://user-images.githubusercontent.com/48062697/113020648-b3973180-917a-11eb-84a9-ecb921293dc5.gif[]
23+
// ![Expand Macro Recursively](/img/features/expand_macro_recursively.gif)
2624
pub(crate) fn expand_macro(db: &RootDatabase, position: FilePosition) -> Option<ExpandedMacro> {
2725
let sema = Semantics::new(db);
2826
let file = sema.parse(position.file_id);

crates/ide/src/extend_selection.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ use crate::FileRange;
1919
//
2020
// This is a standard LSP feature and not a protocol extension.
2121
//
22-
// |===
23-
// | Editor | Shortcut
22+
// | Editor | Shortcut |
23+
// |---------|--------- |
24+
// | VS Code | <kbd>Alt+Shift+→</kbd>, <kbd>Alt+Shift+←</kbd>
2425
//
25-
// | VS Code | kbd:[Alt+Shift+→], kbd:[Alt+Shift+←]
26-
// |===
27-
//
28-
// image::https://user-images.githubusercontent.com/48062697/113020651-b42fc800-917a-11eb-8a4f-cf1a07859fac.gif[]
26+
// ![Expand and Shrink Selection](/img/features/expand_and_shrink_selection.gif)
2927
pub(crate) fn extend_selection(db: &RootDatabase, frange: FileRange) -> TextRange {
3028
let sema = Semantics::new(db);
3129
let src = sema.parse(frange.file_id);

crates/ide/src/fetch_crates.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@ pub struct CrateInfo {
1414
//
1515
// Shows a view tree with all the dependencies of this project
1616
//
17-
// |===
18-
// | Editor | Panel Name
17+
// | Editor | Panel Name |
18+
// |---------|------------|
19+
// | VS Code | **Rust Dependencies** |
1920
//
20-
// | VS Code | **Rust Dependencies**
21-
// |===
22-
//
23-
// image::https://user-images.githubusercontent.com/5748995/229394139-2625beab-f4c9-484b-84ed-ad5dee0b1e1a.png[]
21+
// ![Show Dependency Tree](/img/features/show_dependency_tree.png)
2422
pub(crate) fn fetch_crates(db: &RootDatabase) -> FxIndexSet<CrateInfo> {
2523
let crate_graph = db.crate_graph();
2624
crate_graph

crates/ide/src/file_structure.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,11 @@ pub enum StructureNodeKind {
3030
// * draw breadcrumbs to describe the context around the cursor
3131
// * draw outline of the file
3232
//
33-
// |===
34-
// | Editor | Shortcut
33+
// | Editor | Shortcut |
34+
// |---------|----------|
35+
// | VS Code | <kbd>Ctrl+Shift+O</kbd> |
3536
//
36-
// | VS Code | kbd:[Ctrl+Shift+O]
37-
// |===
38-
//
39-
// image::https://user-images.githubusercontent.com/48062697/113020654-b42fc800-917a-11eb-8388-e7dc4d92b02e.gif[]
37+
// ![File Structure](/img/features/file_structure.gif)
4038

4139
pub(crate) fn file_structure(file: &SourceFile) -> Vec<StructureNode> {
4240
let mut res = Vec::new();

crates/ide/src/goto_definition.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ use syntax::{ast, AstNode, AstToken, SyntaxKind::*, SyntaxToken, TextRange, T};
1717
//
1818
// For outline modules, this will navigate to the source file of the module.
1919
//
20-
// |===
21-
// | Editor | Shortcut
20+
// | Editor | Shortcut |
21+
// |---------|----------|
22+
// | VS Code | <kbd>F12</kbd> |
2223
//
23-
// | VS Code | kbd:[F12]
24-
// |===
25-
//
26-
// image::https://user-images.githubusercontent.com/48062697/113065563-025fbe00-91b1-11eb-83e4-a5a703610b23.gif[]
24+
// ![Go to Definition](/img/features/go_to_definition.gif)
2725
pub(crate) fn goto_definition(
2826
db: &RootDatabase,
2927
position: FilePosition,

crates/ide/src/goto_implementation.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@ use crate::{FilePosition, NavigationTarget, RangeInfo, TryToNav};
1313
//
1414
// Navigates to the impl blocks of types.
1515
//
16-
// |===
17-
// | Editor | Shortcut
16+
// | Editor | Shortcut |
17+
// |---------|---------------------|
18+
// | VS Code | <kbd>Ctrl+F12</kbd> |
1819
//
19-
// | VS Code | kbd:[Ctrl+F12]
20-
// |===
21-
//
22-
// image::https://user-images.githubusercontent.com/48062697/113065566-02f85480-91b1-11eb-9288-aaad8abd8841.gif[]
20+
// ![Go to Implementation](/img/features/go_to_implementation.gif)
2321
pub(crate) fn goto_implementation(
2422
db: &RootDatabase,
2523
position: FilePosition,

0 commit comments

Comments
 (0)