Skip to content

Commit

Permalink
deploy: 369faf8
Browse files Browse the repository at this point in the history
  • Loading branch information
nojaf committed Aug 31, 2023
1 parent c70e3c0 commit 74898ec
Show file tree
Hide file tree
Showing 35 changed files with 147 additions and 96 deletions.
2 changes: 1 addition & 1 deletion docs/contributors/Conditional Compilation Directives.html
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ <h2><a name="Merging-the-trees" class="anchor" href="#Merging-the-trees">Merging
<div class="fsdocs-tip" id="fs2">union case Option.None: Option&lt;&#39;T&gt;</div>
<div class="fsdocs-tip" id="fs3">namespace Microsoft.FSharp</div>
<div class="fsdocs-tip" id="fs4">union case Option.Some: Value: &#39;T -&gt; Option&lt;&#39;T&gt;</div>
<div class="fsdocs-tip" id="fs5">val a: string list</div>
<div class="fsdocs-tip" id="fs5">val a: &#39;a</div>

</div>
<div id="push"></div>
Expand Down
2 changes: 1 addition & 1 deletion docs/contributors/Multiple Times.html
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ <h2><a name="Unit-test-naming-conventions" class="anchor" href="#Unit-test-namin
<div class="fsdocs-tip" id="fs1">namespace System</div>
<div class="fsdocs-tip" id="fs2">Multiple items<br />type FormatException =
inherit SystemException
new: unit -&gt; unit + 2 overloads<br /><em>&lt;summary&gt;The exception that is thrown when the format of an argument is invalid, or when a composite format string is not well formed.&lt;/summary&gt;</em><br /><br />--------------------<br />System.FormatException() : System.FormatException<br />System.FormatException(message: string) : System.FormatException<br />System.FormatException(info: System.Runtime.Serialization.SerializationInfo, context: System.Runtime.Serialization.StreamingContext) : System.FormatException<br />System.FormatException(message: string, innerException: exn) : System.FormatException</div>
new: unit -&gt; unit + 2 overloads<br /><em>&lt;summary&gt;The exception that is thrown when the format of an argument is invalid, or when a composite format string is not well formed.&lt;/summary&gt;</em><br /><br />--------------------<br />System.FormatException() : System.FormatException<br />System.FormatException(message: string) : System.FormatException<br />System.FormatException(message: string, innerException: exn) : System.FormatException</div>
<div class="fsdocs-tip" id="fs3">val printfn: format: Printf.TextWriterFormat&lt;&#39;T&gt; -&gt; &#39;T</div>

</div>
Expand Down
23 changes: 16 additions & 7 deletions docs/contributors/Pull request ground rules.html
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ <h3><a name="Unit-test" class="anchor" href="#Unit-test">Unit test</a></h3>
<li>When creating a test that is linked to a GitHub issue, add the number at the back with a comma, as in the following:</li>
</ul>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="pn">[&lt;</span><span class="id">Test</span><span class="pn">&gt;]</span>
<span class="k">let</span> <span class="id">``preserve compile directive between piped functions, 512``</span> <span class="pn">(</span><span class="pn">)</span> <span class="o">=</span> <span class="o">..</span><span class="pn">.</span>
<span class="k">let</span> <span class="fn">``preserve compile directive between piped functions, 512``</span> <span class="pn">(</span><span class="pn">)</span> <span class="o">=</span> <span class="o">..</span><span class="pn">.</span>
</code></pre>
<p>You don't need to repeat this number for tests that are deviations from the original report problem.</p>
<h3><a name="Verify-signature-files" class="anchor" href="#Verify-signature-files">Verify signature files</a></h3>
Expand Down Expand Up @@ -344,20 +344,20 @@ <h3><a name="Member-declaration" class="anchor" href="#Member-declaration">Membe
<ul>
<li>Use <code>x</code> as the the <code>self-identifier</code> if you need it.</li>
</ul>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="k">type</span> <span class="id">Foo</span><span class="pn">(</span><span class="pn">)</span> <span class="o">=</span>
<span class="k">member</span> <span class="id">_</span><span class="pn">.</span><span class="id">Children</span> <span class="o">=</span> <span class="pn">[</span><span class="pn">]</span>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="k">type</span> <span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="rt">Foo</span><span class="pn">(</span><span class="pn">)</span> <span class="o">=</span>
<span class="k">member</span> <span class="id">_</span><span class="pn">.</span><span class="prop">Children</span> <span class="o">=</span> <span class="pn">[</span><span class="pn">]</span>

