Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
a03519c
Add refactorings that extract a selected expression into a let bindin…
xperiandri Sep 13, 2026
7eddec4
Offer Extract to literal on a caret inside a constant, as C# does
xperiandri Sep 14, 2026
4eccb2a
Mention the caret in the Extract to literal release note
xperiandri Sep 14, 2026
88bf9f2
Extract a parenthesized lambda from a caret in its fun ... -> header
xperiandri Sep 14, 2026
5194217
Write the refactoring test code as multi-line strings
xperiandri Sep 14, 2026
db178af
Link the release note to the pull request and move it to a random lin…
xperiandri Sep 14, 2026
039c6a5
Keep assignment targets and inactive string lines out of the extracti…
xperiandri Sep 29, 2026
24092c4
Close the gaps reviewers found in Extract to let binding and Extract …
xperiandri Oct 11, 2026
3dc7b47
Annotate an extracted lambda only with a function type, also when sel…
xperiandri Oct 11, 2026
68a4f26
Compact the Extract to let binding code and name what its comments said
xperiandri Oct 15, 2026
eb54157
Fold the Extract to let binding tests into parameterized theories
xperiandri Oct 15, 2026
9c52cd0
Bring the rebased branch to what it had before the rebase
xperiandri Oct 29, 2026
96b00b4
Reserve identifiers of inactive conditional branches for new names
xperiandri Nov 8, 2026
e874f6c
Add refactorings that extract a selected expression into a local func…
xperiandri Sep 13, 2026
f424d02
Give an extracted lambda the function type the checker recorded for it
xperiandri Nov 8, 2026
8d6c8c9
Withhold function extraction of a mutable local any closure captures
xperiandri Nov 8, 2026
b7b1334
Withhold function extraction that would mutate a copy of a mutable st…
xperiandri Nov 8, 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
Expand Up @@ -2,7 +2,9 @@

* Suggest active-pattern cases from unopened modules and offer valid Add Open and qualification edits. ([PR #20719](https://github.com/dotnet/fsharp/pull/20719))
* 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))
* Move F# editor and Interactive options to 43 native Unified Settings with independent roaming and a one-time import of existing settings. Preserve the legacy groupings and Interactive setting order, with restart requirements displayed by Unified Settings. Quick Info's preferred description width is a checkbox with a dependent integer control. Remove the eight legacy options pages; the user-wide compiler setting remains external. Typing and deletion completion triggers are independent. ([PR #20877](https://github.com/dotnet/fsharp/pull/20877))
* Added a **Compiler** option in F# Unified Settings, **"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. 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 @@ -105,10 +105,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
27 changes: 27 additions & 0 deletions vsintegration/src/FSharp.Editor/FSharp.Editor.resx
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,21 @@
{2}</value>
<comment>Tooltip of an F# declaration in the Copilot Chat "#" picker, as Copilot shows a C# one. {0} is the kind of declaration (Class, Method, Field...), {1} the file name, {2} the declaration's name.</comment>
</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>
<data name="UnifiedSettingsIntelliSenseTitle" xml:space="preserve">
<value>IntelliSense</value>
</data>
Expand Down Expand Up @@ -348,6 +363,18 @@
<data name="UnifiedSettingsSolidUnderlineLabel" xml:space="preserve">
<value>Solid underline</value>
</data>
<data name="UnifiedSettingsExtractFunctionParameterAnnotationsTitle" xml:space="preserve">
<value>Parameter types in Extract to function</value>
</data>
<data name="UnifiedSettingsAnnotateParametersAlwaysLabel" xml:space="preserve">
<value>Annotate every parameter</value>
</data>
<data name="UnifiedSettingsAnnotateParametersWhenNeededLabel" xml:space="preserve">
<value>Annotate parameters whose type inference cannot determine from the extracted code</value>
</data>
<data name="UnifiedSettingsAnnotateParametersNeverLabel" xml:space="preserve">
<value>Leave parameter types to type inference</value>
</data>
<data name="UnifiedSettingsDescriptionWidthTitle" xml:space="preserve">
<value>Use a preferred description width</value>
</data>
Expand Down
17 changes: 17 additions & 0 deletions vsintegration/src/FSharp.Editor/Options/EditorOptions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ type QuickInfoOptions =
ShowRemarks = true
}

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

type CodeFixesOptions =
{
SimplifyName: bool
Expand All @@ -66,6 +72,7 @@ type CodeFixesOptions =
UnusedDeclarations: bool
SuggestNamesForErrors: bool
RemoveParens: bool
ExtractFunctionParameterAnnotations: ParameterAnnotationSetting
}

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

type LanguageServicePerformanceOptions =
Expand Down Expand Up @@ -196,6 +204,12 @@ type EditorOptions private (reader: ISettingsReader option) =
UnusedDeclarations = boolean "codeFixes.unusedDeclarations"
SuggestNamesForErrors = boolean "codeFixes.suggestNamesForErrors"
RemoveParens = boolean "codeFixes.removeParens"
ExtractFunctionParameterAnnotations =
match text "codeFixes.extractFunctionParameterAnnotations" with
| "Always" -> ParameterAnnotationSetting.Always
| "WhenNeeded" -> ParameterAnnotationSetting.WhenNeeded
| "Never" -> ParameterAnnotationSetting.Never
| value -> invalidOp $"Unknown F# parameter annotation setting: {value}."
}

register
Expand Down Expand Up @@ -309,6 +323,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
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module internal UnifiedSettingsMigration =
"UnusedDeclarations"
"SuggestNamesForErrors"
"RemoveParens"
"ExtractFunctionParameterAnnotations"
|]
"performance",
"LanguageServicePerformanceOptions",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,20 @@
"migration": { "roamingOnly": true },
"order": 5
},
"languages.fsharp.codeFixes.extractFunctionParameterAnnotations": {
"type": "string",
"title": "@FSharp.Editor:UnifiedSettingsExtractFunctionParameterAnnotationsTitle;FSharp.Editor.dll",
"enum": [ "Always", "WhenNeeded", "Never" ],
"enumItemLabels": [
"@FSharp.Editor:UnifiedSettingsAnnotateParametersAlwaysLabel;FSharp.Editor.dll",
"@FSharp.Editor:UnifiedSettingsAnnotateParametersWhenNeededLabel;FSharp.Editor.dll",
"@FSharp.Editor:UnifiedSettingsAnnotateParametersNeverLabel;FSharp.Editor.dll"
],
"default": "Always",
"transientScopesSupported": false,
"migration": { "roamingOnly": true },
"order": 6
},
"languages.fsharp.performance.enableInMemoryCrossProjectReferences": {
"type": "boolean",
"placements": [ { "category": "languages.fsharp.performance.projectAndCaching" } ],
Expand Down
Loading
Loading