Skip to content
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
4fca8f8
Add refactorings that extract a selected expression into a let bindin…
xperiandri Sep 13, 2026
fb45dfb
Offer Extract to literal on a caret inside a constant, as C# does
xperiandri Sep 14, 2026
a4cd150
Mention the caret in the Extract to literal release note
xperiandri Sep 14, 2026
bb6d6e2
Extract a parenthesized lambda from a caret in its fun ... -> header
xperiandri Sep 14, 2026
16add89
Write the refactoring test code as multi-line strings
xperiandri Sep 14, 2026
9a41635
Link the release note to the pull request and move it to a random lin…
xperiandri Sep 14, 2026
90f8221
Keep assignment targets and inactive string lines out of the extracti…
xperiandri Sep 29, 2026
a8fdac8
Add refactorings that extract a selected expression into a local func…
xperiandri Sep 13, 2026
7348b23
Extract a parenthesized lambda from a caret in its fun ... -> header
xperiandri Sep 14, 2026
5a72fb8
Write the extract function test code as multi-line strings
xperiandri Sep 14, 2026
cc4ab19
Link the release note to the pull request and move it to a random lin…
xperiandri Sep 14, 2026
0d7256e
Pass the defines to the extract function literal lines and test the n…
xperiandri Sep 29, 2026
eff9939
Carry over what the extract function branch had on top of the extract…
xperiandri Oct 2, 2026
07b192f
Close the gaps reviewers found in Extract to let binding and Extract …
xperiandri Oct 11, 2026
7bf3578
Remove the two stale copies of the Extract to let binding release note
xperiandri Oct 11, 2026
d3742a6
Annotate an extracted lambda only with a function type, also when sel…
xperiandri Oct 11, 2026
5ee8803
Merge the review fixes of Extract to let binding into Extract to func…
xperiandri Oct 11, 2026
c028a99
Close the gaps reviewers found in the Extract to function refactorings
xperiandri Oct 11, 2026
e19ffa3
Cover the inline member that would call an extracted private member
xperiandri Oct 11, 2026
e97f9ed
Add refactorings that extract a selected expression into a let bindin…
xperiandri Sep 13, 2026
09b4c99
Offer Extract to literal on a caret inside a constant, as C# does
xperiandri Sep 14, 2026
ddc53d1
Mention the caret in the Extract to literal release note
xperiandri Sep 14, 2026
0238664
Extract a parenthesized lambda from a caret in its fun ... -> header
xperiandri Sep 14, 2026
f3afa9c
Write the refactoring test code as multi-line strings
xperiandri Sep 14, 2026
e371b9b
Link the release note to the pull request and move it to a random lin…
xperiandri Sep 14, 2026
8a8d5b5
Keep assignment targets and inactive string lines out of the extracti…
xperiandri Sep 29, 2026
33b993b
Close the gaps reviewers found in Extract to let binding and Extract …
xperiandri Oct 11, 2026
48791b5
Remove the two stale copies of the Extract to let binding release note
xperiandri Oct 11, 2026
2920e42
Annotate an extracted lambda only with a function type, also when sel…
xperiandri Oct 11, 2026
838b68d
Merge remote-tracking branch 'origin/main' into feature/extract-funct…
xperiandri Oct 15, 2026
034e6f2
Compact the Extract to let binding code and name what its comments said
xperiandri Oct 15, 2026
1711de9
Fold the Extract to let binding tests into parameterized theories
xperiandri Oct 15, 2026
5aabbc8
Merge the compacted Extract to let binding into Extract to function
xperiandri Oct 15, 2026
204be8f
Compact the Extract to function code and name what its comments said
xperiandri Oct 15, 2026
b4cccb8
Fold the Extract to function tests into parameterized theories
xperiandri Oct 15, 2026
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
2 changes: 2 additions & 0 deletions docs/release-notes/.VisualStudio/18.vNext.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
### Added

