Skip to content

Commit f2d12ff

Browse files
authored
Merge pull request #18407 from hackervole/code-fix-welcome-setup-tips
Fix formatting on welcome page, read only paths setting example
2 parents aaae1d4 + 183796e commit f2d12ff

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

src/tools/rust-analyzer/editors/code/.vscodeignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@
1212
!ra_syntax_tree.tmGrammar.json
1313
!server
1414
!README.md
15+
!walkthrough-setup-tips.md

src/tools/rust-analyzer/editors/code/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3224,10 +3224,9 @@
32243224
{
32253225
"id": "setup",
32263226
"title": "Useful Setup Tips",
3227-
"description": "There are a couple of things you might want to configure upfront to your tastes. We'll name a few here but be sure to check out the docs linked below!\n\n**Marking library sources as readonly**\n\nAdding the following to your settings.json will mark all Rust library sources as readonly:\n```json\n\"files.readonlyInclude\": {\n \"**/.cargo/registry/src/**/*.rs\": true,\n \"**/lib/rustlib/src/rust/library/**/*.rs\": true,\n},\n```\n\n**Check on Save**\n\nBy default, rust-analyzer will run `cargo check` on your codebase when you save a file, rendering diagnostics emitted by `cargo check` within your code. This can potentially collide with other `cargo` commands running concurrently, blocking them from running for a certain amount of time. In these cases it is recommended to disable the `rust-analyzer.checkOnSave` configuration and running the `rust-analyzer: Run flycheck` command on-demand instead.",
3227+
"description": "There are a couple of things you might want to configure upfront to your tastes. We'll name a few here but be sure to check out the docs linked below!\n\n**Marking library sources as readonly**\n\nAdding the snippet on the right to your settings.json will mark all Rust library sources as readonly.\n\n**Check on Save**\n\nBy default, rust-analyzer will run ``cargo check`` on your codebase when you save a file, rendering diagnostics emitted by ``cargo check`` within your code. This can potentially collide with other ``cargo`` commands running concurrently, blocking them from running for a certain amount of time. In these cases it is recommended to disable the ``rust-analyzer.checkOnSave`` configuration and running the ``rust-analyzer: Run flycheck`` command on-demand instead.",
32283228
"media": {
3229-
"image": "./icon.png",
3230-
"altText": "rust-analyzer logo"
3229+
"markdown": "./walkthrough-setup-tips.md"
32313230
}
32323231
},
32333232
{
@@ -3245,7 +3244,7 @@
32453244
{
32463245
"id": "faq",
32473246
"title": "FAQ",
3248-
"description": "What are these code hints that are being inserted into my code?\n\nThese hints are called inlay hints which rust-analyzer support and are enabled by default in VSCode. If you wish to disable them you can do so via the `editor.inlayHints.enabled` setting.",
3247+
"description": "What are these code hints that are being inserted into my code?\n\nThese hints are called inlay hints which rust-analyzer support and are enabled by default in VSCode. If you wish to disable them you can do so via the ``editor.inlayHints.enabled`` setting.",
32493248
"media": {
32503249
"image": "icon.png",
32513250
"altText": "rust-analyzer logo"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Settings Example
2+
3+
Add the following to settings.json to mark Rust library sources as read-only:
4+
5+
```json
6+
"files.readonlyInclude": {
7+
"**/.cargo/registry/src/**/*.rs": true,
8+
"**/lib/rustlib/src/rust/library/**/*.rs": true,
9+
},
10+
```

0 commit comments

Comments
 (0)