<span class="c">// ✔️ OK</span>
<span class="k">member</span> <span class="id">x</span><span class="pn">.</span><span class="id">Length</span> <span class="o">=</span> <span class="id">x</span><span class="pn">.</span><span class="id">Children</span><span class="pn">.</span><span class="id">Length</span>
<span class="k">member</span> <span onmouseout="hideTip(event, 'fs2', 2)" onmouseover="showTip(event, 'fs2', 2)" class="fn">x</span><span class="pn">.</span><span class="prop">Length</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs2', 3)" onmouseover="showTip(event, 'fs2', 3)" class="fn">x</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs3', 4)" onmouseover="showTip(event, 'fs3', 4)" class="prop">Children</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs4', 5)" onmouseover="showTip(event, 'fs4', 5)" class="id">Length</span>

<span class="c">// ❌ Not preferred, we use `x`</span>
<span class="k">member</span> <span class="id">this</span><span class="pn">.</span><span class="id">WrongLength</span> <span class="o">=</span> <span class="id">this</span><span class="pn">.</span><span class="id">Children</span><span class="pn">.</span><span class="id">Length</span> <span class="o">-</span> <span class="n">1</span>
<span class="k">member</span> <span onmouseout="hideTip(event, 'fs5', 6)" onmouseover="showTip(event, 'fs5', 6)" class="fn">this</span><span class="pn">.</span><span class="prop">WrongLength</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs5', 7)" onmouseover="showTip(event, 'fs5', 7)" class="fn">this</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs3', 8)" onmouseover="showTip(event, 'fs3', 8)" class="prop">Children</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs4', 9)" onmouseover="showTip(event, 'fs4', 9)" class="id">Length</span> <span class="o">-</span> <span class="n">1</span>
</code></pre>
<ul>
<li>Use <code>_</code> when you don't need the <code>self-identifier</code>.</li>
<li>Use <code>member val</code> when possible.</li>
</ul>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="k">type</span> <span class="id">Foo</span><span class="pn">(</span><span class="id">v</span><span class="pn">:</span> <span class="id">Value</span><span class="pn">)</span> <span class="o">=</span>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="k">type</span> <span onmouseout="hideTip(event, 'fs1', 10)" onmouseover="showTip(event, 'fs1', 10)" class="id">Foo</span><span class="pn">(</span><span class="id">v</span><span class="pn">:</span> <span class="id">Value</span><span class="pn">)</span> <span class="o">=</span>
<span class="c">// ✔️ OK</span>
<span class="k">member</span> <span class="k">val</span> <span class="id">Value</span> <span class="o">=</span> <span class="id">v</span>

Expand All @@ -378,7 +378,16 @@ <h3><a name="Target-the-next-minor-or-major-branch" class="anchor" href="#Target
The maintainers will frequently rebase this branch on top of the main branch and release alpha/beta packages accordingly.</p>
<fantomas-nav previous="Multiple%20Times.html" next="./Updating%20the%20compiler.html"></fantomas-nav>


<div class="fsdocs-tip" id="fs1">Multiple items<br />type Foo =
new: unit -&gt; Foo
member Children: obj list
member Length: int
member WrongLength: int<br /><br />--------------------<br />new: unit -&gt; Foo</div>
<div class="fsdocs-tip" id="fs2">val x: Foo</div>
<div class="fsdocs-tip" id="fs3">property Foo.Children: obj list with get</div>
<div class="fsdocs-tip" id="fs4">property List.Length: int with get</div>
<div class="fsdocs-tip" id="fs5">val this: Foo</div>

