diff --git a/AutomaticCompletion/BraceCompletionSessionProvider.fs b/AutomaticCompletion/BraceCompletionSessionProvider.fs index 0ee68698c2e..184dbcf959d 100644 --- a/AutomaticCompletion/BraceCompletionSessionProvider.fs +++ b/AutomaticCompletion/BraceCompletionSessionProvider.fs @@ -76,11 +76,11 @@ type BraceCompletionSession let mutable openingPoint : ITrackingPoint = null let editorOperations = editorOperationsFactoryService.GetEditorOperations(textView) - member __.EndSession() = + member _.EndSession() = closingPoint <- null openingPoint <- null - member __.CreateUndoTransaction() = + member _.CreateUndoTransaction() = undoHistory.CreateTransaction(BraceCompletion) member this.Start (cancellationToken: CancellationToken) = @@ -148,7 +148,7 @@ type BraceCompletionSession undo.Complete() - member __.HasNoForwardTyping(caretPoint: SnapshotPoint, endPoint: SnapshotPoint) = + member _.HasNoForwardTyping(caretPoint: SnapshotPoint, endPoint: SnapshotPoint) = Debug.Assert(caretPoint.Snapshot = endPoint.Snapshot, "snapshots do not match") if caretPoint.Snapshot = endPoint.Snapshot then @@ -173,7 +173,7 @@ type BraceCompletionSession else false - member __.MoveCaretToClosingPoint() = + member _.MoveCaretToClosingPoint() = let closingSnapshotPoint = closingPoint.GetPoint(subjectBuffer.CurrentSnapshot) // find the position just after the closing brace in the view's text buffer @@ -217,7 +217,7 @@ type BraceCompletionSession undo.Complete() this.EndSession() - member __.PostBackspace() = () + member _.PostBackspace() = () member this.PreOverType handledCommand = handledCommand <- false @@ -259,7 +259,7 @@ type BraceCompletionSession undo.Complete() | _ -> () - member __.PostOverType() = () + member _.PostOverType() = () member this.PreTab handledCommand = handledCommand <- false @@ -274,7 +274,7 @@ type BraceCompletionSession editorOperations.AddAfterTextBufferChangePrimitive() undo.Complete() - member __.PreReturn handledCommand = + member _.PreReturn handledCommand = handledCommand <- false member this.PostReturn() = @@ -286,26 +286,26 @@ type BraceCompletionSession session.AfterReturn(this, CancellationToken.None) | _ -> () - member __.Finish() = () + member _.Finish() = () - member __.PostTab() = () + member _.PostTab() = () - member __.PreDelete handledCommand = + member _.PreDelete handledCommand = handledCommand <- false - member __.PostDelete() = () + member _.PostDelete() = () - member __.OpeningBrace = openingBrace + member _.OpeningBrace = openingBrace - member __.ClosingBrace = closingBrace + member _.ClosingBrace = closingBrace - member __.OpeningPoint = openingPoint + member _.OpeningPoint = openingPoint - member __.ClosingPoint = closingPoint + member _.ClosingPoint = closingPoint - member __.SubjectBuffer = subjectBuffer + member _.SubjectBuffer = subjectBuffer - member __.TextView = textView + member _.TextView = textView module Parenthesis = @@ -372,50 +372,50 @@ type ParenthesisCompletionSession() = interface IEditorBraceCompletionSession with - member __.AfterReturn(_session, _cancellationToken) = + member _.AfterReturn(_session, _cancellationToken) = () - member __.AfterStart(_session, _cancellationToken) = + member _.AfterStart(_session, _cancellationToken) = () - member __.AllowOverType(_session, _cancellationToken) = + member _.AllowOverType(_session, _cancellationToken) = true - member __.CheckOpeningPoint(_session, _cancellationToken) = + member _.CheckOpeningPoint(_session, _cancellationToken) = true type DoubleQuoteCompletionSession() = interface IEditorBraceCompletionSession with - member __.AfterReturn(_session, _cancellationToken) = + member _.AfterReturn(_session, _cancellationToken) = () - member __.AfterStart(_session, _cancellationToken) = + member _.AfterStart(_session, _cancellationToken) = () - member __.AllowOverType(_session, _cancellationToken) = + member _.AllowOverType(_session, _cancellationToken) = true - member __.CheckOpeningPoint(_session, _cancellationToken) = + member _.CheckOpeningPoint(_session, _cancellationToken) = true type VerticalBarCompletionSession() = interface IEditorBraceCompletionSession with - member __.AfterReturn(_session, _cancellationToken) = + member _.AfterReturn(_session, _cancellationToken) = () - member __.AfterStart(_session, _cancellationToken) = + member _.AfterStart(_session, _cancellationToken) = () - member __.AllowOverType(_session, _cancellationToken) = + member _.AllowOverType(_session, _cancellationToken) = true (* This is for [| |] and {| |} , since the implementation deals with chars only. We have to test if there is a { or [ before the cursor position and insert the closing '|'. *) - member __.CheckOpeningPoint(session, _cancellationToken) = + member _.CheckOpeningPoint(session, _cancellationToken) = tryInsertAdditionalBracePair session CurlyBrackets.OpenCharacter CurlyBrackets.CloseCharacter || tryInsertAdditionalBracePair session SquareBrackets.OpenCharacter SquareBrackets.CloseCharacter @@ -423,18 +423,18 @@ type AngleBracketCompletionSession() = interface IEditorBraceCompletionSession with - member __.AfterReturn(_session, _cancellationToken) = + member _.AfterReturn(_session, _cancellationToken) = () - member __.AfterStart(_session, _cancellationToken) = + member _.AfterStart(_session, _cancellationToken) = () - member __.AllowOverType(_session, _cancellationToken) = + member _.AllowOverType(_session, _cancellationToken) = true (* This is for attributes [< >] , since the implementation deals with chars only. We have to test if there is a [ before the cursor position and insert the closing '>'. *) - member __.CheckOpeningPoint(session, _cancellationToken) = + member _.CheckOpeningPoint(session, _cancellationToken) = tryInsertAdditionalBracePair session SquareBrackets.OpenCharacter SquareBrackets.CloseCharacter (* For multi-line comments, test if it is between "()" *) @@ -442,18 +442,18 @@ type AsteriskCompletionSession() = interface IEditorBraceCompletionSession with - member __.AfterReturn(_session, _cancellationToken) = + member _.AfterReturn(_session, _cancellationToken) = () - member __.AfterStart(_session, _cancellationToken) = + member _.AfterStart(_session, _cancellationToken) = () - member __.AllowOverType(_session, _cancellationToken) = + member _.AllowOverType(_session, _cancellationToken) = true (* This is for attributes [< >] , since the implementation deals with chars only. We have to test if there is a [ before the cursor position and insert the closing '>'. *) - member __.CheckOpeningPoint(session, _cancellationToken) = + member _.CheckOpeningPoint(session, _cancellationToken) = tryInsertAdditionalBracePair session Parenthesis.OpenCharacter Parenthesis.CloseCharacter [, FSharpConstants.FSharpLanguageName)>] @@ -465,14 +465,14 @@ type EditorBraceCompletionSessionFactory() = | ClassificationTypeNames.StringLiteral -> false | _ -> true - member __.IsSupportedOpeningBrace openingBrace = + member _.IsSupportedOpeningBrace openingBrace = match openingBrace with | Parenthesis.OpenCharacter | CurlyBrackets.OpenCharacter | SquareBrackets.OpenCharacter | DoubleQuote.OpenCharacter | VerticalBar.OpenCharacter | AngleBrackets.OpenCharacter | Asterisk.OpenCharacter -> true | _ -> false - member __.CheckCodeContext(document: Document, position: int, _openingBrace:char, cancellationToken) = + member _.CheckCodeContext(document: Document, position: int, _openingBrace:char, cancellationToken) = // We need to know if we are inside a F# string or comment. If we are, then don't do automatic completion. let sourceCodeTask = document.GetTextAsync(cancellationToken) sourceCodeTask.Wait(cancellationToken) @@ -504,7 +504,7 @@ type EditorBraceCompletionSessionFactory() = // classifiedSpan.TextSpan.IntersectsWith position && // not (spanIsString classifiedSpan))))) - member __.CreateEditorSession(_document, _openingPosition, openingBrace, _cancellationToken) = + member _.CreateEditorSession(_document, _openingPosition, openingBrace, _cancellationToken) = match openingBrace with | Parenthesis.OpenCharacter -> ParenthesisCompletionSession() :> IEditorBraceCompletionSession | CurlyBrackets.OpenCharacter -> ParenthesisCompletionSession() :> IEditorBraceCompletionSession @@ -541,7 +541,7 @@ type BraceCompletionSessionProvider interface IBraceCompletionSessionProvider with - member __.TryCreateSession(textView, openingPoint, openingBrace, closingBrace, session) = + member _.TryCreateSession(textView, openingPoint, openingBrace, closingBrace, session) = session <- maybe { let! document = openingPoint.Snapshot.GetOpenDocumentInCurrentContextWithChanges() |> Option.ofObj diff --git a/Build/SetGlobalPropertiesForSdkProjects.fs b/Build/SetGlobalPropertiesForSdkProjects.fs index dde8fbc04bc..3cfb5bf14ca 100644 --- a/Build/SetGlobalPropertiesForSdkProjects.fs +++ b/Build/SetGlobalPropertiesForSdkProjects.fs @@ -22,6 +22,6 @@ type internal SetGlobalPropertiesForSdkProjects ) = inherit StaticGlobalPropertiesProviderBase(projectService.Services) - override __.GetGlobalPropertiesAsync(_cancellationToken: CancellationToken): Task> = + override _.GetGlobalPropertiesAsync(_cancellationToken: CancellationToken): Task> = let properties = Empty.PropertiesMap.Add("FSharpCompilerPath", Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)) Task.FromResult>(properties) diff --git a/Classification/ClassificationService.fs b/Classification/ClassificationService.fs index 4ebabbf29d0..3cbf55b9f13 100644 --- a/Classification/ClassificationService.fs +++ b/Classification/ClassificationService.fs @@ -17,6 +17,10 @@ open Microsoft.CodeAnalysis.Host.Mef open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Classification +open Microsoft.CodeAnalysis +open FSharp.Compiler.SourceCodeServices +open FSharp.Compiler.Text + // IEditorClassificationService is marked as Obsolete, but is still supported. The replacement (IClassificationService) // is internal to Microsoft.CodeAnalysis.Workspaces which we don't have internals visible to. Rather than add yet another // IVT, we'll maintain the status quo. @@ -24,11 +28,7 @@ open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Classification #nowarn "57" -open Microsoft.CodeAnalysis -open FSharp.Compiler.Range -open FSharp.Compiler.SourceCodeServices - -type SemanticClassificationData = (struct(FSharp.Compiler.Range.range * SemanticClassificationType)[]) +type SemanticClassificationData = (struct(Range * SemanticClassificationType)[]) type SemanticClassificationLookup = IReadOnlyDictionary> [] @@ -118,7 +118,7 @@ type internal FSharpClassificationService | _ -> () static let toSemanticClassificationLookup (data: SemanticClassificationData) = - let lookup = System.Collections.Generic.Dictionary>() + let lookup = System.Collections.Generic.Dictionary>() for i = 0 to data.Length - 1 do let (struct(r, _) as dataItem) = data.[i] let items = @@ -135,9 +135,9 @@ type internal FSharpClassificationService interface IFSharpClassificationService with // Do not perform classification if we don't have project options (#defines matter) - member __.AddLexicalClassifications(_: SourceText, _: TextSpan, _: List, _: CancellationToken) = () + member _.AddLexicalClassifications(_: SourceText, _: TextSpan, _: List, _: CancellationToken) = () - member __.AddSyntacticClassificationsAsync(document: Document, textSpan: TextSpan, result: List, cancellationToken: CancellationToken) = + member _.AddSyntacticClassificationsAsync(document: Document, textSpan: TextSpan, result: List, cancellationToken: CancellationToken) = async { use _logBlock = Logger.LogBlock(LogEditorFunctionId.Classification_Syntactic) @@ -153,7 +153,7 @@ type internal FSharpClassificationService result.AddRange(Tokenizer.getClassifiedSpans(document.Id, sourceText, textSpan, Some(document.FilePath), defines, cancellationToken)) } |> RoslynHelpers.StartAsyncUnitAsTask cancellationToken - member __.AddSemanticClassificationsAsync(document: Document, textSpan: TextSpan, result: List, cancellationToken: CancellationToken) = + member _.AddSemanticClassificationsAsync(document: Document, textSpan: TextSpan, result: List, cancellationToken: CancellationToken) = asyncMaybe { use _logBlock = Logger.LogBlock(LogEditorFunctionId.Classification_Semantic) @@ -181,6 +181,6 @@ type internal FSharpClassificationService |> Async.Ignore |> RoslynHelpers.StartAsyncUnitAsTask cancellationToken // Do not perform classification if we don't have project options (#defines matter) - member __.AdjustStaleClassification(_: SourceText, classifiedSpan: ClassifiedSpan) : ClassifiedSpan = classifiedSpan + member _.AdjustStaleClassification(_: SourceText, classifiedSpan: ClassifiedSpan) : ClassifiedSpan = classifiedSpan diff --git a/CodeFix/AddOpenCodeFixProvider.fs b/CodeFix/AddOpenCodeFixProvider.fs index 8f72c4e6363..bebd293bff2 100644 --- a/CodeFix/AddOpenCodeFixProvider.fs +++ b/CodeFix/AddOpenCodeFixProvider.fs @@ -12,9 +12,8 @@ open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes open Microsoft.CodeAnalysis.CodeActions -open FSharp.Compiler -open FSharp.Compiler.Range open FSharp.Compiler.SourceCodeServices +open FSharp.Compiler.Text [] type internal FSharpAddOpenCodeFixProvider diff --git a/CodeFix/ChangeRefCellDerefToNotExpression.fs b/CodeFix/ChangeRefCellDerefToNotExpression.fs index 0d7b80e9d96..05372cac995 100644 --- a/CodeFix/ChangeRefCellDerefToNotExpression.fs +++ b/CodeFix/ChangeRefCellDerefToNotExpression.fs @@ -20,7 +20,7 @@ type internal FSharpChangeRefCellDerefToNotExpressionCodeFixProvider static let userOpName = "FSharpChangeRefCellDerefToNotExpressionCodeFix" let fixableDiagnosticIds = set ["FS0001"] - override __.FixableDiagnosticIds = Seq.toImmutableArray fixableDiagnosticIds + override _.FixableDiagnosticIds = Seq.toImmutableArray fixableDiagnosticIds override this.RegisterCodeFixesAsync context : Task = asyncMaybe { diff --git a/CodeFix/ChangeToUpcast.fs b/CodeFix/ChangeToUpcast.fs index cc28cdc0a52..cdc95a9e643 100644 --- a/CodeFix/ChangeToUpcast.fs +++ b/CodeFix/ChangeToUpcast.fs @@ -14,7 +14,7 @@ type internal FSharpChangeToUpcastCodeFixProvider() = let fixableDiagnosticIds = set ["FS3198"] - override __.FixableDiagnosticIds = Seq.toImmutableArray fixableDiagnosticIds + override _.FixableDiagnosticIds = Seq.toImmutableArray fixableDiagnosticIds override this.RegisterCodeFixesAsync context : Task = asyncMaybe { diff --git a/CodeFix/ConvertToSingleEqualsEqualityExpression.fs b/CodeFix/ConvertToSingleEqualsEqualityExpression.fs index e87538d1b88..adf33f1d17b 100644 --- a/CodeFix/ConvertToSingleEqualsEqualityExpression.fs +++ b/CodeFix/ConvertToSingleEqualsEqualityExpression.fs @@ -16,7 +16,7 @@ type internal FSharpConvertToSingleEqualsEqualityExpressionCodeFixProvider() = let fixableDiagnosticIds = set ["FS0043"] - override __.FixableDiagnosticIds = Seq.toImmutableArray fixableDiagnosticIds + override _.FixableDiagnosticIds = Seq.toImmutableArray fixableDiagnosticIds override this.RegisterCodeFixesAsync context : Task = asyncMaybe { diff --git a/CodeFix/ImplementInterfaceCodeFixProvider.fs b/CodeFix/ImplementInterfaceCodeFixProvider.fs index 170f6432f27..20ddcac69df 100644 --- a/CodeFix/ImplementInterfaceCodeFixProvider.fs +++ b/CodeFix/ImplementInterfaceCodeFixProvider.fs @@ -12,9 +12,9 @@ open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes open Microsoft.CodeAnalysis.CodeActions -open FSharp.Compiler.Range open FSharp.Compiler.SourceCodeServices open FSharp.Compiler.SyntaxTree +open FSharp.Compiler.Text [] type internal InterfaceState = @@ -133,9 +133,9 @@ type internal FSharpImplementInterfaceCodeFixProvider else () - override __.FixableDiagnosticIds = Seq.toImmutableArray fixableDiagnosticIds + override _.FixableDiagnosticIds = Seq.toImmutableArray fixableDiagnosticIds - override __.RegisterCodeFixesAsync context : Task = + override _.RegisterCodeFixesAsync context : Task = asyncMaybe { let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(context.Document, context.CancellationToken, userOpName) let cancellationToken = context.CancellationToken diff --git a/CodeFix/MakeDeclarationMutable.fs b/CodeFix/MakeDeclarationMutable.fs index 6cf351d43d8..bb837529cc9 100644 --- a/CodeFix/MakeDeclarationMutable.fs +++ b/CodeFix/MakeDeclarationMutable.fs @@ -9,8 +9,8 @@ open System.Threading.Tasks open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes -open FSharp.Compiler.Range open FSharp.Compiler.SourceCodeServices +open FSharp.Compiler.Text [] type internal FSharpMakeDeclarationMutableFixProvider diff --git a/CodeFix/MissingReferenceCodeFixProvider.fs b/CodeFix/MissingReferenceCodeFixProvider.fs index d44fc942075..9f9ab08d51d 100644 --- a/CodeFix/MissingReferenceCodeFixProvider.fs +++ b/CodeFix/MissingReferenceCodeFixProvider.fs @@ -46,9 +46,9 @@ type internal MissingReferenceCodeFixProvider() = ), title) - override __.FixableDiagnosticIds = Seq.toImmutableArray [fixableDiagnosticId] + override _.FixableDiagnosticIds = Seq.toImmutableArray [fixableDiagnosticId] - override __.RegisterCodeFixesAsync context : Task = + override _.RegisterCodeFixesAsync context : Task = async { let solution = context.Document.Project.Solution diff --git a/CodeFix/RemoveUnusedOpens.fs b/CodeFix/RemoveUnusedOpens.fs index c871c5c25f2..1cc40bfa47b 100644 --- a/CodeFix/RemoveUnusedOpens.fs +++ b/CodeFix/RemoveUnusedOpens.fs @@ -9,7 +9,7 @@ open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics -open FSharp.Compiler.Range +open FSharp.Compiler.Text [] type internal FSharpRemoveUnusedOpensCodeFixProvider @@ -56,5 +56,5 @@ type internal FSharpRemoveUnusedOpensCodeFixProvider |> Async.Ignore |> RoslynHelpers.StartAsyncUnitAsTask(context.CancellationToken) - override __.GetFixAllProvider() = WellKnownFixAllProviders.BatchFixer + override _.GetFixAllProvider() = WellKnownFixAllProviders.BatchFixer \ No newline at end of file diff --git a/CodeFix/RenameUnusedValue.fs b/CodeFix/RenameUnusedValue.fs index 856c3f575e5..55e7434b4fb 100644 --- a/CodeFix/RenameUnusedValue.fs +++ b/CodeFix/RenameUnusedValue.fs @@ -4,15 +4,11 @@ namespace Microsoft.VisualStudio.FSharp.Editor open System open System.Composition -open System.Threading open System.Threading.Tasks -open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes -open Microsoft.CodeAnalysis.CodeActions -open FSharp.Compiler open FSharp.Compiler.SourceCodeServices [] @@ -28,9 +24,9 @@ type internal FSharpRenameUnusedValueCodeFixProvider let fixableDiagnosticIds = set ["FS1182"] let checker = checkerProvider.Checker - override __.FixableDiagnosticIds = Seq.toImmutableArray fixableDiagnosticIds + override _.FixableDiagnosticIds = Seq.toImmutableArray fixableDiagnosticIds - override __.RegisterCodeFixesAsync context : Task = + override _.RegisterCodeFixesAsync context : Task = asyncMaybe { // Don't show code fixes for unused values, even if they are compiler-generated. do! Option.guard context.Document.FSharpOptions.CodeFixes.UnusedDeclarations diff --git a/CodeFix/ReplaceWithSuggestion.fs b/CodeFix/ReplaceWithSuggestion.fs index 665897919eb..d4addf4295e 100644 --- a/CodeFix/ReplaceWithSuggestion.fs +++ b/CodeFix/ReplaceWithSuggestion.fs @@ -8,9 +8,8 @@ open System.Threading.Tasks open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes -open FSharp.Compiler open FSharp.Compiler.SourceCodeServices -open FSharp.Compiler.Range +open FSharp.Compiler.Text [] type internal FSharpReplaceWithSuggestionCodeFixProvider diff --git a/CodeFix/UseMutationWhenValueIsMutable.fs b/CodeFix/UseMutationWhenValueIsMutable.fs index 67003759d0a..23ea17990c8 100644 --- a/CodeFix/UseMutationWhenValueIsMutable.fs +++ b/CodeFix/UseMutationWhenValueIsMutable.fs @@ -10,7 +10,7 @@ open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes open FSharp.Compiler.SourceCodeServices -open FSharp.Compiler.Range +open FSharp.Compiler.Text [] type internal FSharpUseMutationWhenValueIsMutableFixProvider diff --git a/CodeFix/WrapExpressionInParentheses.fs b/CodeFix/WrapExpressionInParentheses.fs index b6e41206a9c..75ee2d9a866 100644 --- a/CodeFix/WrapExpressionInParentheses.fs +++ b/CodeFix/WrapExpressionInParentheses.fs @@ -16,7 +16,7 @@ type internal FSharpWrapExpressionInParenthesesFixProvider() = let fixableDiagnosticIds = set ["FS0597"] - override __.FixableDiagnosticIds = Seq.toImmutableArray fixableDiagnosticIds + override _.FixableDiagnosticIds = Seq.toImmutableArray fixableDiagnosticIds override this.RegisterCodeFixesAsync context : Task = async { diff --git a/CodeLens/AbstractCodeLensDisplayService.fs b/CodeLens/AbstractCodeLensDisplayService.fs index 0c21690fc41..ba21dabebde 100644 --- a/CodeLens/AbstractCodeLensDisplayService.fs +++ b/CodeLens/AbstractCodeLensDisplayService.fs @@ -64,11 +64,11 @@ type CodeLensDisplayService (view : IWpfTextView, buffer : ITextBuffer, layerNam member val CurrentBufferSnapshot = null with get, set /// Helper method which returns the start line number of a tracking span - member __.GetTrackingSpanStartLine (snapshot:ITextSnapshot) (trackingSpan:ITrackingSpan) = + member _.GetTrackingSpanStartLine (snapshot:ITextSnapshot) (trackingSpan:ITrackingSpan) = snapshot.GetLineNumberFromPosition(trackingSpan.GetStartPoint(snapshot).Position) /// Helper method which returns the start line number of a tracking span - member __.TryGetTSpanStartLine (snapshot:ITextSnapshot) (trackingSpan:ITrackingSpan) = + member _.TryGetTSpanStartLine (snapshot:ITextSnapshot) (trackingSpan:ITrackingSpan) = let pos = trackingSpan.GetStartPoint(snapshot).Position if snapshot.Length - 1 < pos then None else pos |> snapshot.GetLineNumberFromPosition |> Some @@ -110,7 +110,7 @@ type CodeLensDisplayService (view : IWpfTextView, buffer : ITextBuffer, layerNam let mutable element = self.UiElements.[trackingSpan] element.Visibility <- Visibility.Hidden - member __.CreateDefaultStackPanel () = + member _.CreateDefaultStackPanel () = let grid = Grid(Visibility = Visibility.Hidden) Canvas.SetLeft(grid, 0.) Canvas.SetTop(grid, 0.) diff --git a/CodeLens/CodeLensGeneralTagger.fs b/CodeLens/CodeLensGeneralTagger.fs index 3702ac62878..fbc54c1e5fc 100644 --- a/CodeLens/CodeLensGeneralTagger.fs +++ b/CodeLens/CodeLensGeneralTagger.fs @@ -114,11 +114,11 @@ type CodeLensGeneralTagger (view, buffer) as self = interface ITagger with [] - override __.TagsChanged = tagsChangedEvent.Publish + override _.TagsChanged = tagsChangedEvent.Publish /// Returns the tags which reserve the correct space for adornments /// Notice, it's asumed that the data in the collection is valid. - override __.GetTags spans = + override _.GetTags spans = try seq { for span in spans do diff --git a/CodeLens/CodeLensProvider.fs b/CodeLens/CodeLensProvider.fs index eaf4b541a84..3f6d45e4ff4 100644 --- a/CodeLens/CodeLensProvider.fs +++ b/CodeLens/CodeLensProvider.fs @@ -86,7 +86,7 @@ type internal CodeLensProvider member val LineLensAdornmentLayerDefinition : AdornmentLayerDefinition = null with get, set interface IViewTaggerProvider with - override __.CreateTagger(view, buffer) = + override _.CreateTagger(view, buffer) = if settings.CodeLens.Enabled && not settings.CodeLens.ReplaceWithLineLens then let wpfView = match view with @@ -98,6 +98,6 @@ type internal CodeLensProvider null interface IWpfTextViewCreationListener with - override __.TextViewCreated view = + override _.TextViewCreated view = if settings.CodeLens.Enabled && settings.CodeLens.ReplaceWithLineLens then addLineLensProviderOnce view (view.TextBuffer) |> ignore \ No newline at end of file diff --git a/CodeLens/FSharpCodeLensService.fs b/CodeLens/FSharpCodeLensService.fs index 1a812df6117..ecb0bc2d531 100644 --- a/CodeLens/FSharpCodeLensService.fs +++ b/CodeLens/FSharpCodeLensService.fs @@ -16,9 +16,8 @@ open Microsoft.CodeAnalysis.Editor.Shared.Extensions open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Classification open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor.Shared.Extensions -open FSharp.Compiler open FSharp.Compiler.SourceCodeServices -open FSharp.Compiler.Range +open FSharp.Compiler.Text open FSharp.Compiler.TextLayout open Microsoft.VisualStudio.FSharp.Editor.Logging @@ -53,14 +52,14 @@ type internal FSharpCodeLensService let visit pos parseTree = AstTraversal.Traverse(pos, parseTree, { new AstTraversal.AstVisitorBase<_>() with - member __.VisitExpr(_path, traverseSynExpr, defaultTraverse, expr) = + member _.VisitExpr(_path, traverseSynExpr, defaultTraverse, expr) = defaultTraverse(expr) - override __.VisitInheritSynMemberDefn (_, _, _, _, range) = Some range + override _.VisitInheritSynMemberDefn (_, _, _, _, range) = Some range - override __.VisitTypeAbbrev( _, range) = Some range + override _.VisitTypeAbbrev( _, range) = Some range - override __.VisitLetOrUse(_, _, bindings, range) = + override _.VisitLetOrUse(_, _, bindings, range) = match bindings |> Seq.tryFind (fun b -> b.RangeOfHeadPat.StartLine = pos.Line) with | Some entry -> Some entry.RangeOfBindingAndRhs @@ -70,7 +69,7 @@ type internal FSharpCodeLensService // including implementation code. Some range - override __.VisitBinding (fn, binding) = + override _.VisitBinding (fn, binding) = Some binding.RangeOfBindingAndRhs }) @@ -404,7 +403,7 @@ type internal FSharpCodeLensService } |> Async.Start end - member __.BufferChanged ___ = + member _.BufferChanged ___ = bufferChangedCts.Cancel() // Stop all ongoing async workflow. bufferChangedCts.Dispose() bufferChangedCts <- new CancellationTokenSource() diff --git a/Commands/FsiCommandService.fs b/Commands/FsiCommandService.fs index 389d50b3cba..81dccba08ed 100644 --- a/Commands/FsiCommandService.fs +++ b/Commands/FsiCommandService.fs @@ -82,7 +82,7 @@ type internal FsiCommandFilterProvider [] ([)>] serviceProvider: System.IServiceProvider, editorFactory: IVsEditorAdaptersFactoryService) = interface IWpfTextViewCreationListener with - member __.TextViewCreated(textView) = + member _.TextViewCreated(textView) = match editorFactory.GetViewAdapter(textView) with | null -> () | textViewAdapter -> diff --git a/Commands/HelpContextService.fs b/Commands/HelpContextService.fs index ffdb586ff57..f9f5cae7e53 100644 --- a/Commands/HelpContextService.fs +++ b/Commands/HelpContextService.fs @@ -9,9 +9,8 @@ open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.Classification open Microsoft.VisualStudio.LanguageServices.Implementation.F1Help open Microsoft.CodeAnalysis.Host.Mef -open FSharp.Compiler -open FSharp.Compiler.Range open FSharp.Compiler.SourceCodeServices +open FSharp.Compiler.Text [] [, FSharpConstants.FSharpLanguageName)>] diff --git a/Commands/XmlDocCommandService.fs b/Commands/XmlDocCommandService.fs index 107cde020bf..e957a1e34d4 100644 --- a/Commands/XmlDocCommandService.fs +++ b/Commands/XmlDocCommandService.fs @@ -51,7 +51,7 @@ type internal XmlDocCommandFilter ErrorHandler.ThrowOnFailure errorCode |> ignore interface IOleCommandTarget with - member __.Exec(pguidCmdGroup: byref, nCmdID: uint32, nCmdexecopt: uint32, pvaIn: IntPtr, pvaOut: IntPtr) = + member _.Exec(pguidCmdGroup: byref, nCmdID: uint32, nCmdexecopt: uint32, pvaIn: IntPtr, pvaOut: IntPtr) = if pguidCmdGroup = VSConstants.VSStd2K && nCmdID = uint32 VSConstants.VSStd2KCmdID.TYPECHAR then match getTypedChar pvaIn with | ('/' | '<') as lastChar -> @@ -106,7 +106,7 @@ type internal XmlDocCommandFilter else VSConstants.E_FAIL - member __.QueryStatus(pguidCmdGroup: byref, cCmds: uint32, prgCmds: OLECMD [], pCmdText: IntPtr) = + member _.QueryStatus(pguidCmdGroup: byref, cCmds: uint32, prgCmds: OLECMD [], pCmdText: IntPtr) = if not (isNull nextTarget) then nextTarget.QueryStatus(ref pguidCmdGroup, cCmds, prgCmds, pCmdText) else @@ -127,7 +127,7 @@ type internal XmlDocCommandFilterProvider textDocumentFactoryService: ITextDocumentFactoryService, editorFactory: IVsEditorAdaptersFactoryService) = interface IWpfTextViewCreationListener with - member __.TextViewCreated(textView) = + member _.TextViewCreated(textView) = match editorFactory.GetViewAdapter(textView) with | null -> () | textViewAdapter -> diff --git a/Common/CodeAnalysisExtensions.fs b/Common/CodeAnalysisExtensions.fs index 21da00649ea..404aceddf6c 100644 --- a/Common/CodeAnalysisExtensions.fs +++ b/Common/CodeAnalysisExtensions.fs @@ -2,7 +2,8 @@ module internal Microsoft.VisualStudio.FSharp.Editor.CodeAnalysisExtensions open Microsoft.CodeAnalysis -open FSharp.Compiler.Range +open FSharp.Compiler.SourceCodeServices +open FSharp.Compiler.Text open System.IO type Project with diff --git a/Common/Extensions.fs b/Common/Extensions.fs index a68ce44a226..dccc97497a2 100644 --- a/Common/Extensions.fs +++ b/Common/Extensions.fs @@ -11,8 +11,8 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.Host -open FSharp.Compiler.Text open FSharp.Compiler.SourceCodeServices +open FSharp.Compiler.Text open FSharp.Compiler.SyntaxTree type private FSharpGlyph = FSharp.Compiler.SourceCodeServices.FSharpGlyph @@ -67,7 +67,7 @@ module private SourceText = let sourceText = { new Object() with - override __.GetHashCode() = + override _.GetHashCode() = let checksum = sourceText.GetChecksum() let contentsHash = if not checksum.IsDefault then Hash.combineValues checksum else 0 let encodingHash = if not (isNull sourceText.Encoding) then sourceText.Encoding.GetHashCode() else 0 @@ -79,24 +79,24 @@ module private SourceText = interface ISourceText with - member __.Item with get index = sourceText.[index] + member _.Item with get index = sourceText.[index] - member __.GetLineString(lineIndex) = + member _.GetLineString(lineIndex) = sourceText.Lines.[lineIndex].ToString() - member __.GetLineCount() = + member _.GetLineCount() = sourceText.Lines.Count - member __.GetLastCharacterPosition() = + member _.GetLastCharacterPosition() = if sourceText.Lines.Count > 0 then (sourceText.Lines.Count, sourceText.Lines.[sourceText.Lines.Count - 1].Span.Length) else (0, 0) - member __.GetSubTextString(start, length) = + member _.GetSubTextString(start, length) = sourceText.GetSubText(TextSpan(start, length)).ToString() - member __.SubTextEquals(target, startIndex) = + member _.SubTextEquals(target, startIndex) = if startIndex < 0 || startIndex >= sourceText.Length then invalidArg "startIndex" "Out of range." @@ -119,14 +119,14 @@ module private SourceText = didEqual - member __.ContentEquals(sourceText) = + member _.ContentEquals(sourceText) = match sourceText with | :? SourceText as sourceText -> sourceText.ContentEquals(sourceText) | _ -> false - member __.Length = sourceText.Length + member _.Length = sourceText.Length - member __.CopyTo(sourceIndex, destination, destinationIndex, count) = + member _.CopyTo(sourceIndex, destination, destinationIndex, count) = sourceText.CopyTo(sourceIndex, destination, destinationIndex, count) } diff --git a/Common/Logger.fs b/Common/Logger.fs index 03a507bf74a..3488917ae4f 100644 --- a/Common/Logger.fs +++ b/Common/Logger.fs @@ -77,12 +77,12 @@ module Logger = let LogBlock(functionId) = FSharpEditorEventSource.Instance.BlockStart(functionId) { new IDisposable with - member __.Dispose() = + member _.Dispose() = FSharpEditorEventSource.Instance.BlockStop(functionId) } let LogBlockMessage message functionId = FSharpEditorEventSource.Instance.BlockMessageStart(message, functionId) { new IDisposable with - member __.Dispose() = + member _.Dispose() = FSharpEditorEventSource.Instance.BlockMessageStop(message, functionId) } \ No newline at end of file diff --git a/Common/Logging.fs b/Common/Logging.fs index cc37f948f42..cefecb1791b 100644 --- a/Common/Logging.fs +++ b/Common/Logging.fs @@ -50,7 +50,7 @@ type [] Logger [] with get () = globalServiceProvider |> Option.defaultValue (ServiceProvider.GlobalProvider :> IServiceProvider) and set v = globalServiceProvider <- Some v - member __.FSharpLoggingPane + member _.FSharpLoggingPane with get () = getPane () |> function diff --git a/Common/Pervasive.fs b/Common/Pervasive.fs index e32a66c8823..fc38c56885b 100644 --- a/Common/Pervasive.fs +++ b/Common/Pervasive.fs @@ -20,29 +20,29 @@ type internal ISetThemeColors = abstract member SetColors: unit -> unit type MaybeBuilder () = // 'T -> M<'T> [] - member inline __.Return value: 'T option = + member inline _.Return value: 'T option = Some value // M<'T> -> M<'T> [] - member inline __.ReturnFrom value: 'T option = + member inline _.ReturnFrom value: 'T option = value // unit -> M<'T> [] - member inline __.Zero (): unit option = + member inline _.Zero (): unit option = Some () // TODO: Should this be None? // (unit -> M<'T>) -> M<'T> [] - member __.Delay (f: unit -> 'T option): 'T option = + member _.Delay (f: unit -> 'T option): 'T option = f () // M<'T> -> M<'T> -> M<'T> // or // M -> M<'T> -> M<'T> [] - member inline __.Combine (r1, r2: 'T option): 'T option = + member inline _.Combine (r1, r2: 'T option): 'T option = match r1 with | None -> None @@ -51,12 +51,12 @@ type MaybeBuilder () = // M<'T> * ('T -> M<'U>) -> M<'U> [] - member inline __.Bind (value, f: 'T -> 'U option): 'U option = + member inline _.Bind (value, f: 'T -> 'U option): 'U option = Option.bind f value // 'T * ('T -> M<'U>) -> M<'U> when 'U :> IDisposable [] - member __.Using (resource: ('T :> System.IDisposable), body: _ -> _ option): _ option = + member _.Using (resource: ('T :> System.IDisposable), body: _ -> _ option): _ option = try body resource finally if not <| obj.ReferenceEquals (null, box resource) then @@ -88,23 +88,23 @@ let maybe = MaybeBuilder() [] type AsyncMaybeBuilder () = [] - member __.Return value : Async<'T option> = Some value |> async.Return + member _.Return value : Async<'T option> = Some value |> async.Return [] - member __.ReturnFrom value : Async<'T option> = value + member _.ReturnFrom value : Async<'T option> = value [] - member __.ReturnFrom (value: 'T option) : Async<'T option> = async.Return value + member _.ReturnFrom (value: 'T option) : Async<'T option> = async.Return value [] - member __.Zero () : Async = + member _.Zero () : Async = Some () |> async.Return [] - member __.Delay (f : unit -> Async<'T option>) : Async<'T option> = async.Delay f + member _.Delay (f : unit -> Async<'T option>) : Async<'T option> = async.Delay f [] - member __.Combine (r1, r2 : Async<'T option>) : Async<'T option> = + member _.Combine (r1, r2 : Async<'T option>) : Async<'T option> = async { let! r1' = r1 match r1' with @@ -113,7 +113,7 @@ type AsyncMaybeBuilder () = } [] - member __.Bind (value: Async<'T option>, f : 'T -> Async<'U option>) : Async<'U option> = + member _.Bind (value: Async<'T option>, f : 'T -> Async<'U option>) : Async<'U option> = async { let! value' = value match value' with @@ -122,14 +122,14 @@ type AsyncMaybeBuilder () = } [] - member __.Bind (value: System.Threading.Tasks.Task<'T>, f : 'T -> Async<'U option>) : Async<'U option> = + member _.Bind (value: System.Threading.Tasks.Task<'T>, f : 'T -> Async<'U option>) : Async<'U option> = async { let! value' = Async.AwaitTask value return! f value' } [] - member __.Bind (value: 'T option, f : 'T -> Async<'U option>) : Async<'U option> = + member _.Bind (value: 'T option, f : 'T -> Async<'U option>) : Async<'U option> = async { match value with | None -> return None @@ -137,7 +137,7 @@ type AsyncMaybeBuilder () = } [] - member __.Using (resource : ('T :> IDisposable), body : 'T -> Async<'U option>) : Async<'U option> = + member _.Using (resource : ('T :> IDisposable), body : 'T -> Async<'U option>) : Async<'U option> = async { use resource = resource return! body resource @@ -156,11 +156,11 @@ type AsyncMaybeBuilder () = x.While (enum.MoveNext, x.Delay (fun () -> body enum.Current))) [] - member inline __.TryWith (computation : Async<'T option>, catchHandler : exn -> Async<'T option>) : Async<'T option> = + member inline _.TryWith (computation : Async<'T option>, catchHandler : exn -> Async<'T option>) : Async<'T option> = async.TryWith (computation, catchHandler) [] - member inline __.TryFinally (computation : Async<'T option>, compensation : unit -> unit) : Async<'T option> = + member inline _.TryFinally (computation : Async<'T option>, compensation : unit -> unit) : Async<'T option> = async.TryFinally (computation, compensation) let asyncMaybe = AsyncMaybeBuilder() diff --git a/Common/RoslynHelpers.fs b/Common/RoslynHelpers.fs index 03f5c21a97f..edab14b0273 100644 --- a/Common/RoslynHelpers.fs +++ b/Common/RoslynHelpers.fs @@ -8,10 +8,10 @@ open System.Threading open System.Threading.Tasks open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Text -open FSharp.Compiler open FSharp.Compiler.TextLayout open FSharp.Compiler.SourceCodeServices -open FSharp.Compiler.Range +open FSharp.Compiler.Text +open FSharp.Compiler.Text.Range open Microsoft.VisualStudio.FSharp.Editor.Logging open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics @@ -94,8 +94,8 @@ module internal RoslynHelpers = type VolatileBarrier() = [] let mutable isStopped = false - member __.Proceed = not isStopped - member __.Stop() = isStopped <- true + member _.Proceed = not isStopped + member _.Stop() = isStopped <- true // This is like Async.StartAsTask, but // 1. if cancellation occurs we explicitly associate the cancellation with cancellationToken diff --git a/Completion/CompletionProvider.fs b/Completion/CompletionProvider.fs index 60a3fb65834..94fffa5db37 100644 --- a/Completion/CompletionProvider.fs +++ b/Completion/CompletionProvider.fs @@ -16,9 +16,8 @@ open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Completion open Microsoft.VisualStudio.Shell -open FSharp.Compiler -open FSharp.Compiler.Range open FSharp.Compiler.SourceCodeServices +open FSharp.Compiler.Text module Logger = Microsoft.VisualStudio.FSharp.Editor.Logger diff --git a/Completion/CompletionUtils.fs b/Completion/CompletionUtils.fs index c75563559d2..5c9e91c5987 100644 --- a/Completion/CompletionUtils.fs +++ b/Completion/CompletionUtils.fs @@ -11,7 +11,7 @@ open Microsoft.CodeAnalysis.Completion open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Completion open System.Globalization open FSharp.Compiler.SourceCodeServices -open FSharp.Compiler.PrettyNaming +open FSharp.Compiler.SourceCodeServices.PrettyNaming module internal CompletionUtils = diff --git a/Completion/SignatureHelp.fs b/Completion/SignatureHelp.fs index 6e5f99d2626..21b572fae50 100644 --- a/Completion/SignatureHelp.fs +++ b/Completion/SignatureHelp.fs @@ -11,10 +11,11 @@ open Microsoft.CodeAnalysis.ExternalAccess.FSharp.SignatureHelp open Microsoft.VisualStudio.Shell -open FSharp.Compiler -open FSharp.Compiler.TextLayout -open FSharp.Compiler.Range open FSharp.Compiler.SourceCodeServices +open FSharp.Compiler.Text +open FSharp.Compiler.Text.Pos +open FSharp.Compiler.Text.Range +open FSharp.Compiler.TextLayout type SignatureHelpParameterInfo = { ParameterName: string @@ -325,7 +326,7 @@ type internal FSharpSignatureHelpProvider | None -> let possibleNextIndex = curriedArgsInSource - |> Array.tryFindIndex(fun argRange -> Range.posGeq argRange.Start caretPos) + |> Array.tryFindIndex(fun argRange -> Pos.posGeq argRange.Start caretPos) match possibleNextIndex with | Some index -> Some index diff --git a/Debugging/BreakpointResolutionService.fs b/Debugging/BreakpointResolutionService.fs index 17e2724d6ee..46608f7b3b3 100644 --- a/Debugging/BreakpointResolutionService.fs +++ b/Debugging/BreakpointResolutionService.fs @@ -16,7 +16,8 @@ open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor.Implementation.Debugging open FSharp.Compiler.SourceCodeServices -open FSharp.Compiler.Range +open FSharp.Compiler.Text +open FSharp.Compiler.Text.Pos [)>] type internal FSharpBreakpointResolutionService diff --git a/Debugging/LanguageDebugInfoService.fs b/Debugging/LanguageDebugInfoService.fs index cf37cf08aa6..09bb2e3914f 100644 --- a/Debugging/LanguageDebugInfoService.fs +++ b/Debugging/LanguageDebugInfoService.fs @@ -15,7 +15,7 @@ open Microsoft.CodeAnalysis.Host.Mef open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor.Implementation.Debugging -open FSharp.Compiler +open FSharp.Compiler.SourceCodeServices [)>] type internal FSharpLanguageDebugInfoService [](projectInfoManager: FSharpProjectOptionsManager) = diff --git a/Diagnostics/DocumentDiagnosticAnalyzer.fs b/Diagnostics/DocumentDiagnosticAnalyzer.fs index 5542ef6528e..95bd5ca043d 100644 --- a/Diagnostics/DocumentDiagnosticAnalyzer.fs +++ b/Diagnostics/DocumentDiagnosticAnalyzer.fs @@ -32,7 +32,7 @@ type internal FSharpDocumentDiagnosticAnalyzer static let errorInfoEqualityComparer = { new IEqualityComparer with - member __.Equals (x, y) = + member _.Equals (x, y) = x.FileName = y.FileName && x.StartLineAlternate = y.StartLineAlternate && x.EndLineAlternate = y.EndLineAlternate && @@ -42,7 +42,7 @@ type internal FSharpDocumentDiagnosticAnalyzer x.Message = y.Message && x.Subcategory = y.Subcategory && x.ErrorNumber = y.ErrorNumber - member __.GetHashCode x = + member _.GetHashCode x = let mutable hash = 17 hash <- hash * 23 + x.StartLineAlternate.GetHashCode() hash <- hash * 23 + x.EndLineAlternate.GetHashCode() diff --git a/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs b/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs index 50ac17d7bc4..da27405a3d0 100644 --- a/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs +++ b/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs @@ -9,10 +9,10 @@ open System.Diagnostics open System.Threading open Microsoft.CodeAnalysis -open FSharp.Compiler.Range open System.Runtime.Caching open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics open FSharp.Compiler.SourceCodeServices +open FSharp.Compiler.Text type private PerDocumentSavedData = { Hash: int; Diagnostics: ImmutableArray } diff --git a/Diagnostics/UnusedOpensDiagnosticAnalyzer.fs b/Diagnostics/UnusedOpensDiagnosticAnalyzer.fs index f7ef3160b88..54fb91f07ea 100644 --- a/Diagnostics/UnusedOpensDiagnosticAnalyzer.fs +++ b/Diagnostics/UnusedOpensDiagnosticAnalyzer.fs @@ -10,8 +10,8 @@ open System.Threading open Microsoft.CodeAnalysis -open FSharp.Compiler.Range open FSharp.Compiler.SourceCodeServices +open FSharp.Compiler.Text open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics diff --git a/DocComments/XMLDocumentation.fs b/DocComments/XMLDocumentation.fs index aa5dd862e96..bdb32aee8a8 100644 --- a/DocComments/XMLDocumentation.fs +++ b/DocComments/XMLDocumentation.fs @@ -164,7 +164,7 @@ module internal XmlDocumentation = static member TryCreate (xml: string) = try Some (XmlDocReader(XElement.Parse(ProcessXml xml))) with _ -> None - member __.CollectSummary(collector: ITaggedTextCollector) = + member _.CollectSummary(collector: ITaggedTextCollector) = match Seq.tryHead (doc.Descendants(XName.op_Implicit "summary")) with | None -> () | Some el -> @@ -244,7 +244,7 @@ module internal XmlDocumentation = interface IDocumentationBuilder with /// Append the given processed XML formatted into the string builder - override __.AppendDocumentationFromProcessedXML(xmlCollector, exnCollector, processedXml, showExceptions, showParameters, paramName) = + override _.AppendDocumentationFromProcessedXML(xmlCollector, exnCollector, processedXml, showExceptions, showParameters, paramName) = match XmlDocReader.TryCreate processedXml with | Some xmlDocReader -> match paramName with diff --git a/DocumentHighlights/DocumentHighlightsService.fs b/DocumentHighlights/DocumentHighlightsService.fs index bcc0bd3629b..7127c8afbe7 100644 --- a/DocumentHighlights/DocumentHighlightsService.fs +++ b/DocumentHighlights/DocumentHighlightsService.fs @@ -8,13 +8,11 @@ open System.Collections.Immutable open System.Threading.Tasks open Microsoft.CodeAnalysis -open Microsoft.CodeAnalysis.DocumentHighlighting -open Microsoft.CodeAnalysis.Host.Mef open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.ExternalAccess.FSharp.DocumentHighlighting open FSharp.Compiler.SourceCodeServices -open FSharp.Compiler.Range +open FSharp.Compiler.Text type internal FSharpHighlightSpan = { IsDefinition: bool @@ -73,7 +71,7 @@ type internal FSharpDocumentHighlightsService [] (checkerP } interface IFSharpDocumentHighlightsService with - member __.GetDocumentHighlightsAsync(document, position, _documentsToSearch, cancellationToken) : Task> = + member _.GetDocumentHighlightsAsync(document, position, _documentsToSearch, cancellationToken) : Task> = asyncMaybe { let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document, cancellationToken, userOpName) let! sourceText = document.GetTextAsync(cancellationToken) diff --git a/Formatting/EditorFormattingService.fs b/Formatting/EditorFormattingService.fs index 0cb8af738f6..827df63ae03 100644 --- a/Formatting/EditorFormattingService.fs +++ b/Formatting/EditorFormattingService.fs @@ -148,7 +148,7 @@ type internal FSharpEditorFormattingService return stripIndentation removeIndentation } - member __.GetFormattingChangesAsync (document: Document, position: int, cancellationToken: CancellationToken) = + member _.GetFormattingChangesAsync (document: Document, position: int, cancellationToken: CancellationToken) = async { let! sourceText = document.GetTextAsync(cancellationToken) |> Async.AwaitTask let! options = document.GetOptionsAsync(cancellationToken) |> Async.AwaitTask @@ -158,7 +158,7 @@ type internal FSharpEditorFormattingService return textChange |> Option.toList |> toIList } - member __.OnPasteAsync (document: Document, span: TextSpan, currentClipboard: string, cancellationToken: CancellationToken) = + member _.OnPasteAsync (document: Document, span: TextSpan, currentClipboard: string, cancellationToken: CancellationToken) = async { let! sourceText = document.GetTextAsync(cancellationToken) |> Async.AwaitTask let! options = document.GetOptionsAsync(cancellationToken) |> Async.AwaitTask @@ -175,7 +175,7 @@ type internal FSharpEditorFormattingService member val SupportsFormatOnPaste = true member val SupportsFormatOnReturn = true - override __.SupportsFormattingOnTypedCharacter (document, ch) = + override _.SupportsFormattingOnTypedCharacter (document, ch) = if FSharpIndentationService.IsSmartIndentEnabled document.Project.Solution.Workspace.Options then match ch with | ')' | ']' | '}' -> true @@ -183,7 +183,7 @@ type internal FSharpEditorFormattingService else false - override __.GetFormattingChangesAsync (_document, _span, cancellationToken) = + override _.GetFormattingChangesAsync (_document, _span, cancellationToken) = async { return ResizeArray() :> IList<_> } |> RoslynHelpers.StartAsyncAsTask cancellationToken diff --git a/InlineRename/InlineRenameService.fs b/InlineRename/InlineRenameService.fs index 05835bd6af3..586aa7997ff 100644 --- a/InlineRename/InlineRenameService.fs +++ b/InlineRename/InlineRenameService.fs @@ -15,34 +15,33 @@ open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.ExternalAccess.FSharp open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor -open FSharp.Compiler -open FSharp.Compiler.Range +open FSharp.Compiler.Text open FSharp.Compiler.SourceCodeServices open Symbols type internal FailureInlineRenameInfo private () = interface IFSharpInlineRenameInfo with - member __.CanRename = false - member __.LocalizedErrorMessage = FSharpEditorFeaturesResources.You_cannot_rename_this_element - member __.TriggerSpan = Unchecked.defaultof<_> - member __.HasOverloads = false - member __.ForceRenameOverloads = true - member __.DisplayName = "" - member __.FullDisplayName = "" - member __.Glyph = Glyph.MethodPublic - member __.GetFinalSymbolName _ = "" - member __.GetReferenceEditSpan(_, _) = Unchecked.defaultof<_> - member __.GetConflictEditSpan(_, _, _) = Nullable() - member __.FindRenameLocationsAsync(_, _) = Task.FromResult null - member __.TryOnBeforeGlobalSymbolRenamed(_, _, _) = false - member __.TryOnAfterGlobalSymbolRenamed(_, _, _) = false + member _.CanRename = false + member _.LocalizedErrorMessage = FSharpEditorFeaturesResources.You_cannot_rename_this_element + member _.TriggerSpan = Unchecked.defaultof<_> + member _.HasOverloads = false + member _.ForceRenameOverloads = true + member _.DisplayName = "" + member _.FullDisplayName = "" + member _.Glyph = Glyph.MethodPublic + member _.GetFinalSymbolName _ = "" + member _.GetReferenceEditSpan(_, _) = Unchecked.defaultof<_> + member _.GetConflictEditSpan(_, _, _) = Nullable() + member _.FindRenameLocationsAsync(_, _) = Task.FromResult null + member _.TryOnBeforeGlobalSymbolRenamed(_, _, _) = false + member _.TryOnAfterGlobalSymbolRenamed(_, _, _) = false static member Instance = FailureInlineRenameInfo() :> IFSharpInlineRenameInfo type internal InlineRenameLocationSet(locations: FSharpInlineRenameLocation [], originalSolution: Solution, symbolKind: LexerSymbolKind, symbol: FSharpSymbol) = interface IFSharpInlineRenameLocationSet with - member __.Locations = upcast locations.ToList() + member _.Locations = upcast locations.ToList() - member __.GetReplacementsAsync(replacementText, _optionSet, cancellationToken) : Task = + member _.GetReplacementsAsync(replacementText, _optionSet, cancellationToken) : Task = let rec applyChanges (solution: Solution) (locationsByDocument: (Document * FSharpInlineRenameLocation list) list) = async { match locationsByDocument with @@ -62,10 +61,10 @@ type internal InlineRenameLocationSet(locations: FSharpInlineRenameLocation [], | _ -> FSharpKeywords.NormalizeIdentifierBackticks replacementText return { new IFSharpInlineRenameReplacementInfo with - member __.NewSolution = newSolution - member __.ReplacementTextValid = Tokenizer.isValidNameForSymbol(symbolKind, symbol, replacementText) - member __.DocumentIds = locations |> Seq.map (fun doc -> doc.Document.Id) |> Seq.distinct - member __.GetReplacements _ = Seq.empty } + member _.NewSolution = newSolution + member _.ReplacementTextValid = Tokenizer.isValidNameForSymbol(symbolKind, symbol, replacementText) + member _.DocumentIds = locations |> Seq.map (fun doc -> doc.Document.Id) |> Seq.distinct + member _.GetReplacements _ = Seq.empty } } |> RoslynHelpers.StartAsyncAsTask(cancellationToken) @@ -93,28 +92,28 @@ type internal InlineRenameInfo |> Async.cache interface IFSharpInlineRenameInfo with - member __.CanRename = true - member __.LocalizedErrorMessage = null - member __.TriggerSpan = triggerSpan - member __.HasOverloads = false - member __.ForceRenameOverloads = false - member __.DisplayName = symbolUse.Symbol.DisplayName - member __.FullDisplayName = try symbolUse.Symbol.FullName with _ -> symbolUse.Symbol.DisplayName - member __.Glyph = Glyph.MethodPublic - member __.GetFinalSymbolName replacementText = replacementText - - member __.GetReferenceEditSpan(location, cancellationToken) = + member _.CanRename = true + member _.LocalizedErrorMessage = null + member _.TriggerSpan = triggerSpan + member _.HasOverloads = false + member _.ForceRenameOverloads = false + member _.DisplayName = symbolUse.Symbol.DisplayName + member _.FullDisplayName = try symbolUse.Symbol.FullName with _ -> symbolUse.Symbol.DisplayName + member _.Glyph = Glyph.MethodPublic + member _.GetFinalSymbolName replacementText = replacementText + + member _.GetReferenceEditSpan(location, cancellationToken) = let text = getDocumentText location.Document cancellationToken Tokenizer.fixupSpan(text, location.TextSpan) - member __.GetConflictEditSpan(location, replacementText, cancellationToken) = + member _.GetConflictEditSpan(location, replacementText, cancellationToken) = let text = getDocumentText location.Document cancellationToken let spanText = text.ToString(location.TextSpan) let position = spanText.LastIndexOf(replacementText, StringComparison.Ordinal) if position < 0 then Nullable() else Nullable(TextSpan(location.TextSpan.Start + position, replacementText.Length)) - member __.FindRenameLocationsAsync(_optionSet, cancellationToken) = + member _.FindRenameLocationsAsync(_optionSet, cancellationToken) = async { let! symbolUsesByDocumentId = symbolUses let! locations = @@ -137,8 +136,8 @@ type internal InlineRenameInfo return InlineRenameLocationSet(locations, document.Project.Solution, lexerSymbol.Kind, symbolUse.Symbol) :> IFSharpInlineRenameLocationSet } |> RoslynHelpers.StartAsyncAsTask(cancellationToken) - member __.TryOnBeforeGlobalSymbolRenamed(_workspace, _changedDocumentIDs, _replacementText) = true - member __.TryOnAfterGlobalSymbolRenamed(_workspace, _changedDocumentIDs, _replacementText) = true + member _.TryOnBeforeGlobalSymbolRenamed(_workspace, _changedDocumentIDs, _replacementText) = true + member _.TryOnAfterGlobalSymbolRenamed(_workspace, _changedDocumentIDs, _replacementText) = true [); Shared>] type internal InlineRenameService @@ -167,7 +166,7 @@ type internal InlineRenameService } interface IFSharpEditorInlineRenameService with - member __.GetRenameInfoAsync(document: Document, position: int, cancellationToken: CancellationToken) : Task = + member _.GetRenameInfoAsync(document: Document, position: int, cancellationToken: CancellationToken) : Task = asyncMaybe { let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document, cancellationToken, userOpName) let! sourceText = document.GetTextAsync(cancellationToken) diff --git a/LanguageService/FSharpEditorFactory.fs b/LanguageService/FSharpEditorFactory.fs index cadf0d33e06..6789c0feea8 100644 --- a/LanguageService/FSharpEditorFactory.fs +++ b/LanguageService/FSharpEditorFactory.fs @@ -67,9 +67,9 @@ type FSharpEditorFactory(parentPackage: ShellPackage) = interface IVsEditorFactory with - member __.Close() = VSConstants.S_OK + member _.Close() = VSConstants.S_OK - member __.CreateEditorInstance(_grfCreateDoc, _pszMkDocument, _pszPhysicalView, _pvHier, _itemid, punkDocDataExisting, ppunkDocView, ppunkDocData, pbstrEditorCaption, pguidCmdUI, pgrfCDW) = + member _.CreateEditorInstance(_grfCreateDoc, _pszMkDocument, _pszPhysicalView, _pvHier, _itemid, punkDocDataExisting, ppunkDocView, ppunkDocData, pbstrEditorCaption, pguidCmdUI, pgrfCDW) = ppunkDocView <- IntPtr.Zero ppunkDocData <- IntPtr.Zero pbstrEditorCaption <- String.Empty @@ -99,7 +99,7 @@ type FSharpEditorFactory(parentPackage: ShellPackage) = let textBuffer = editorAdaptersFactoryService.CreateVsTextBufferAdapter(oleServiceProvider, contentType) setWindowBuffer oleServiceProvider textBuffer &ppunkDocView &ppunkDocData &pbstrEditorCaption - member __.MapLogicalView(rguidLogicalView, pbstrPhysicalView) = + member _.MapLogicalView(rguidLogicalView, pbstrPhysicalView) = pbstrPhysicalView <- null match rguidLogicalView with @@ -112,7 +112,7 @@ type FSharpEditorFactory(parentPackage: ShellPackage) = | _ -> VSConstants.E_NOTIMPL - member __.SetSite(packageServiceProvider) = + member _.SetSite(packageServiceProvider) = oleServiceProviderOpt <- Some packageServiceProvider VSConstants.S_OK \ No newline at end of file diff --git a/LanguageService/FSharpProjectOptionsManager.fs b/LanguageService/FSharpProjectOptionsManager.fs index 86b9af904ec..a35323f9de2 100644 --- a/LanguageService/FSharpProjectOptionsManager.fs +++ b/LanguageService/FSharpProjectOptionsManager.fs @@ -33,22 +33,22 @@ module private FSharpProjectOptionsHelpers = let mutable errorReporter = Unchecked.defaultof<_> { new IProjectSite with - member __.Description = project.Name - member __.CompilationSourceFiles = sourcePaths - member __.CompilationOptions = + member _.Description = project.Name + member _.CompilationSourceFiles = sourcePaths + member _.CompilationOptions = Array.concat [options; referencePaths |> Array.map(fun r -> "-r:" + r)] - member __.CompilationReferences = referencePaths + member _.CompilationReferences = referencePaths member site.CompilationBinOutputPath = site.CompilationOptions |> Array.tryPick (fun s -> if s.StartsWith("-o:") then Some s.[3..] else None) - member __.ProjectFileName = project.FilePath - member __.AdviseProjectSiteChanges(_,_) = () - member __.AdviseProjectSiteCleaned(_,_) = () - member __.AdviseProjectSiteClosed(_,_) = () - member __.IsIncompleteTypeCheckEnvironment = false - member __.TargetFrameworkMoniker = "" - member __.ProjectGuid = project.Id.Id.ToString() - member __.LoadTime = System.DateTime.Now - member __.ProjectProvider = None - member __.BuildErrorReporter with get () = errorReporter and set (v) = errorReporter <- v + member _.ProjectFileName = project.FilePath + member _.AdviseProjectSiteChanges(_,_) = () + member _.AdviseProjectSiteCleaned(_,_) = () + member _.AdviseProjectSiteClosed(_,_) = () + member _.IsIncompleteTypeCheckEnvironment = false + member _.TargetFrameworkMoniker = "" + member _.ProjectGuid = project.Id.Id.ToString() + member _.LoadTime = System.DateTime.Now + member _.ProjectProvider = None + member _.BuildErrorReporter with get () = errorReporter and set (v) = errorReporter <- v } let hasProjectVersionChanged (oldProject: Project) (newProject: Project) = @@ -304,31 +304,31 @@ type private FSharpProjectOptionsReactor (workspace: Workspace, settings: Editor let agent = MailboxProcessor.Start((fun agent -> loop agent), cancellationToken = cancellationTokenSource.Token) - member __.TryGetOptionsByProjectAsync(project, ct) = + member _.TryGetOptionsByProjectAsync(project, ct) = agent.PostAndAsyncReply(fun reply -> FSharpProjectOptionsMessage.TryGetOptionsByProject(project, reply, ct)) - member __.TryGetOptionsByDocumentAsync(document, ct, userOpName) = + member _.TryGetOptionsByDocumentAsync(document, ct, userOpName) = agent.PostAndAsyncReply(fun reply -> FSharpProjectOptionsMessage.TryGetOptionsByDocument(document, reply, ct, userOpName)) - member __.ClearOptionsByProjectId(projectId) = + member _.ClearOptionsByProjectId(projectId) = agent.Post(FSharpProjectOptionsMessage.ClearOptions(projectId)) - member __.ClearSingleFileOptionsCache(documentId) = + member _.ClearSingleFileOptionsCache(documentId) = agent.Post(FSharpProjectOptionsMessage.ClearSingleFileOptionsCache(documentId)) - member __.SetCpsCommandLineOptions(projectId, sourcePaths, options) = + member _.SetCpsCommandLineOptions(projectId, sourcePaths, options) = cpsCommandLineOptions.[projectId] <- (sourcePaths, options) - member __.SetLegacyProjectSite (projectId, projectSite) = + member _.SetLegacyProjectSite (projectId, projectSite) = legacyProjectSites.[projectId] <- projectSite - member __.TryGetCachedOptionsByProjectId(projectId) = + member _.TryGetCachedOptionsByProjectId(projectId) = match cache.TryGetValue(projectId) with | true, result -> Some(result) | _ -> None interface IDisposable with - member __.Dispose() = + member _.Dispose() = cancellationTokenSource.Cancel() cancellationTokenSource.Dispose() (agent :> IDisposable).Dispose() @@ -362,7 +362,7 @@ type internal FSharpProjectOptionsManager | _ -> () ) - member __.SetLegacyProjectSite (projectId, projectSite) = + member _.SetLegacyProjectSite (projectId, projectSite) = reactor.SetLegacyProjectSite (projectId, projectSite) /// Clear a project from the project table @@ -413,7 +413,7 @@ type internal FSharpProjectOptionsManager /// This handles commandline change notifications from the Dotnet Project-system /// Prior to VS 15.7 path contained path to project file, post 15.7 contains target binpath /// binpath is more accurate because a project file can have multiple in memory projects based on configuration - member __.HandleCommandLineChanges(path:string, sources:ImmutableArray, _references:ImmutableArray, options:ImmutableArray) = + member _.HandleCommandLineChanges(path:string, sources:ImmutableArray, _references:ImmutableArray, options:ImmutableArray) = use _logBlock = Logger.LogBlock(LogEditorFunctionId.LanguageService_HandleCommandLineArgs) let projectId = @@ -432,4 +432,4 @@ type internal FSharpProjectOptionsManager reactor.SetCpsCommandLineOptions(projectId, sourcePaths, options.ToArray()) - member __.Checker = checkerProvider.Checker + member _.Checker = checkerProvider.Checker diff --git a/LanguageService/LanguageService.fs b/LanguageService/LanguageService.fs index f02f4e344b4..888971d663d 100644 --- a/LanguageService/LanguageService.fs +++ b/LanguageService/LanguageService.fs @@ -35,7 +35,7 @@ type internal FSharpCheckerWorkspaceService = type internal RoamingProfileStorageLocation(keyName: string) = inherit OptionStorageLocation() - member __.GetKeyNameForLanguage(languageName: string) = + member _.GetKeyNameForLanguage(languageName: string) = let unsubstitutedKeyName = keyName match languageName with | null -> unsubstitutedKeyName @@ -52,43 +52,43 @@ type internal FSharpCheckerWorkspaceServiceFactory projectInfoManager: FSharpProjectOptionsManager ) = interface Microsoft.CodeAnalysis.Host.Mef.IWorkspaceServiceFactory with - member __.CreateService(_workspaceServices) = + member _.CreateService(_workspaceServices) = upcast { new FSharpCheckerWorkspaceService with - member __.Checker = checkerProvider.Checker - member __.FSharpProjectOptionsManager = projectInfoManager } + member _.Checker = checkerProvider.Checker + member _.FSharpProjectOptionsManager = projectInfoManager } [] type private FSharpSolutionEvents(projectManager: FSharpProjectOptionsManager) = interface IVsSolutionEvents with - member __.OnAfterCloseSolution(_) = + member _.OnAfterCloseSolution(_) = projectManager.Checker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients() VSConstants.S_OK - member __.OnAfterLoadProject(_, _) = VSConstants.E_NOTIMPL + member _.OnAfterLoadProject(_, _) = VSConstants.E_NOTIMPL - member __.OnAfterOpenProject(_, _) = VSConstants.E_NOTIMPL + member _.OnAfterOpenProject(_, _) = VSConstants.E_NOTIMPL - member __.OnAfterOpenSolution(_, _) = VSConstants.E_NOTIMPL + member _.OnAfterOpenSolution(_, _) = VSConstants.E_NOTIMPL - member __.OnBeforeCloseProject(_, _) = VSConstants.E_NOTIMPL + member _.OnBeforeCloseProject(_, _) = VSConstants.E_NOTIMPL - member __.OnBeforeCloseSolution(_) = VSConstants.E_NOTIMPL + member _.OnBeforeCloseSolution(_) = VSConstants.E_NOTIMPL - member __.OnBeforeUnloadProject(_, _) = VSConstants.E_NOTIMPL + member _.OnBeforeUnloadProject(_, _) = VSConstants.E_NOTIMPL - member __.OnQueryCloseProject(_, _, _) = VSConstants.E_NOTIMPL + member _.OnQueryCloseProject(_, _, _) = VSConstants.E_NOTIMPL - member __.OnQueryCloseSolution(_, _) = VSConstants.E_NOTIMPL + member _.OnQueryCloseSolution(_, _) = VSConstants.E_NOTIMPL - member __.OnQueryUnloadProject(_, _) = VSConstants.E_NOTIMPL + member _.OnQueryUnloadProject(_, _) = VSConstants.E_NOTIMPL [, Microsoft.CodeAnalysis.Host.Mef.ServiceLayer.Default)>] type internal FSharpSettingsFactory [] (settings: EditorOptions) = interface Microsoft.CodeAnalysis.Host.Mef.IWorkspaceServiceFactory with - member __.CreateService(_) = upcast settings + member _.CreateService(_) = upcast settings [] [, @@ -226,14 +226,14 @@ type internal FSharpLanguageService(package : FSharpPackage) = let theme = package.ComponentModel.DefaultExportProvider.GetExport().Value theme.SetColors() - override __.ContentTypeName = FSharpConstants.FSharpContentTypeName - override __.LanguageName = FSharpConstants.FSharpLanguageName - override __.RoslynLanguageName = FSharpConstants.FSharpLanguageName + override _.ContentTypeName = FSharpConstants.FSharpContentTypeName + override _.LanguageName = FSharpConstants.FSharpLanguageName + override _.RoslynLanguageName = FSharpConstants.FSharpLanguageName - override __.LanguageServiceId = new Guid(FSharpConstants.languageServiceGuidString) - override __.DebuggerLanguageId = DebuggerEnvironment.GetLanguageID() + override _.LanguageServiceId = new Guid(FSharpConstants.languageServiceGuidString) + override _.DebuggerLanguageId = DebuggerEnvironment.GetLanguageID() - override __.CreateContext(_,_,_,_,_) = raise(System.NotImplementedException()) + override _.CreateContext(_,_,_,_,_) = raise(System.NotImplementedException()) override this.SetupNewTextView(textView) = base.SetupNewTextView(textView) diff --git a/LanguageService/LegacyProjectWorkspaceMap.fs b/LanguageService/LegacyProjectWorkspaceMap.fs index 426ecf9a5f2..996ce1cadf8 100644 --- a/LanguageService/LegacyProjectWorkspaceMap.fs +++ b/LanguageService/LegacyProjectWorkspaceMap.fs @@ -147,15 +147,15 @@ type internal LegacyProjectWorkspaceMap(solution: IVsSolution, interface IVsSolutionEvents with - member __.OnAfterCloseSolution(_) = + member _.OnAfterCloseSolution(_) = // Clear let mutable setup = Unchecked.defaultof<_> while setupQueue.TryDequeue(&setup) do () VSConstants.S_OK - member __.OnAfterLoadProject(_, _) = VSConstants.S_OK + member _.OnAfterLoadProject(_, _) = VSConstants.S_OK - member __.OnAfterOpenProject(hier, _) = + member _.OnAfterOpenProject(hier, _) = match hier with | :? IProvideProjectSite as siteProvider -> let setup = fun () -> this.SetupLegacyProjectFile(siteProvider) @@ -167,13 +167,13 @@ type internal LegacyProjectWorkspaceMap(solution: IVsSolution, | _ -> () VSConstants.S_OK - member __.OnAfterOpenSolution(_, _) = + member _.OnAfterOpenSolution(_, _) = let mutable setup = Unchecked.defaultof<_> while setupQueue.TryDequeue(&setup) do setup () VSConstants.S_OK - member __.OnBeforeCloseProject(hier, _) = + member _.OnBeforeCloseProject(hier, _) = match hier with | :? IProvideProjectSite as siteProvider -> let site = siteProvider.GetProjectSite() @@ -186,12 +186,12 @@ type internal LegacyProjectWorkspaceMap(solution: IVsSolution, | _ -> () VSConstants.S_OK - member __.OnBeforeCloseSolution(_) = VSConstants.S_OK + member _.OnBeforeCloseSolution(_) = VSConstants.S_OK - member __.OnBeforeUnloadProject(_, _) = VSConstants.S_OK + member _.OnBeforeUnloadProject(_, _) = VSConstants.S_OK - member __.OnQueryCloseProject(_, _, _) = VSConstants.S_OK + member _.OnQueryCloseProject(_, _, _) = VSConstants.S_OK - member __.OnQueryCloseSolution(_, _) = VSConstants.S_OK + member _.OnQueryCloseSolution(_, _) = VSConstants.S_OK - member __.OnQueryUnloadProject(_, _) = VSConstants.S_OK \ No newline at end of file + member _.OnQueryUnloadProject(_, _) = VSConstants.S_OK \ No newline at end of file diff --git a/LanguageService/ProvideBraceCompletionAttribute.fs b/LanguageService/ProvideBraceCompletionAttribute.fs index 916a7380da1..afea098da33 100644 --- a/LanguageService/ProvideBraceCompletionAttribute.fs +++ b/LanguageService/ProvideBraceCompletionAttribute.fs @@ -10,8 +10,8 @@ open Microsoft.VisualStudio.Shell type internal ProvideBraceCompletionAttribute(languageName: string) = inherit RegistrationAttribute() - override __.Register(context) = + override _.Register(context) = use key = context.CreateKey(@"Languages\Language Services\" + languageName) key.SetValue("ShowBraceCompletion", 1) - override __.Unregister(_) = () \ No newline at end of file + override _.Unregister(_) = () \ No newline at end of file diff --git a/LanguageService/SingleFileWorkspaceMap.fs b/LanguageService/SingleFileWorkspaceMap.fs index 21249b80c5f..5947c59b8ae 100644 --- a/LanguageService/SingleFileWorkspaceMap.fs +++ b/LanguageService/SingleFileWorkspaceMap.fs @@ -64,23 +64,23 @@ type internal SingleFileWorkspaceMap(workspace: VisualStudioWorkspace, interface IVsRunningDocTableEvents with - member __.OnAfterAttributeChange(_, _) = VSConstants.E_NOTIMPL + member _.OnAfterAttributeChange(_, _) = VSConstants.E_NOTIMPL - member __.OnAfterDocumentWindowHide(_, _) = VSConstants.E_NOTIMPL + member _.OnAfterDocumentWindowHide(_, _) = VSConstants.E_NOTIMPL - member __.OnAfterFirstDocumentLock(_, _, _, _) = VSConstants.E_NOTIMPL + member _.OnAfterFirstDocumentLock(_, _, _, _) = VSConstants.E_NOTIMPL - member __.OnAfterSave(_) = VSConstants.E_NOTIMPL + member _.OnAfterSave(_) = VSConstants.E_NOTIMPL - member __.OnBeforeDocumentWindowShow(_, _, _) = VSConstants.E_NOTIMPL + member _.OnBeforeDocumentWindowShow(_, _, _) = VSConstants.E_NOTIMPL - member __.OnBeforeLastDocumentUnlock(_, _, _, _) = VSConstants.E_NOTIMPL + member _.OnBeforeLastDocumentUnlock(_, _, _, _) = VSConstants.E_NOTIMPL interface IVsRunningDocTableEvents2 with - member __.OnAfterAttributeChange(_, _) = VSConstants.E_NOTIMPL + member _.OnAfterAttributeChange(_, _) = VSConstants.E_NOTIMPL - member __.OnAfterAttributeChangeEx(_, grfAttribs, _, _, pszMkDocumentOld, _, _, pszMkDocumentNew) = + member _.OnAfterAttributeChangeEx(_, grfAttribs, _, _, pszMkDocumentOld, _, _, pszMkDocumentNew) = // Handles renaming of a misc file if (grfAttribs &&& (uint32 __VSRDTATTRIB.RDTA_MkDocument)) <> 0u && files.ContainsKey(pszMkDocumentOld) then match files.TryRemove(pszMkDocumentOld) with @@ -101,12 +101,12 @@ type internal SingleFileWorkspaceMap(workspace: VisualStudioWorkspace, | _ -> () VSConstants.S_OK - member __.OnAfterDocumentWindowHide(_, _) = VSConstants.E_NOTIMPL + member _.OnAfterDocumentWindowHide(_, _) = VSConstants.E_NOTIMPL - member __.OnAfterFirstDocumentLock(_, _, _, _) = VSConstants.E_NOTIMPL + member _.OnAfterFirstDocumentLock(_, _, _, _) = VSConstants.E_NOTIMPL - member __.OnAfterSave(_) = VSConstants.E_NOTIMPL + member _.OnAfterSave(_) = VSConstants.E_NOTIMPL - member __.OnBeforeDocumentWindowShow(_, _, _) = VSConstants.E_NOTIMPL + member _.OnBeforeDocumentWindowShow(_, _, _) = VSConstants.E_NOTIMPL - member __.OnBeforeLastDocumentUnlock(_, _, _, _) = VSConstants.E_NOTIMPL \ No newline at end of file + member _.OnBeforeLastDocumentUnlock(_, _, _, _) = VSConstants.E_NOTIMPL \ No newline at end of file diff --git a/LanguageService/SymbolHelpers.fs b/LanguageService/SymbolHelpers.fs index 1be896711b4..5648c798f43 100644 --- a/LanguageService/SymbolHelpers.fs +++ b/LanguageService/SymbolHelpers.fs @@ -10,8 +10,9 @@ open System.Threading.Tasks open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Text -open FSharp.Compiler.Range open FSharp.Compiler.SourceCodeServices +open FSharp.Compiler.Text +open FSharp.Compiler.Text.Range open Microsoft.VisualStudio.FSharp.Editor.Symbols module internal SymbolHelpers = diff --git a/LanguageService/Symbols.fs b/LanguageService/Symbols.fs index 45b1eb22b30..11e2431255a 100644 --- a/LanguageService/Symbols.fs +++ b/LanguageService/Symbols.fs @@ -12,10 +12,7 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Classification open Microsoft.CodeAnalysis.Text -open FSharp.Compiler open FSharp.Compiler.SourceCodeServices -open FSharp.Compiler.SyntaxTree - [] type SymbolDeclarationLocation = diff --git a/LanguageService/TextViewCreationListener.fs b/LanguageService/TextViewCreationListener.fs index 8dae5999bbc..4d37f1c93cd 100644 --- a/LanguageService/TextViewCreationListener.fs +++ b/LanguageService/TextViewCreationListener.fs @@ -58,6 +58,6 @@ type TextViewCreationListener [] (adaptersFactory: IVsEdit interface IVsTextViewCreationListener with - member __.VsTextViewCreated(textViewAdapter) = + member _.VsTextViewCreated(textViewAdapter) = let _textView = adaptersFactory.GetWpfTextView(textViewAdapter) initKeyBindings textViewAdapter \ No newline at end of file diff --git a/LanguageService/Tokenizer.fs b/LanguageService/Tokenizer.fs index 456dfadc7ae..790cef2d4f3 100644 --- a/LanguageService/Tokenizer.fs +++ b/LanguageService/Tokenizer.fs @@ -13,9 +13,9 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Classification open Microsoft.CodeAnalysis.Text -open FSharp.Compiler open FSharp.Compiler.SourceCodeServices open FSharp.Compiler.SyntaxTree +open FSharp.Compiler.Text open Microsoft.VisualStudio.Core.Imaging open Microsoft.VisualStudio.Imaging @@ -42,7 +42,7 @@ type internal LexerSymbol = Ident: Ident /// All parts of `LongIdent` FullIsland: string list } - member x.Range: Range.range = x.Ident.idRange + member x.Range: Range = x.Ident.idRange [] type internal SymbolLookupKind = @@ -723,8 +723,8 @@ module internal Tokenizer = Ident(identStr, Range.mkRange fileName - (Range.mkPos (linePos.Line + 1) token.LeftColumn) - (Range.mkPos (linePos.Line + 1) (token.RightColumn + 1))) + (Pos.mkPos (linePos.Line + 1) token.LeftColumn) + (Pos.mkPos (linePos.Line + 1) (token.RightColumn + 1))) FullIsland = partialName.QualifyingIdents @ [identStr] }) let private getCachedSourceLineData(documentKey: DocumentId, sourceText: SourceText, position: int, fileName: string, defines: string list) = diff --git a/Navigation/FindUsagesService.fs b/Navigation/FindUsagesService.fs index e60aa9f4db1..59a75bb87dc 100644 --- a/Navigation/FindUsagesService.fs +++ b/Navigation/FindUsagesService.fs @@ -11,8 +11,8 @@ open Microsoft.CodeAnalysis.ExternalAccess.FSharp open Microsoft.CodeAnalysis.ExternalAccess.FSharp.FindUsages open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor.FindUsages -open FSharp.Compiler.Range open FSharp.Compiler.SourceCodeServices +open FSharp.Compiler.Text open Microsoft.CodeAnalysis.Text [)>] @@ -90,7 +90,7 @@ type internal FSharpFindUsagesService fun (doc: Document) (textSpan: TextSpan) (symbolUse: range) -> async { match declarationRange with - | Some declRange when FSharp.Compiler.Range.equals declRange symbolUse -> () + | Some declRange when Range.equals declRange symbolUse -> () | _ -> if allReferences then let definitionItem = @@ -133,10 +133,10 @@ type internal FSharpFindUsagesService } |> Async.Ignore interface IFSharpFindUsagesService with - member __.FindReferencesAsync(document, position, context) = + member _.FindReferencesAsync(document, position, context) = findReferencedSymbolsAsync(document, position, context, true, userOpName) |> RoslynHelpers.StartAsyncUnitAsTask(context.CancellationToken) - member __.FindImplementationsAsync(document, position, context) = + member _.FindImplementationsAsync(document, position, context) = findReferencedSymbolsAsync(document, position, context, false, userOpName) |> RoslynHelpers.StartAsyncUnitAsTask(context.CancellationToken) \ No newline at end of file diff --git a/Navigation/GoToDefinition.fs b/Navigation/GoToDefinition.fs index 035cb1b35c0..0748683420b 100644 --- a/Navigation/GoToDefinition.fs +++ b/Navigation/GoToDefinition.fs @@ -18,8 +18,8 @@ open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Navigation open Microsoft.VisualStudio.Shell.Interop -open FSharp.Compiler.Range open FSharp.Compiler.SourceCodeServices +open FSharp.Compiler.Text module private Symbol = let fullName (root: ISymbol) : string = @@ -115,7 +115,7 @@ type internal StatusBar(statusBar: IVsStatusbar) = statusBar.FreezeOutput 0 |> ignore statusBar.Clear() |> ignore - member __.Message(_msg: string) = + member _.Message(_msg: string) = () //let _, frozen = statusBar.IsFrozen() //// unfreeze the status bar @@ -134,13 +134,13 @@ type internal StatusBar(statusBar: IVsStatusbar) = // | _ -> clear() //}|> Async.Start - member __.Clear() = () //clear() + member _.Clear() = () //clear() /// Animated magnifying glass that displays on the status bar while a symbol search is in progress. - member __.Animate() : IDisposable = + member _.Animate() : IDisposable = //statusBar.Animation (1, &searchIcon) |> ignore { new IDisposable with - member __.Dispose() = () } //statusBar.Animation(0, &searchIcon) |> ignore } + member _.Dispose() = () } //statusBar.Animation(0, &searchIcon) |> ignore } type internal FSharpGoToDefinitionNavigableItem(document, sourceSpan) = inherit FSharpNavigableItem(Glyph.BasicFile, ImmutableArray.Empty, document, sourceSpan) @@ -166,7 +166,7 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP } /// Helper function that is used to determine the navigation strategy to apply, can be tuned towards signatures or implementation files. - member private __.FindSymbolHelper (originDocument: Document, originRange: range, sourceText: SourceText, preferSignature: bool) = + member private _.FindSymbolHelper (originDocument: Document, originRange: range, sourceText: SourceText, preferSignature: bool) = asyncMaybe { let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(originDocument, CancellationToken.None, userOpName) let defines = CompilerEnvironment.GetCompilationDefinesForEditing parsingOptions @@ -204,7 +204,7 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP /// if the symbol is defined in the given file, return its declaration location, otherwise use the targetSymbol to find the first /// instance of its presence in the provided source file. The first case is needed to return proper declaration location for /// recursive type definitions, where the first its usage may not be the declaration. - member __.FindSymbolDeclarationInFile(targetSymbolUse: FSharpSymbolUse, filePath: string, sourceText: SourceText, options: FSharpProjectOptions, fileVersion:int) = + member _.FindSymbolDeclarationInFile(targetSymbolUse: FSharpSymbolUse, filePath: string, sourceText: SourceText, options: FSharpProjectOptions, fileVersion:int) = asyncMaybe { match targetSymbolUse.Symbol.DeclarationLocation with | Some decl when decl.FileName = filePath -> return decl @@ -342,7 +342,7 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP /// Navigate to the positon of the textSpan in the provided document /// used by quickinfo link navigation when the tooltip contains the correct destination range. - member __.TryNavigateToTextSpan(document: Document, textSpan: TextSpan, statusBar: StatusBar) = + member _.TryNavigateToTextSpan(document: Document, textSpan: TextSpan, statusBar: StatusBar) = let navigableItem = FSharpGoToDefinitionNavigableItem(document, textSpan) let workspace = document.Project.Solution.Workspace let navigationService = workspace.Services.GetService() @@ -352,7 +352,7 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP if not navigationSucceeded then statusBar.TempMessage (SR.CannotNavigateUnknown()) - member __.NavigateToItem(navigableItem: FSharpNavigableItem, statusBar: StatusBar) = + member _.NavigateToItem(navigableItem: FSharpNavigableItem, statusBar: StatusBar) = use __ = statusBar.Animate() statusBar.Message (SR.NavigatingTo()) diff --git a/Navigation/GoToDefinitionService.fs b/Navigation/GoToDefinitionService.fs index 1a5b1e611ec..e8bb0d1fdc9 100644 --- a/Navigation/GoToDefinitionService.fs +++ b/Navigation/GoToDefinitionService.fs @@ -29,12 +29,12 @@ type internal FSharpGoToDefinitionService interface IFSharpGoToDefinitionService with /// Invoked with Peek Definition. - member __.FindDefinitionsAsync (document: Document, position: int, cancellationToken: CancellationToken) = + member _.FindDefinitionsAsync (document: Document, position: int, cancellationToken: CancellationToken) = gtd.FindDefinitionsForPeekTask(document, position, cancellationToken) /// Invoked with Go to Definition. /// Try to navigate to the definiton of the symbol at the symbolRange in the originDocument - member __.TryGoToDefinition(document: Document, position: int, cancellationToken: CancellationToken) = + member _.TryGoToDefinition(document: Document, position: int, cancellationToken: CancellationToken) = statusBar.Message(SR.LocatingSymbol()) use __ = statusBar.Animate() diff --git a/Navigation/NavigableSymbolsService.fs b/Navigation/NavigableSymbolsService.fs index a1022788ab6..2c7b1b7a894 100644 --- a/Navigation/NavigableSymbolsService.fs +++ b/Navigation/NavigableSymbolsService.fs @@ -21,12 +21,12 @@ open Microsoft.VisualStudio.Shell [] type internal FSharpNavigableSymbol(item: FSharpNavigableItem, span: SnapshotSpan, gtd: GoToDefinition, statusBar: StatusBar) = interface INavigableSymbol with - member __.Navigate(_: INavigableRelationship) = + member _.Navigate(_: INavigableRelationship) = gtd.NavigateToItem(item, statusBar) - member __.Relationships = seq { yield PredefinedNavigableRelationships.Definition } + member _.Relationships = seq { yield PredefinedNavigableRelationships.Definition } - member __.SymbolSpan = span + member _.SymbolSpan = span type internal FSharpNavigableSymbolSource(checkerProvider: FSharpCheckerProvider, projectInfoManager: FSharpProjectOptionsManager, serviceProvider: IServiceProvider) = @@ -35,7 +35,7 @@ type internal FSharpNavigableSymbolSource(checkerProvider: FSharpCheckerProvider let statusBar = StatusBar(serviceProvider.GetService()) interface INavigableSymbolSource with - member __.GetNavigableSymbolAsync(triggerSpan: SnapshotSpan, cancellationToken: CancellationToken) = + member _.GetNavigableSymbolAsync(triggerSpan: SnapshotSpan, cancellationToken: CancellationToken) = // Yes, this is a code smell. But this is how the editor API accepts what we would treat as None. if disposed then null else @@ -79,7 +79,7 @@ type internal FSharpNavigableSymbolSource(checkerProvider: FSharpCheckerProvider |> Async.map Option.toObj |> RoslynHelpers.StartAsyncAsTask cancellationToken - member __.Dispose() = + member _.Dispose() = disposed <- true [)>] @@ -95,5 +95,5 @@ type internal FSharpNavigableSymbolService ) = interface INavigableSymbolSourceProvider with - member __.TryCreateNavigableSymbolSource(_: ITextView, _: ITextBuffer) = + member _.TryCreateNavigableSymbolSource(_: ITextView, _: ITextBuffer) = new FSharpNavigableSymbolSource(checkerProvider, projectInfoManager, serviceProvider) :> INavigableSymbolSource \ No newline at end of file diff --git a/Navigation/NavigateToSearchService.fs b/Navigation/NavigateToSearchService.fs index 3fb063047ec..bba3ebff543 100644 --- a/Navigation/NavigateToSearchService.fs +++ b/Navigation/NavigateToSearchService.fs @@ -22,15 +22,14 @@ open Microsoft.CodeAnalysis.PatternMatching open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Navigation open Microsoft.CodeAnalysis.ExternalAccess.FSharp.NavigateTo -open FSharp.Compiler open FSharp.Compiler.SourceCodeServices type internal NavigableItem(document: Document, sourceSpan: TextSpan, glyph: Glyph, name: string, kind: string, additionalInfo: string) = inherit FSharpNavigableItem(glyph, ImmutableArray.Create (TaggedText(TextTags.Text, name)), document, sourceSpan) - member __.Name = name - member __.Kind = kind - member __.AdditionalInfo = additionalInfo + member _.Name = name + member _.Kind = kind + member _.AdditionalInfo = additionalInfo type internal NavigateToSearchResult(item: NavigableItem, matchKind: FSharpNavigateToMatchKind) = inherit FSharpNavigateToSearchResult(item.AdditionalInfo, item.Kind, matchKind, item.Name, item) @@ -38,19 +37,19 @@ type internal NavigateToSearchResult(item: NavigableItem, matchKind: FSharpNavig module private Index = [] type private IndexEntry(str: string, offset: int, item: NavigableItem, isOperator: bool) = - member __.String = str - member __.Offset = offset - member __.Length = str.Length - offset - member __.Item = item - member __.IsOperator = isOperator + member _.String = str + member _.Offset = offset + member _.Length = str.Length - offset + member _.Item = item + member _.IsOperator = isOperator member x.StartsWith (s: string) = if s.Length > x.Length then false else CultureInfo.CurrentCulture.CompareInfo.IndexOf(str, s, offset, s.Length, CompareOptions.IgnoreCase) = offset - member private __.DebugString() = sprintf "%s (offset %d) (%s)" (str.Substring offset) offset str + member private _.DebugString() = sprintf "%s (offset %d) (%s)" (str.Substring offset) offset str let private indexEntryComparer = { new IComparer with - member __.Compare(a, b) = + member _.Compare(a, b) = let res = CultureInfo.CurrentCulture.CompareInfo.Compare(a.String, a.Offset, b.String, b.Offset, CompareOptions.IgnoreCase) if res = 0 then a.Offset.CompareTo(b.Offset) else res } @@ -60,13 +59,13 @@ module private Index = let private navigateToSearchResultComparer = { new IEqualityComparer with - member __.Equals(x: FSharpNavigateToSearchResult, y: FSharpNavigateToSearchResult) = + member _.Equals(x: FSharpNavigateToSearchResult, y: FSharpNavigateToSearchResult) = match x, y with | null, _ | _, null -> false | _ -> x.NavigableItem.Document.Id = y.NavigableItem.Document.Id && x.NavigableItem.SourceSpan = y.NavigableItem.SourceSpan - member __.GetHashCode(x: FSharpNavigateToSearchResult) = + member _.GetHashCode(x: FSharpNavigateToSearchResult) = if isNull x then 0 else 23 * (17 * 23 + x.NavigableItem.Document.Id.GetHashCode()) + x.NavigableItem.SourceSpan.GetHashCode() } @@ -84,7 +83,7 @@ module private Index = entries.Sort(indexEntryComparer) { new IIndexedNavigableItems with - member __.Find (searchValue) = + member _.Find (searchValue) = let result = HashSet(navigateToSearchResultComparer) if entries.Count > 0 then let entryToFind = IndexEntry(searchValue, 0, Unchecked.defaultof<_>, Unchecked.defaultof<_>) @@ -116,7 +115,7 @@ module private Index = handle pos pos <- pos + 1 Seq.toArray result - member __.AllItems = items } + member _.AllItems = items } [] module private Utils = @@ -228,7 +227,7 @@ type internal FSharpNavigateToSearchService | _ -> FSharpNavigateToMatchKind.Regular interface IFSharpNavigateToSearchService with - member __.SearchProjectAsync(project, _priorityDocuments, searchPattern, kinds, cancellationToken) : Task> = + member _.SearchProjectAsync(project, _priorityDocuments, searchPattern, kinds, cancellationToken) : Task> = asyncMaybe { let! parsingOptions, _options = projectInfoManager.TryGetOptionsByProject(project, cancellationToken) let! items = @@ -260,7 +259,7 @@ type internal FSharpNavigateToSearchService |> Async.map Seq.toImmutableArray |> RoslynHelpers.StartAsyncAsTask(cancellationToken) - member __.SearchDocumentAsync(document, searchPattern, kinds, cancellationToken) : Task> = + member _.SearchDocumentAsync(document, searchPattern, kinds, cancellationToken) : Task> = asyncMaybe { let! parsingOptions, _, _ = projectInfoManager.TryGetOptionsForDocumentOrProject(document, cancellationToken, userOpName) let! items = getCachedIndexedNavigableItems(document, parsingOptions, kinds) |> liftAsync @@ -270,6 +269,6 @@ type internal FSharpNavigateToSearchService |> Async.map Seq.toImmutableArray |> RoslynHelpers.StartAsyncAsTask(cancellationToken) - member __.KindsProvided = kindsProvided + member _.KindsProvided = kindsProvided - member __.CanFilter = true \ No newline at end of file + member _.CanFilter = true \ No newline at end of file diff --git a/Navigation/NavigationBarItemService.fs b/Navigation/NavigationBarItemService.fs index 13350004ab1..f4ab05b6f3c 100644 --- a/Navigation/NavigationBarItemService.fs +++ b/Navigation/NavigationBarItemService.fs @@ -30,7 +30,7 @@ type internal FSharpNavigationBarItemService static let emptyResult: IList = upcast [||] interface IFSharpNavigationBarItemService with - member __.GetItemsAsync(document, cancellationToken) : Task> = + member _.GetItemsAsync(document, cancellationToken) : Task> = asyncMaybe { let! parsingOptions, _options = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document, cancellationToken, userOpName) let! sourceText = document.GetTextAsync(cancellationToken) diff --git a/Options/EditorOptions.fs b/Options/EditorOptions.fs index 7485176811a..c4f8c518d22 100644 --- a/Options/EditorOptions.fs +++ b/Options/EditorOptions.fs @@ -121,19 +121,19 @@ type EditorOptions store.Register CodeLensOptions.Default store.Register FormattingOptions.Default - member __.IntelliSense : IntelliSenseOptions = store.Get() - member __.QuickInfo : QuickInfoOptions = store.Get() - member __.CodeFixes : CodeFixesOptions = store.Get() - member __.LanguageServicePerformance : LanguageServicePerformanceOptions = store.Get() - member __.Advanced: AdvancedOptions = store.Get() - member __.CodeLens: CodeLensOptions = store.Get() - member __.Formatting : FormattingOptions = store.Get() + member _.IntelliSense : IntelliSenseOptions = store.Get() + member _.QuickInfo : QuickInfoOptions = store.Get() + member _.CodeFixes : CodeFixesOptions = store.Get() + member _.LanguageServicePerformance : LanguageServicePerformanceOptions = store.Get() + member _.Advanced: AdvancedOptions = store.Get() + member _.CodeLens: CodeLensOptions = store.Get() + member _.Formatting : FormattingOptions = store.Get() interface Microsoft.CodeAnalysis.Host.IWorkspaceService interface IPersistSettings with - member __.LoadSettings() = store.LoadSettings() - member __.SaveSettings(settings) = store.SaveSettings(settings) + member _.LoadSettings() = store.LoadSettings() + member _.SaveSettings(settings) = store.SaveSettings(settings) [] @@ -193,11 +193,11 @@ module internal OptionsUI = [] type internal AdvancedSettingsOptionPage() = inherit AbstractOptionPage() - override __.CreateView() = + override _.CreateView() = upcast AdvancedOptionsControl() [] type internal FormattingOptionPage() = inherit AbstractOptionPage() - override __.CreateView() = + override _.CreateView() = upcast FormattingOptionsControl() diff --git a/Options/SettingsPersistence.fs b/Options/SettingsPersistence.fs index 096aebc9544..22f726ec37d 100644 --- a/Options/SettingsPersistence.fs +++ b/Options/SettingsPersistence.fs @@ -58,14 +58,14 @@ type SettingsStore(serviceProvider: IServiceProvider) = |> Option.iter (fun json -> try JsonConvert.PopulateObject(json, copy) with _ -> ()) copy - member __.Get() = getCached() + member _.Get() = getCached() // Used by the AbstractOptionPage to populate dialog controls. // We always have the latest value in the cache so we just return // cloned value here because it may be altered by the UI if declared with [] - member __.LoadSettings() = getCached() |> clone + member _.LoadSettings() = getCached() |> clone - member __.SaveSettings settings = + member _.SaveSettings settings = // We replace default serialization with Newtonsoft.Json for easy schema evolution. // For example, if we add a new bool field to the record, representing another checkbox in Options dialog // deserialization will still work fine. When we pass default value to JsonConvert.PopulateObject it will @@ -74,7 +74,7 @@ type SettingsStore(serviceProvider: IServiceProvider) = |> Async.AwaitTask |> Async.Start // This is the point we retrieve the initial value and subscribe to watch for changes - member __.Register (defaultSettings : 'options) = + member _.Register (defaultSettings : 'options) = defaultSettings |> updateFromStore |> keepInCache let subset = defaultSettings.GetType() |> storageKey |> settingsManager.GetSubset // this event is also raised when a setting change occurs in another VS instance, so we can keep everything in sync diff --git a/QuickInfo/NavigableTextRun.fs b/QuickInfo/NavigableTextRun.fs index 1ebb945903f..006041e0a92 100644 --- a/QuickInfo/NavigableTextRun.fs +++ b/QuickInfo/NavigableTextRun.fs @@ -4,6 +4,6 @@ namespace Microsoft.VisualStudio.FSharp.Editor [] type NavigableTextRun(classificationTypeName:string, text:string, navigateAction:unit -> unit) = - member __.ClassificationTypeName = classificationTypeName - member __.Text = text - member __.NavigateAction = navigateAction + member _.ClassificationTypeName = classificationTypeName + member _.Text = text + member _.NavigateAction = navigateAction diff --git a/QuickInfo/Navigation.fs b/QuickInfo/Navigation.fs index 63a5041f3ea..42ba354cc99 100644 --- a/QuickInfo/Navigation.fs +++ b/QuickInfo/Navigation.fs @@ -7,8 +7,8 @@ open System open Microsoft.CodeAnalysis open FSharp.Compiler.SourceCodeServices - -open FSharp.Compiler.Range +open FSharp.Compiler.Text.Range +open FSharp.Compiler.Text open Microsoft.VisualStudio.Shell.Interop type internal QuickInfoNavigation @@ -23,12 +23,12 @@ type internal QuickInfoNavigation let workspace = initialDoc.Project.Solution.Workspace let solution = workspace.CurrentSolution - member __.IsTargetValid (range: range) = + member _.IsTargetValid (range: range) = range <> rangeStartup && range <> thisSymbolUseRange && solution.TryGetDocumentIdFromFSharpRange (range, initialDoc.Project.Id) |> Option.isSome - member __.RelativePath (range: range) = + member _.RelativePath (range: range) = let relativePathEscaped = match solution.FilePath with | null -> range.FileName @@ -37,7 +37,7 @@ type internal QuickInfoNavigation Uri(sfp).MakeRelativeUri(targetUri).ToString() relativePathEscaped |> Uri.UnescapeDataString - member __.NavigateTo (range: range) = + member _.NavigateTo (range: range) = asyncMaybe { let targetPath = range.FileName let! targetDoc = solution.TryGetDocumentFromFSharpRange (range, initialDoc.Project.Id) diff --git a/QuickInfo/QuickInfoProvider.fs b/QuickInfo/QuickInfoProvider.fs index 4a35cf19023..edac14355b2 100644 --- a/QuickInfo/QuickInfoProvider.fs +++ b/QuickInfo/QuickInfoProvider.fs @@ -17,9 +17,9 @@ open Microsoft.VisualStudio.Shell.Interop open Microsoft.VisualStudio.Text open Microsoft.VisualStudio.Utilities +open FSharp.Compiler.Text open FSharp.Compiler.TextLayout open FSharp.Compiler.SourceCodeServices -open FSharp.Compiler.Range type internal QuickInfo = { StructuredText: FSharpStructuredToolTipText @@ -201,11 +201,11 @@ type internal FSharpAsyncQuickInfoSource (mainDescription, docs) interface IAsyncQuickInfoSource with - override __.Dispose() = () // no cleanup necessary + override _.Dispose() = () // no cleanup necessary // This method can be called from the background thread. // Do not call IServiceProvider.GetService here. - override __.GetQuickInfoItemAsync(session:IAsyncQuickInfoSession, cancellationToken:CancellationToken) : Task = + override _.GetQuickInfoItemAsync(session:IAsyncQuickInfoSession, cancellationToken:CancellationToken) : Task = let triggerPoint = session.GetTriggerPoint(textBuffer.CurrentSnapshot) match triggerPoint.HasValue with | false -> Task.FromResult(null) @@ -275,7 +275,7 @@ type internal FSharpAsyncQuickInfoSourceProvider ) = interface IAsyncQuickInfoSourceProvider with - override __.TryCreateQuickInfoSource(textBuffer:ITextBuffer) : IAsyncQuickInfoSource = + override _.TryCreateQuickInfoSource(textBuffer:ITextBuffer) : IAsyncQuickInfoSource = // GetService calls must be made on the UI thread // It is safe to do it here (see #4713) let statusBar = StatusBar(serviceProvider.GetService()) diff --git a/QuickInfo/Views.fs b/QuickInfo/Views.fs index 37cb7e3e28f..86127ba695d 100644 --- a/QuickInfo/Views.fs +++ b/QuickInfo/Views.fs @@ -5,7 +5,6 @@ namespace Microsoft.VisualStudio.FSharp.Editor open System.Collections.Generic open FSharp.Compiler.TextLayout open Microsoft.CodeAnalysis.Classification -open FSharp.Compiler open Microsoft.VisualStudio.Core.Imaging open Microsoft.VisualStudio.Language.StandardClassification open Microsoft.VisualStudio.Text.Adornments diff --git a/QuickInfo/WpfNagivableTextRunViewElementFactory.fs b/QuickInfo/WpfNagivableTextRunViewElementFactory.fs index f560382b34a..134105e9ef8 100644 --- a/QuickInfo/WpfNagivableTextRunViewElementFactory.fs +++ b/QuickInfo/WpfNagivableTextRunViewElementFactory.fs @@ -23,7 +23,7 @@ type WpfNavigableTextRunViewElementFactory ) = let styles = Microsoft.VisualStudio.FSharp.UIResources.NavStyles() interface IViewElementFactory with - override __.CreateViewElement<'TView when 'TView: not struct>(textView:ITextView, model:obj) : 'TView = + override _.CreateViewElement<'TView when 'TView: not struct>(textView:ITextView, model:obj) : 'TView = if not (model :? NavigableTextRun) || typeof<'TView> <> typeof then failwith <| sprintf "Invalid type conversion. Supported conversion is `%s` to `%s`." typeof.Name typeof.Name diff --git a/Structure/BlockStructureService.fs b/Structure/BlockStructureService.fs index 13c74ef0f53..3d7bc78f835 100644 --- a/Structure/BlockStructureService.fs +++ b/Structure/BlockStructureService.fs @@ -12,7 +12,6 @@ open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.Structure open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Structure -open FSharp.Compiler open FSharp.Compiler.SourceCodeServices open FSharp.Compiler.SourceCodeServices.Structure open FSharp.Compiler.SyntaxTree @@ -150,7 +149,7 @@ type internal FSharpBlockStructureService [] (checkerProvi interface IFSharpBlockStructureService with - member __.GetBlockStructureAsync(document, cancellationToken) : Task = + member _.GetBlockStructureAsync(document, cancellationToken) : Task = asyncMaybe { let! parsingOptions, _options = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document, cancellationToken, userOpName) let! sourceText = document.GetTextAsync(cancellationToken)