-
Notifications
You must be signed in to change notification settings - Fork 62
Added linting to the documentation. #92
Changes from 1 commit
cab3896
4e1eabd
16bc448
12456fe
62c8641
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Legacy Mode Linting Page | ||
|
||
Executing a cargo command makes the extension parse the output of the executed command and show diagnostics. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
Let's assume we have the following code: | ||
|
||
```rust | ||
fn main() { | ||
let x = 5 + "10"; | ||
} | ||
``` | ||
|
||
We execute any cargo command. Let's execute "Cargo: Build". | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
It builds and shows diagnostics: | ||
|
||
* In code: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
[![Linting](../../images/linting/code.jpg)]() | ||
|
||
* In the Problems panel: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
[![Linting](../../images/linting/problems_panel_legacy_mode.jpg)]() | ||
|
||
We can hover any diagnostic to see what it is: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
[![Linting](../../images/linting/code_hover_legacy_mode.jpg)]() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Linging Page | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
The extension provides linting which looks like in the following screenshot: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
[![Linting](../images/linting/code.jpg)]() | ||
|
||
Also it populates the Problems panel. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
For the code: | ||
|
||
```rust | ||
fn foo(i: i32) {} | ||
|
||
fn main() { | ||
foo(2i64); | ||
} | ||
``` | ||
|
||
The Problems panel looks like in the following screenshot: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why would? It is a fact, isn't it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Would" because the code above is a hypothetical example/scenario. You can use "will" if you prefer. Either works. |
||
|
||
[![Linting](../images/linting/problems_panel.jpg)]() | ||
|
||
Linting works different in [Legacy Mode](legacy_mode/linting.md) and [RLS Mode](rls_mode/linting.md). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The linting page should also mention which linting mode is the default. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no default mode. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @redactedscribe, |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,10 @@ The extension can function in one of two modes: | |
|
||
Each mode is described in detail on its own page. | ||
|
||
Furthermore, the extension provides: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On line 20, you repeat yourself with another sentence beginning with "Furthermore`. Try to avoid repetition. The use of "Furthermore" tends to only be used once to add additional reinforcement to something, in this case, the features of the extension. |
||
|
||
* [Linting (Showing diagnostics in the active text editor)](linting.md) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume you are describing what linting is, and it is: "the showing of diagnostics in the active text editor". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't know that it is possible. Thank you. |
||
|
||
Furthermore, the extension allows: | ||
|
||
* [To execute one of built-in cargo command](cargo_command_execution.md) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# RLS Mode Linting Page | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
`RLS` checks the project and shows diagnostics while you are typing. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Must |
||
|
||
You can see diagnostics in the Problems Panel. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't get this one. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Simply, "Panel" is capitalised whereas in previous mentions you said "Problems panel". |
||
|
||
You can hover on a diagnostics to see what the diagnostic is. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
Executing a cargo command doesn't show any diagnostics. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
It is intentional decision. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
The reason is that there is no pretty way to hide a diagnostic after the diagnostic's cause is fixed. | ||
|
||
It may confuse people. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What may confuse people? The old diagnostics after a fix? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think adding "Page" to the end of each documentation page is unnecessary.
Linting in Legacy Mode
I believe describes the page better.