* Add maintainer-requested F# Apex Visual Studio integration tests on DartLab-1ES CloudTest, using PR pipeline definitions pinned to an explicitly requested commit SHA. ([PR #20625](https://github.com/dotnet/fsharp/pull/20625))
* **Extract to let binding** and **Extract to literal** refactorings for a selected expression. The value is bound in front of the statement that uses it, so it is computed before the code that preceded the selection in that statement; a constant in a module-level declaration becomes a `[<Literal>]` in front of that declaration, also with just the caret inside the constant. ([PR #20537](https://github.com/dotnet/fsharp/pull/20537))
* Code-fixes for FS3888 (compiler-semantic attribute on the `.fs` but not the `.fsi`): copy the attribute into the `.fsi`, or remove it from the `.fs`. ([Issue #19560](https://github.com/dotnet/fsharp/issues/19560), [PR #19880](https://github.com/dotnet/fsharp/pull/19880))
* **Extract to local function**, **Extract to module function** and **Extract to private member** refactorings for a selected expression. Values the selection reads from the enclosing function, member or lambda become parameters in the order they are first used, typed as the new **Parameter types in Extract to function** option under **Code Fixes** asks. A selection that assigns to a captured mutable local, or reads a byref or byref-like value from outside, is not offered. ([Issue #14449](https://github.com/dotnet/fsharp/issues/14449), [PR #20538](https://github.com/dotnet/fsharp/pull/20538))
* Expand `<inheritdoc/>` in IDE tooltips, completion, and signature help, inheriting XML documentation from base classes, interfaces, overridden members, and constructors. ([Issue #19175](https://github.com/dotnet/fsharp/issues/19175), [PR #19188](https://github.com/dotnet/fsharp/pull/19188))
* Added a **Tools > Options > F# Tools > Compiler** option, **"Use the .NET SDK F# compiler for builds"**, on by default. Visual Studio uses the .NET SDK F# compiler when the project supplies SDK paths, matching `dotnet build`. Otherwise, it uses the bundled .NET Framework compiler. Turn the option off to use the bundled compiler for all projects. Changes are saved on Apply or OK; Cancel discards unsaved changes. Command-line builds are unaffected. ([Issue #20484](https://github.com/dotnet/fsharp/issues/20484), [PR #20485](https://github.com/dotnet/fsharp/pull/20485))

Expand Down
3 changes: 3 additions & 0 deletions vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,13 @@
<Compile Include="Commands\HelpContextService.fs" />
<Compile Include="Commands\FsiCommandService.fs" />
<Compile Include="Commands\XmlDocCommandService.fs" />
<Compile Include="Refactor\RefactoringHelpers.fs" />
<Compile Include="Refactor\AddReturnType.fs" />
<Compile Include="Refactor\ChangeTypeofWithNameToNameofExpression.fs" />
<Compile Include="Refactor\AddExplicitTypeToParameter.fs" />
<Compile Include="Refactor\ChangeDerefToValueRefactoring.fs" />
<Compile Include="Refactor\ExtractLetBinding.fs" />
<Compile Include="Refactor\ExtractFunction.fs" />
<Compile Include="CodeFixes\IFSharpCodeFix.fs" />
<Compile Include="CodeFixes\CodeFixHelpers.fs" />
<Compile Include="CodeFixes\ChangeEqualsInFieldTypeToColon.fs" />
Expand Down
15 changes: 15 additions & 0 deletions vsintegration/src/FSharp.Editor/FSharp.Editor.resx
Original file line number Diff line number Diff line change
Expand Up @@ -368,4 +368,19 @@ Use live (unsaved) buffers for analysis</value>
<data name="ReturnsHeader" xml:space="preserve">
<value>Returns:</value>
</data>
<data name="ExtractToLetBinding" xml:space="preserve">
<value>Extract to let binding</value>
</data>
<data name="ExtractToLiteral" xml:space="preserve">
<value>Extract to literal</value>
</data>
<data name="ExtractToLocalFunction" xml:space="preserve">
<value>Extract to local function</value>
</data>
<data name="ExtractToModuleFunction" xml:space="preserve">
<value>Extract to module function</value>
</data>
<data name="ExtractToPrivateMember" xml:space="preserve">
<value>Extract to private member</value>
</data>
</root>
20 changes: 19 additions & 1 deletion vsintegration/src/FSharp.Editor/Options/EditorOptions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ type EnterKeySetting =
| NewlineOnCompleteWord
| AlwaysNewline

[<RequireQualifiedAccess>]
type ParameterAnnotationSetting =
| Always
| WhenNeeded
| Never

// CLIMutable to make the record work also as a view model
[<CLIMutable>]
type IntelliSenseOptions =
Expand Down Expand Up @@ -68,6 +74,7 @@ type CodeFixesOptions =
UnusedDeclarations: bool
SuggestNamesForErrors: bool
RemoveParens: bool
ExtractFunctionParameterAnnotations: ParameterAnnotationSetting
}

static member Default =
Expand All @@ -79,6 +86,7 @@ type CodeFixesOptions =
UnusedDeclarations = true
SuggestNamesForErrors = true
RemoveParens = false
ExtractFunctionParameterAnnotations = ParameterAnnotationSetting.Always
}

[<CLIMutable>]
Expand Down Expand Up @@ -213,7 +221,14 @@ module internal OptionsUI =
[<Guid(Guids.codeFixesOptionPageIdString)>]
type internal CodeFixesOptionPage() =
inherit AbstractOptionPage<CodeFixesOptions>()
override this.CreateView() = upcast CodeFixesOptionControl()

override this.CreateView() =
let view = CodeFixesOptionControl()
let path = nameof CodeFixesOptions.Default.ExtractFunctionParameterAnnotations
bindRadioButton view.annotateAlways path ParameterAnnotationSetting.Always
bindRadioButton view.annotateWhenNeeded path ParameterAnnotationSetting.WhenNeeded
bindRadioButton view.annotateNever path ParameterAnnotationSetting.Never
upcast view

[<Guid(Guids.languageServicePerformanceOptionPageIdString)>]
type internal LanguageServicePerformanceOptionPage() =
Expand Down Expand Up @@ -263,6 +278,9 @@ module EditorOptionsExtensions =

member this.IsFsharpRemoveParensEnabled = this.EditorOptions.CodeFixes.RemoveParens

member this.FSharpExtractFunctionParameterAnnotations =
this.EditorOptions.CodeFixes.ExtractFunctionParameterAnnotations

member this.IsFSharpCodeFixesSuggestNamesForErrorsEnabled =
this.EditorOptions.CodeFixes.SuggestNamesForErrors

Expand Down
Loading
Loading