Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.

Commit f1c50d5

Browse files
cartermpnosami
authored andcommitted
Sequentialize GetAllUsesOfAllSymolsInFile (dotnet#10357)
1 parent 285890a commit f1c50d5

File tree

5 files changed

+5
-18
lines changed

5 files changed

+5
-18
lines changed

CodeFix/SimplifyName.fs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,9 @@ open System.Composition
66
open System.Collections.Immutable
77
open System.Threading.Tasks
88

9-
open Microsoft.CodeAnalysis
10-
open Microsoft.CodeAnalysis.Diagnostics
119
open Microsoft.CodeAnalysis.Text
1210
open Microsoft.CodeAnalysis.CodeFixes
1311
open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics
14-
open SymbolHelpers
1512

1613
[<ExportCodeFixProvider(FSharpConstants.FSharpLanguageName, Name = "SimplifyNames"); Shared>]
1714
type internal FSharpSimplifyNameCodeFixProvider() =

Common/Extensions.fs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module internal Microsoft.VisualStudio.FSharp.Editor.Extensions
55

66
open System
77
open System.IO
8+
open System.Collections.Immutable
89

910
open Microsoft.CodeAnalysis
1011
open Microsoft.CodeAnalysis.Text
@@ -243,7 +244,6 @@ module Option =
243244

244245
[<RequireQualifiedAccess>]
245246
module Seq =
246-
open System.Collections.Immutable
247247

248248
let toImmutableArray (xs: seq<'a>) : ImmutableArray<'a> = xs.ToImmutableArray()
249249

@@ -257,6 +257,8 @@ module Array =
257257
i <- i + 1
258258
state
259259

260+
let toImmutableArray (xs: 'T[]) = xs.ToImmutableArray()
261+
260262
[<RequireQualifiedAccess>]
261263
module Exception =
262264

Diagnostics/SimplifyNameDiagnosticAnalyzer.fs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,13 @@ open System.Composition
77
open System.Collections.Immutable
88
open System.Diagnostics
99
open System.Threading
10-
open System.Threading.Tasks
1110

1211
open Microsoft.CodeAnalysis
13-
open Microsoft.CodeAnalysis.Diagnostics
14-
open FSharp.Compiler
1512
open FSharp.Compiler.Range
1613
open System.Runtime.Caching
17-
open Microsoft.CodeAnalysis.Host.Mef
1814
open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics
1915
open FSharp.Compiler.SourceCodeServices
2016

21-
type private TextVersionHash = int
2217
type private PerDocumentSavedData = { Hash: int; Diagnostics: ImmutableArray<Diagnostic> }
2318

2419
[<Export(typeof<IFSharpSimplifyNameDiagnosticAnalyzer>)>]
@@ -36,7 +31,7 @@ type internal SimplifyNameDiagnosticAnalyzer [<ImportingConstructor>] () =
3631

3732
interface IFSharpSimplifyNameDiagnosticAnalyzer with
3833

39-
member this.AnalyzeSemanticsAsync(descriptor, document: Document, cancellationToken: CancellationToken) =
34+
member _.AnalyzeSemanticsAsync(descriptor, document: Document, cancellationToken: CancellationToken) =
4035
asyncMaybe {
4136
do! Option.guard document.FSharpOptions.CodeFixes.SimplifyName
4237
do Trace.TraceInformation("{0:n3} (start) SimplifyName", DateTime.Now.TimeOfDay.TotalSeconds)

Diagnostics/UnusedDeclarationsAnalyzer.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type internal UnusedDeclarationsAnalyzer [<ImportingConstructor>] () =
2525

2626
interface IFSharpUnusedDeclarationsDiagnosticAnalyzer with
2727

28-
member __.AnalyzeSemanticsAsync(descriptor, document, cancellationToken) =
28+
member _.AnalyzeSemanticsAsync(descriptor, document, cancellationToken) =
2929
asyncMaybe {
3030
do! Option.guard document.FSharpOptions.CodeFixes.UnusedDeclarations
3131

Diagnostics/UnusedOpensDiagnosticAnalyzer.fs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,12 @@ open System.Composition
77
open System.Collections.Immutable
88
open System.Diagnostics
99
open System.Threading
10-
open System.Threading.Tasks
1110

1211
open Microsoft.CodeAnalysis
13-
open Microsoft.CodeAnalysis.Text
14-
open Microsoft.CodeAnalysis.Diagnostics
1512

16-
open FSharp.Compiler
1713
open FSharp.Compiler.Range
1814
open FSharp.Compiler.SourceCodeServices
19-
open FSharp.Compiler.SyntaxTree
2015

21-
open Microsoft.VisualStudio.FSharp.Editor.Symbols
22-
open Microsoft.CodeAnalysis.Host.Mef
2316
open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics
2417

2518
[<Export(typeof<IFSharpUnusedOpensDiagnosticAnalyzer>)>]

0 commit comments

Comments
 (0)