</div>
<div id="push"></div>
</main>
Expand Down
15 changes: 8 additions & 7 deletions docs/contributors/Transforming.html
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ <h3><a name="Parse-AST" class="anchor" href="#Parse-AST">Parse AST</a></h3>
<li><code>defines: string list</code></li>
</ul>
<p>Conditional compilation defines are passed to the parser. These can have an influence on the parsing process, resulting in different ASTs.</p>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs2', 2)" onmouseover="showTip(event, 'fs2', 2)" class="fn">a</span> <span class="o">=</span>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs2', 2)" onmouseover="showTip(event, 'fs2', 2)" class="id">a</span> <span class="o">=</span>
<span class="pp">#if</span> <span class="id">DEBUG</span>
<span class="inactive"> </span><span class="inactive">0</span>
<span class="pp">#else</span>
Expand Down Expand Up @@ -288,7 +288,7 @@ <h4><a name="Detecting-trivia" class="anchor" href="#Detecting-trivia">Detecting
<p>Trivia can however be easily detected in Fantomas. Both code comments and conditional directives are present in the AST.
These are stored on the file level (in <a href="https://fsprojects.github.io/fantomas/reference/fsharp-compiler-syntax-parsedimplfileinput.html">ParsedImplFileInput</a> and <a href="https://fsprojects.github.io/fantomas/reference/fsharp-compiler-syntax-parsedsigfileinput.html">ParsedSigFileInput</a> in the <code>trivia</code> node).</p>
<p>In both <a href="https://fsprojects.github.io/fantomas/reference/fsharp-compiler-syntaxtrivia-parsedimplfileinputtrivia.html">ParsedImplFileInputTrivia</a> and <a href="https://fsprojects.github.io/fantomas/reference/fsharp-compiler-syntaxtrivia-parsedsigfileinputtrivia.html">ParsedSigFileInputTrivia</a> we can see comments and conditional directives.</p>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs1', 3)" onmouseover="showTip(event, 'fs1', 3)" class="fn">a</span> <span class="o">=</span>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs3', 3)" onmouseover="showTip(event, 'fs3', 3)" class="id">a</span> <span class="o">=</span>
<span class="c">// comment b</span>
<span class="id">c</span>
</code></pre>
Expand All @@ -301,9 +301,9 @@ <h4><a name="Detecting-trivia" class="anchor" href="#Detecting-trivia">Detecting
<span class="pn">[</span><span class="id">Let</span>
<span class="pn">(</span><span class="k">false</span><span class="pn">,</span>
<span class="pn">[</span><span class="id">SynBinding</span><span class="pn">(</span><span class="o">..</span><span class="pn">.</span><span class="pn">)</span><span class="pn">]</span><span class="pn">,</span>
<span class="id">tmp</span><span class="pn">.</span><span class="id">fsx</span> <span class="pn">(</span><span class="n">1</span><span class="pn">,</span><span class="n">0</span><span class="o">--</span><span class="n">3</span><span class="pn">,</span><span class="n">4</span><span class="pn">)</span><span class="pn">)</span><span class="pn">]</span><span class="pn">,</span> <span class="id">PreXmlDocEmpty</span><span class="pn">,</span> <span class="pn">[</span><span class="pn">]</span><span class="pn">,</span> <span onmouseout="hideTip(event, 'fs3', 4)" onmouseover="showTip(event, 'fs3', 4)" class="id">None</span><span class="pn">,</span> <span class="id">tmp</span><span class="pn">.</span><span class="id">fsx</span> <span class="pn">(</span><span class="n">1</span><span class="pn">,</span><span class="n">0</span><span class="o">--</span><span class="n">3</span><span class="pn">,</span><span class="n">4</span><span class="pn">)</span><span class="pn">,</span>
<span class="pn">{</span> <span class="id">ModuleKeyword</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs3', 5)" onmouseover="showTip(event, 'fs3', 5)" class="id">None</span>
<span class="id">NamespaceKeyword</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs3', 6)" onmouseover="showTip(event, 'fs3', 6)" class="id">None</span> <span class="pn">}</span><span class="pn">)</span><span class="pn">]</span><span class="pn">,</span> <span class="pn">(</span><span class="k">false</span><span class="pn">,</span> <span class="k">false</span><span class="pn">)</span><span class="pn">,</span>
<span class="id">tmp</span><span class="pn">.</span><span class="id">fsx</span> <span class="pn">(</span><span class="n">1</span><span class="pn">,</span><span class="n">0</span><span class="o">--</span><span class="n">3</span><span class="pn">,</span><span class="n">4</span><span class="pn">)</span><span class="pn">)</span><span class="pn">]</span><span class="pn">,</span> <span class="id">PreXmlDocEmpty</span><span class="pn">,</span> <span class="pn">[</span><span class="pn">]</span><span class="pn">,</span> <span onmouseout="hideTip(event, 'fs4', 4)" onmouseover="showTip(event, 'fs4', 4)" class="id">None</span><span class="pn">,</span> <span class="id">tmp</span><span class="pn">.</span><span class="id">fsx</span> <span class="pn">(</span><span class="n">1</span><span class="pn">,</span><span class="n">0</span><span class="o">--</span><span class="n">3</span><span class="pn">,</span><span class="n">4</span><span class="pn">)</span><span class="pn">,</span>
<span class="pn">{</span> <span class="id">ModuleKeyword</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs4', 5)" onmouseover="showTip(event, 'fs4', 5)" class="id">None</span>
<span class="id">NamespaceKeyword</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs4', 6)" onmouseover="showTip(event, 'fs4', 6)" class="id">None</span> <span class="pn">}</span><span class="pn">)</span><span class="pn">]</span><span class="pn">,</span> <span class="pn">(</span><span class="k">false</span><span class="pn">,</span> <span class="k">false</span><span class="pn">)</span><span class="pn">,</span>
<span class="pn">{</span> <span class="id">ConditionalDirectives</span> <span class="o">=</span> <span class="pn">[</span><span class="pn">]</span>
<span class="id">CodeComments</span> <span class="o">=</span> <span class="pn">[</span><span class="id">LineComment</span> <span class="id">tmp</span><span class="pn">.</span><span class="id">fsx</span> <span class="pn">(</span><span class="n">2</span><span class="pn">,</span><span class="n">3</span><span class="o">--</span><span class="n">2</span><span class="pn">,</span><span class="n">15</span><span class="pn">)</span><span class="pn">]</span> <span class="pn">}</span><span class="pn">)</span><span class="pn">)</span>
</code></pre>
Expand All @@ -323,9 +323,10 @@ <h4><a name="Inserting-trivia" class="anchor" href="#Inserting-trivia">Inserting
</div>
<fantomas-nav previous="./Solution%20Structure.html" next="./Traverse.html"></fantomas-nav>

