Skip to content

Commit

Permalink
Merge pull request fsprojects#2993 from cr3wdayt5p/improve-docs
Browse files Browse the repository at this point in the history
Improve docs
  • Loading branch information
dawedawe committed Nov 20, 2023
2 parents dc24d86 + 5b8d481 commit 21bae08
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 53 deletions.
10 changes: 5 additions & 5 deletions docs/docs/end-users/GettingStarted.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ It is recommended to install it as a local tool and stick to a certain version p
Create a [.NET tool manifest](https://docs.microsoft.com/en-us/dotnet/core/tools/local-tools-how-to-use) to install tools locally.
You can skip this step if you wish to install Fantomas globally.
> dotnet new tool-manifest
dotnet new tool-manifest
Install the command line tool with:
> dotnet tool install fantomas
dotnet tool install fantomas
or install the tool globally with
> dotnet tool install -g fantomas
dotnet tool install -g fantomas
## Usage
Expand Down Expand Up @@ -56,7 +57,7 @@ The output path is prompted by `--out` e.g.
Both paths have to be files or folders at the same time.
If they are folders, the structure of input folder will be reflected in the output one.
The tool will explore the input folder recursively if you set `--recurse` option.
The tool will explore the input folder recursively.
If you omit the output path, Fantomas will overwrite the input files unless the content did not change.
Expand All @@ -66,7 +67,6 @@ If you omit the output path, Fantomas will overwrite the input files unless the
Multiple paths can be passed as last argument, these can be both files and folders.
This cannot be combined with the `--out` flag.
When combined with the `--recurse` flag, all passed folders will be processed recursively.
One interesting use-case of passing down multiple paths is that you can easily control the selection and filtering of paths from the current shell.
Expand Down
56 changes: 8 additions & 48 deletions docs/docs/end-users/Rider.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,56 +6,16 @@ index: 7
# JetBrains Rider
The resharper-fsharp uses Fantomas under the hood to format the source code. No need for any additional plugins.

From Rider 2022.2 onwards, Rider can detect your `dotnet` Fantomas installation, either globally or locally.
Install Fantomas locally with `dotnet tool install fantomas`.

<img class="mt-2" src="{{root}}/images/rider-fantomas.png" alt="drawing" width="70%"/>

At the time of writing, Rider versions prior to the not yet released 2022.3 [overwrite](https://youtrack.jetbrains.com/issue/RIDER-83997/Rider-doesnt-respect-Fantomas-default-settings-not-explicitly-set-in-editorconfig)
the settings of Fantomas which aren't explicitly set in your editorconfig file.
As the settings chosen by Rider can lead to unwanted results, Rider users might want to also include the default settings in their editorconfig file.

Fortunately, with 2022.3 the Rider developers changed the settings chosen by Rider to be the same as the default Fantomas settings.
This means, as long as the Fantomas default settings don't change, the described issue should be solved with Rider 2022.3.
The current default settings are the following:
From Rider 2022.2 onwards, Rider can detect your `dotnet` Fantomas installation, either globally or locally.

Install Fantomas locally with:
```
indent_size=4
max_line_length=120
end_of_line=crlf
insert_final_newline=true
fsharp_space_before_parameter=true
fsharp_space_before_lowercase_invocation=true
fsharp_space_before_uppercase_invocation=false
fsharp_space_before_class_constructor=false
fsharp_space_before_member=false
fsharp_space_before_colon=false
fsharp_space_after_comma=true
fsharp_space_before_semicolon=false
fsharp_space_after_semicolon=true
fsharp_space_around_delimiter=true
fsharp_max_if_then_short_width=0
fsharp_max_if_then_else_short_width=60
fsharp_max_infix_operator_expression=80
fsharp_max_record_width=40
fsharp_max_record_number_of_items=1
fsharp_record_multiline_formatter=character_width
fsharp_max_array_or_list_width=80
fsharp_max_array_or_list_number_of_items=1
fsharp_array_or_list_multiline_formatter=character_width
fsharp_max_value_binding_width=80
fsharp_max_function_binding_width=40
fsharp_max_dot_get_expression_width=80
fsharp_multiline_bracket_style = cramped
fsharp_newline_between_type_definition_and_members=true
fsharp_align_function_signature_to_indentation=false
fsharp_alternative_long_member_definitions=false
fsharp_multi_line_lambda_closing_newline=false
fsharp_experimental_keep_indent_in_branch=false
fsharp_blank_lines_around_nested_multiline_expressions=true
fsharp_bar_before_discriminated_union_declaration=false
fsharp_keep_max_number_of_blank_lines=100
fsharp_strict_mode=false
dotnet tool install fantomas
```

<img class="mt-2" src="{{root}}/images/rider-fantomas.png" alt="drawing" width="70%"/>

Prior to Rider 2022.3 it did not [respect](https://youtrack.jetbrains.com/issue/RIDER-83997/Rider-doesnt-respect-Fantomas-default-settings-not-explicitly-set-in-editorconfig) the default settings of Fantomas.
If you are stuck on version 2022.2 (or earlier) consider adding the default settings of Fantomas to your `.editorconfig` file.

<fantomas-nav previous="{{fsdocs-previous-page-link}}" next="{{fsdocs-next-page-link}}"></fantomas-nav>
Binary file modified docs/images/rider-fantomas.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 21bae08

Please sign in to comment.