Skip to content
This repository has been archived by the owner on Dec 8, 2020. It is now read-only.

Added linting to the documentation. #92

Merged
merged 5 commits into from
Feb 20, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions doc/legacy_mode/linting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Legacy Mode Linting Page
Copy link
Contributor

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.


Executing a cargo command makes the extension parse the output of the executed command and show diagnostics.
Copy link
Contributor

@redactedscribe redactedscribe Feb 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing a cargo command makes the extension parse the command's output and show diagnostics. Legacy Mode cannot show diagnostics as you type, for that you must use [RLS Mode](rls_mode/linting.md).


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".
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We then execute any cargo command. Let's execute "Cargo: Build".


It builds and shows diagnostics:

* In code:
Copy link
Contributor

@redactedscribe redactedscribe Feb 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the source code:


[![Linting](../../images/linting/code.jpg)]()

* In the Problems panel:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And in the Problems panel:


[![Linting](../../images/linting/problems_panel_legacy_mode.jpg)]()

We can hover any diagnostic to see what it is:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can hover over any diagnostic to see what it is:


[![Linting](../../images/linting/code_hover_legacy_mode.jpg)]()
23 changes: 23 additions & 0 deletions doc/linting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Linging Page
Copy link
Contributor

@redactedscribe redactedscribe Feb 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linting


The extension provides linting which looks like in the following screenshot:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The extension provides linting as shown in the following screenshot:


[![Linting](../images/linting/code.jpg)]()

Also it populates the Problems panel.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It also populates the Problems panel.


For the code:

```rust
fn foo(i: i32) {}

fn main() {
foo(2i64);
}
```

The Problems panel looks like in the following screenshot:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Problems panel would look like:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would? It is a fact, isn't it?

Copy link
Contributor

Choose a reason for hiding this comment

The 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).
Copy link
Contributor

@redactedscribe redactedscribe Feb 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linting behaves differently in [RLS Mode](rls_mode/linting.md) than in [Legacy Mode](legacy_mode/linting.md).

The linting page should also mention which linting mode is the default.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no default mode.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@redactedscribe,
I meant that the chosen mode depended on which mode the extension was running on.

4 changes: 4 additions & 0 deletions doc/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Copy link
Contributor

Choose a reason for hiding this comment

The 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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Linting (the showing of diagnostics in the active text editor)](linting.md)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the?

Copy link
Contributor

Choose a reason for hiding this comment

The 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".

Copy link
Member Author

Choose a reason for hiding this comment

The 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)
Expand Down
15 changes: 15 additions & 0 deletions doc/rls_mode/linting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# RLS Mode Linting Page
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linting in RLS Mode


`RLS` checks the project and shows diagnostics while you are typing.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must RLS be in code format?


You can see diagnostics in the Problems Panel.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can see diagnostics in the Problems panel.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get this one.

Copy link
Contributor

Choose a reason for hiding this comment

The 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.
Copy link
Contributor

@redactedscribe redactedscribe Feb 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also hover over a diagnostic to see what the problem is.


Executing a cargo command doesn't show any diagnostics.
Copy link
Contributor

@redactedscribe redactedscribe Feb 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing a cargo command doesn't show any diagnostics (unlike [Legacy Mode](legacy_mode/linting.md)).


It is intentional decision.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an intentional design decision.


The reason is that there is no pretty way to hide a diagnostic after the diagnostic's cause is fixed.

It may confuse people.
Copy link
Contributor

@redactedscribe redactedscribe Feb 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What may confuse people? The old diagnostics after a fix?
This would be confusing, hence the decision. ?

File renamed without changes.
Binary file added images/linting/code.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/linting/code_hover_legacy_mode.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/linting/problems_panel.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/linting/problems_panel_legacy_mode.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.