From b5d35c9774ee2ef7a5e8ea691bf68ce0f607d780 Mon Sep 17 00:00:00 2001 From: cartermp Date: Fri, 12 Mar 2021 10:31:49 -0800 Subject: [PATCH 1/4] Add refactoring to replace ! with .Value --- src/fsharp/service/FSharpParseFileResults.fs | 11 ++++ src/fsharp/service/FSharpParseFileResults.fsi | 3 + .../src/FSharp.Editor/FSharp.Editor.fsproj | 1 + .../src/FSharp.Editor/FSharp.Editor.resx | 3 + .../Refactor/ChangeDerefToValueRefactoring.fs | 64 +++++++++++++++++++ .../FSharp.Editor/xlf/FSharp.Editor.cs.xlf | 5 ++ .../FSharp.Editor/xlf/FSharp.Editor.de.xlf | 5 ++ .../FSharp.Editor/xlf/FSharp.Editor.es.xlf | 5 ++ .../FSharp.Editor/xlf/FSharp.Editor.fr.xlf | 5 ++ .../FSharp.Editor/xlf/FSharp.Editor.it.xlf | 5 ++ .../FSharp.Editor/xlf/FSharp.Editor.ja.xlf | 5 ++ .../FSharp.Editor/xlf/FSharp.Editor.ko.xlf | 5 ++ .../FSharp.Editor/xlf/FSharp.Editor.pl.xlf | 5 ++ .../FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf | 5 ++ .../FSharp.Editor/xlf/FSharp.Editor.ru.xlf | 5 ++ .../FSharp.Editor/xlf/FSharp.Editor.tr.xlf | 5 ++ .../xlf/FSharp.Editor.zh-Hans.xlf | 5 ++ .../xlf/FSharp.Editor.zh-Hant.xlf | 5 ++ 18 files changed, 147 insertions(+) create mode 100644 vsintegration/src/FSharp.Editor/Refactor/ChangeDerefToValueRefactoring.fs diff --git a/src/fsharp/service/FSharpParseFileResults.fs b/src/fsharp/service/FSharpParseFileResults.fs index e2bc5953b78..06cc402552a 100644 --- a/src/fsharp/service/FSharpParseFileResults.fs +++ b/src/fsharp/service/FSharpParseFileResults.fs @@ -334,6 +334,17 @@ type FSharpParseFileResults(diagnostics: FSharpDiagnostic[], input: ParsedInput, None | _ -> defaultTraverse expr }) + member _.TryRangeOfExpressionBeingDereferencedContainingPos expressionPos = + SyntaxTraversal.Traverse(expressionPos, input, { new SyntaxVisitorBase<_>() with + member _.VisitExpr(_, _, defaultTraverse, expr) = + match expr with + | SynExpr.App(_, false, SynExpr.Ident funcIdent, expr, _) -> + if funcIdent.idText = "op_Dereference" && rangeContainsPos expr.Range expressionPos then + Some expr.Range + else + None + | _ -> defaultTraverse expr }) + member _.FindParameterLocations pos = ParameterLocations.Find(pos, input) diff --git a/src/fsharp/service/FSharpParseFileResults.fsi b/src/fsharp/service/FSharpParseFileResults.fsi index 310bb02fcbe..cccc673558b 100644 --- a/src/fsharp/service/FSharpParseFileResults.fsi +++ b/src/fsharp/service/FSharpParseFileResults.fsi @@ -46,6 +46,9 @@ type public FSharpParseFileResults = /// member TryRangeOfRefCellDereferenceContainingPos: expressionPos: pos -> range option + /// Gets the range of an expression being dereferenced. For `!expr`, gives the range of `expr` + member TryRangeOfExpressionBeingDereferencedContainingPos: expressionPos: pos -> range option + /// Notable parse info for ParameterInfo at a given location member FindParameterLocations: pos:pos -> ParameterLocations option diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index 9315b599893..f3d7b63c0d1 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -116,6 +116,7 @@ + diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.resx b/vsintegration/src/FSharp.Editor/FSharp.Editor.resx index 68466c81559..10a1df42edb 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.resx +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.resx @@ -273,4 +273,7 @@ Use '<>' for inequality check + + Use '.Value' to dereference + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/Refactor/ChangeDerefToValueRefactoring.fs b/vsintegration/src/FSharp.Editor/Refactor/ChangeDerefToValueRefactoring.fs new file mode 100644 index 00000000000..73ae61a60b4 --- /dev/null +++ b/vsintegration/src/FSharp.Editor/Refactor/ChangeDerefToValueRefactoring.fs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace Microsoft.VisualStudio.FSharp.Editor + +open System +open System.Composition +open System.Threading + +open FSharp.Compiler +open FSharp.Compiler.CodeAnalysis +open FSharp.Compiler.Symbols +open FSharp.Compiler.Text +open FSharp.Compiler.Syntax + +open Microsoft.CodeAnalysis.Text +open Microsoft.CodeAnalysis.CodeRefactorings +open Microsoft.CodeAnalysis.CodeActions + +[] +type internal FSharpAddExplicitTypeToParameterRefactoring + [] + ( + checkerProvider: FSharpCheckerProvider, + projectInfoManager: FSharpProjectOptionsManager + ) = + inherit CodeRefactoringProvider() + + static let userOpName = "AddExplicitTypeToParameter" + + override _.ComputeRefactoringsAsync context = + asyncMaybe { + let document = context.Document + let! parsingOptions, _ = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document, context.CancellationToken, userOpName) + let! sourceText = context.Document.GetTextAsync(context.CancellationToken) + let! parseResults = checkerProvider.Checker.ParseFile(document.FilePath, sourceText.ToFSharpSourceText(), parsingOptions, userOpName=userOpName) |> liftAsync + + let selectionRange = RoslynHelpers.TextSpanToFSharpRange(document.FilePath, context.Span, sourceText) + let! derefRange = parseResults.TryRangeOfRefCellDereferenceContainingPos selectionRange.Start + let! exprRange = parseResults.TryRangeOfExpressionBeingDereferencedContainingPos selectionRange.Start + + let combinedRange = Range.unionRanges derefRange exprRange + let! combinedSpan = RoslynHelpers.TryFSharpRangeToTextSpan(sourceText, combinedRange) + let replacementString = + // Trim off the `! + sourceText.GetSubText(combinedSpan).ToString().[1..] + ".Value" + + let title = SR.UseValueInsteadOfDeref() + + let getChangedText (sourceText: SourceText) = + sourceText.WithChanges(TextChange(combinedSpan, replacementString)) + + let codeAction = + CodeAction.Create( + title, + (fun (cancellationToken: CancellationToken) -> + async { + let! sourceText = context.Document.GetTextAsync(cancellationToken) |> Async.AwaitTask + return context.Document.WithText(getChangedText sourceText) + } |> RoslynHelpers.StartAsyncAsTask(cancellationToken)), + title) + context.RegisterRefactoring(codeAction) + } + |> Async.Ignore + |> RoslynHelpers.StartAsyncUnitAsTask(context.CancellationToken) \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf index b7c7e461466..85d38c3c46f 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf @@ -257,6 +257,11 @@ Negovat výraz pomocí not + + Use '.Value' to dereference + Use '.Value' to dereference + + Wrap expression in parentheses Uzavřít výraz do závorek diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf index 81f0fb805f4..7f197237c84 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf @@ -257,6 +257,11 @@ "not" zum Negieren eines Ausdruck verwenden + + Use '.Value' to dereference + Use '.Value' to dereference + + Wrap expression in parentheses Ausdruck in Klammern einschließen diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf index 82b3c3dc8b5..2e5cafe17ff 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf @@ -257,6 +257,11 @@ Usar "not" para negar la expresión + + Use '.Value' to dereference + Use '.Value' to dereference + + Wrap expression in parentheses Encapsular la expresión entre paréntesis diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf index 7a5eeb6038e..52e26b783bf 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf @@ -257,6 +257,11 @@ Utiliser 'not' pour annuler l'expression + + Use '.Value' to dereference + Use '.Value' to dereference + + Wrap expression in parentheses Mettre l'expression entre parenthèses diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf index 0c734760f8e..db330b20743 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf @@ -257,6 +257,11 @@ Usare 'not' per negare l'espressione + + Use '.Value' to dereference + Use '.Value' to dereference + + Wrap expression in parentheses Racchiudere l'espressione tra parentesi diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf index b295d28b496..610145261aa 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf @@ -257,6 +257,11 @@ 式を否定するには 'not' を使用する + + Use '.Value' to dereference + Use '.Value' to dereference + + Wrap expression in parentheses 式をかっこで囲む diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf index d07b4e00079..0ba2f418ca6 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf @@ -257,6 +257,11 @@ 식을 부정하려면 'not' 사용 + + Use '.Value' to dereference + Use '.Value' to dereference + + Wrap expression in parentheses 식을 괄호로 래핑 diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf index 7e04e28c303..faf622e49dd 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf @@ -257,6 +257,11 @@ Użyj operatora „not”, aby zanegować wyrażenie + + Use '.Value' to dereference + Use '.Value' to dereference + + Wrap expression in parentheses Ujmij wyrażenie w nawiasy diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf index b5a9a077815..97fa5b6eb50 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf @@ -257,6 +257,11 @@ Use 'not' para negar a expressão + + Use '.Value' to dereference + Use '.Value' to dereference + + Wrap expression in parentheses Coloque a expressão entre parênteses diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf index 508c9c4ab6e..56929e353eb 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf @@ -257,6 +257,11 @@ Используйте "not" для отрицания выражения. + + Use '.Value' to dereference + Use '.Value' to dereference + + Wrap expression in parentheses Заключите выражение в круглые скобки. diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf index 02937e23c91..300a76f76e4 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf @@ -257,6 +257,11 @@ İfadeyi negatif yapmak için 'not' kullanın + + Use '.Value' to dereference + Use '.Value' to dereference + + Wrap expression in parentheses İfadeyi parantez içinde sarmalayın diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf index b30d5243dcf..b1dc5e77121 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf @@ -257,6 +257,11 @@ 使用 "not" 对表达式求反 + + Use '.Value' to dereference + Use '.Value' to dereference + + Wrap expression in parentheses 将表达式用括号括起来 diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf index 9b9d615aa0d..a8d566497d0 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf @@ -257,6 +257,11 @@ 使用 'not' 來否定運算式 + + Use '.Value' to dereference + Use '.Value' to dereference + + Wrap expression in parentheses 使用括弧包裝運算式 From 73c69bffbc3a29a83138cc26fcc69e1e85d5423f Mon Sep 17 00:00:00 2001 From: cartermp Date: Fri, 12 Mar 2021 12:20:01 -0800 Subject: [PATCH 2/4] Update message and area --- .../FSharp.Compiler.Service.Tests/SurfaceArea.netstandard.fs | 1 + vsintegration/src/FSharp.Editor/FSharp.Editor.resx | 2 +- .../FSharp.Editor/Refactor/ChangeDerefToValueRefactoring.fs | 2 +- vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf | 4 ++-- vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf | 4 ++-- vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf | 4 ++-- vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf | 4 ++-- vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf | 4 ++-- vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf | 4 ++-- vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf | 4 ++-- vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf | 4 ++-- vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf | 4 ++-- vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf | 4 ++-- vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf | 4 ++-- vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf | 4 ++-- vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf | 4 ++-- 16 files changed, 29 insertions(+), 28 deletions(-) diff --git a/tests/FSharp.Compiler.Service.Tests/SurfaceArea.netstandard.fs b/tests/FSharp.Compiler.Service.Tests/SurfaceArea.netstandard.fs index 55aca926c74..d9e05ee8d01 100644 --- a/tests/FSharp.Compiler.Service.Tests/SurfaceArea.netstandard.fs +++ b/tests/FSharp.Compiler.Service.Tests/SurfaceArea.netstandard.fs @@ -1496,6 +1496,7 @@ FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Microsoft.FSharp.Core.FShar FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] TryRangeOfNameOfNearestOuterBindingContainingPos(FSharp.Compiler.Text.Position) FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] TryRangeOfRecordExpressionContainingPos(FSharp.Compiler.Text.Position) FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] TryRangeOfRefCellDereferenceContainingPos(FSharp.Compiler.Text.Position) +FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] TryRangeOfExpressionBeingDereferencedContainingPos(FSharp.Compiler.Text.Position) FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Microsoft.FSharp.Core.FSharpOption`1[FSharp.Compiler.Text.Range] ValidateBreakpointLocation(FSharp.Compiler.Text.Position) FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Microsoft.FSharp.Core.FSharpOption`1[Microsoft.FSharp.Collections.FSharpList`1[FSharp.Compiler.Text.Range]] GetAllArgumentsForFunctionApplicationAtPostion(FSharp.Compiler.Text.Position) FSharp.Compiler.CodeAnalysis.FSharpParseFileResults: Microsoft.FSharp.Core.FSharpOption`1[System.Tuple`2[FSharp.Compiler.Syntax.Ident,System.Int32]] TryIdentOfPipelineContainingPosAndNumArgsApplied(FSharp.Compiler.Text.Position) diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.resx b/vsintegration/src/FSharp.Editor/FSharp.Editor.resx index 10a1df42edb..cf0308bf25e 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.resx +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.resx @@ -274,6 +274,6 @@ Use '<>' for inequality check - Use '.Value' to dereference + Use '.Value' to dereference expression \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/Refactor/ChangeDerefToValueRefactoring.fs b/vsintegration/src/FSharp.Editor/Refactor/ChangeDerefToValueRefactoring.fs index 73ae61a60b4..672c2e4ec5c 100644 --- a/vsintegration/src/FSharp.Editor/Refactor/ChangeDerefToValueRefactoring.fs +++ b/vsintegration/src/FSharp.Editor/Refactor/ChangeDerefToValueRefactoring.fs @@ -41,7 +41,7 @@ type internal FSharpAddExplicitTypeToParameterRefactoring let combinedRange = Range.unionRanges derefRange exprRange let! combinedSpan = RoslynHelpers.TryFSharpRangeToTextSpan(sourceText, combinedRange) let replacementString = - // Trim off the `! + // Trim off the `!` sourceText.GetSubText(combinedSpan).ToString().[1..] + ".Value" let title = SR.UseValueInsteadOfDeref() diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf index 85d38c3c46f..6a8b4752342 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf @@ -258,8 +258,8 @@ - Use '.Value' to dereference - Use '.Value' to dereference + Use '.Value' to dereference expression + Use '.Value' to dereference expression diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf index 7f197237c84..918ca673fdd 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf @@ -258,8 +258,8 @@ - Use '.Value' to dereference - Use '.Value' to dereference + Use '.Value' to dereference expression + Use '.Value' to dereference expression diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf index 2e5cafe17ff..20101f8448b 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf @@ -258,8 +258,8 @@ - Use '.Value' to dereference - Use '.Value' to dereference + Use '.Value' to dereference expression + Use '.Value' to dereference expression diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf index 52e26b783bf..ebc64912a74 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf @@ -258,8 +258,8 @@ - Use '.Value' to dereference - Use '.Value' to dereference + Use '.Value' to dereference expression + Use '.Value' to dereference expression diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf index db330b20743..d738a59b5fe 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf @@ -258,8 +258,8 @@ - Use '.Value' to dereference - Use '.Value' to dereference + Use '.Value' to dereference expression + Use '.Value' to dereference expression diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf index 610145261aa..6c61b93bd5d 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf @@ -258,8 +258,8 @@ - Use '.Value' to dereference - Use '.Value' to dereference + Use '.Value' to dereference expression + Use '.Value' to dereference expression diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf index 0ba2f418ca6..10603cedc1e 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf @@ -258,8 +258,8 @@ - Use '.Value' to dereference - Use '.Value' to dereference + Use '.Value' to dereference expression + Use '.Value' to dereference expression diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf index faf622e49dd..3219326a16a 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf @@ -258,8 +258,8 @@ - Use '.Value' to dereference - Use '.Value' to dereference + Use '.Value' to dereference expression + Use '.Value' to dereference expression diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf index 97fa5b6eb50..2a91abeceae 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf @@ -258,8 +258,8 @@ - Use '.Value' to dereference - Use '.Value' to dereference + Use '.Value' to dereference expression + Use '.Value' to dereference expression diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf index 56929e353eb..cad674c7df5 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf @@ -258,8 +258,8 @@ - Use '.Value' to dereference - Use '.Value' to dereference + Use '.Value' to dereference expression + Use '.Value' to dereference expression diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf index 300a76f76e4..1d5f6f4b702 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf @@ -258,8 +258,8 @@ - Use '.Value' to dereference - Use '.Value' to dereference + Use '.Value' to dereference expression + Use '.Value' to dereference expression diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf index b1dc5e77121..3921180cf70 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf @@ -258,8 +258,8 @@ - Use '.Value' to dereference - Use '.Value' to dereference + Use '.Value' to dereference expression + Use '.Value' to dereference expression diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf index a8d566497d0..40658c1844f 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf @@ -258,8 +258,8 @@ - Use '.Value' to dereference - Use '.Value' to dereference + Use '.Value' to dereference expression + Use '.Value' to dereference expression From 43a1e7e29cd41458bc56803b4d9c860366cf8a25 Mon Sep 17 00:00:00 2001 From: cartermp Date: Fri, 12 Mar 2021 13:16:03 -0800 Subject: [PATCH 3/4] rename type lol --- .../Refactor/ChangeDerefToValueRefactoring.fs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/Refactor/ChangeDerefToValueRefactoring.fs b/vsintegration/src/FSharp.Editor/Refactor/ChangeDerefToValueRefactoring.fs index 672c2e4ec5c..7958133727b 100644 --- a/vsintegration/src/FSharp.Editor/Refactor/ChangeDerefToValueRefactoring.fs +++ b/vsintegration/src/FSharp.Editor/Refactor/ChangeDerefToValueRefactoring.fs @@ -16,8 +16,8 @@ open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeRefactorings open Microsoft.CodeAnalysis.CodeActions -[] -type internal FSharpAddExplicitTypeToParameterRefactoring +[] +type internal FSharpChangeDerefToValueRefactoring [] ( checkerProvider: FSharpCheckerProvider, @@ -25,7 +25,7 @@ type internal FSharpAddExplicitTypeToParameterRefactoring ) = inherit CodeRefactoringProvider() - static let userOpName = "AddExplicitTypeToParameter" + static let userOpName = "ChangeDerefToValue" override _.ComputeRefactoringsAsync context = asyncMaybe { @@ -61,4 +61,4 @@ type internal FSharpAddExplicitTypeToParameterRefactoring context.RegisterRefactoring(codeAction) } |> Async.Ignore - |> RoslynHelpers.StartAsyncUnitAsTask(context.CancellationToken) \ No newline at end of file + |> RoslynHelpers.StartAsyncUnitAsTask(context.CancellationToken) From 913c2c50dbe911c6685563e1b58fe874702e9f0c Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Sat, 13 Mar 2021 07:36:12 -0800 Subject: [PATCH 4/4] Update FSharp.Editor.fsproj --- vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index a15479d22f9..1344d7e180d 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -90,6 +90,7 @@ + @@ -117,7 +118,6 @@ -