<div class="fsdocs-tip" id="fs1">val a: obj</div>
<div class="fsdocs-tip" id="fs1">val a: &#39;a</div>
<div class="fsdocs-tip" id="fs2">val a: int</div>
<div class="fsdocs-tip" id="fs3">union case Option.None: Option&lt;&#39;T&gt;</div>
<div class="fsdocs-tip" id="fs3">val a: obj</div>
<div class="fsdocs-tip" id="fs4">union case Option.None: Option&lt;&#39;T&gt;</div>

</div>
<div id="push"></div>
Expand Down
4 changes: 2 additions & 2 deletions docs/end-users/Configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ <h1><a name="Configuration" class="anchor" href="#Configuration">Configuration</

<span onmouseout="hideTip(event, 'fs1', 1)" onmouseover="showTip(event, 'fs1', 1)" class="fn">printf</span> <span class="s">$&quot;version: {</span><span onmouseout="hideTip(event, 'fs2', 2)" onmouseover="showTip(event, 'fs2', 2)" class="id">Fantomas</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs3', 3)" onmouseover="showTip(event, 'fs3', 3)" class="id">Core</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs4', 4)" onmouseover="showTip(event, 'fs4', 4)" class="rt">CodeFormatter</span><span class="pn">.</span><span onmouseout="hideTip(event, 'fs5', 5)" onmouseover="showTip(event, 'fs5', 5)" class="id">GetVersion</span><span class="pn">(</span><span class="pn">)</span><span class="s">}&quot;</span>
</code></pre>
<table class="pre"><tr><td><pre><code>version: 6.2.0+6bb3479e7e8c433a028bfaf3efee7962fc043a9b</code></pre></td></tr></table>
<table class="pre"><tr><td><pre><code>version: 6.2.0+369faf81362e7ddb3fce3bd4505216055af35347</code></pre></td></tr></table>
<h2><a name="Usage" class="anchor" href="#Usage">Usage</a></h2>
<p>Inside .editorconfig you can specify the file extension and code location to be use per config:</p>
<pre class="fssnip highlighted"><code lang="fsharp"><span class="pn">[</span><span class="pn">*.</span><span class="id">fs</span><span class="pn">]</span>
Expand Down Expand Up @@ -1165,7 +1165,7 @@ <h2><a name="Other" class="anchor" href="#Other">Other</a></h2>
static member AwaitWaitHandle: waitHandle: WaitHandle * ?millisecondsTimeout: int -&gt; Async&lt;bool&gt;
static member CancelDefaultToken: unit -&gt; unit
static member Catch: computation: Async&lt;&#39;T&gt; -&gt; Async&lt;Choice&lt;&#39;T,exn&gt;&gt;
static member Choice: computations: seq&lt;Async&lt;&#39;T option&gt;&gt; -&gt; Async&lt;&#39;T option&gt;
static member Choice: computations: Async&lt;&#39;T option&gt; seq -&gt; Async&lt;&#39;T option&gt;
static member FromBeginEnd: beginAction: (AsyncCallback * obj -&gt; IAsyncResult) * endAction: (IAsyncResult -&gt; &#39;T) * ?cancelAction: (unit -&gt; unit) -&gt; Async&lt;&#39;T&gt; + 3 overloads
static member FromContinuations: callback: ((&#39;T -&gt; unit) * (exn -&gt; unit) * (OperationCanceledException -&gt; unit) -&gt; unit) -&gt; Async&lt;&#39;T&gt;
...<br /><br />--------------------<br />type Async&lt;&#39;T&gt;</div>
Expand Down
Loading

0 comments on commit 74898ec

Please sign in to comment.