-
Notifications
You must be signed in to change notification settings - Fork 833
[VS] Get source text of an Entity symbol's signature for viewing metadata #11325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9e3f160
224a5b6
3a7729b
23dde30
811b258
0fd62ae
cfb4988
1eac4a2
68df78f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -115,6 +115,9 @@ type internal FSharpDocumentDiagnosticAnalyzer | |
| interface IFSharpDocumentDiagnosticAnalyzer with | ||
|
|
||
| member this.AnalyzeSyntaxAsync(document: Document, cancellationToken: CancellationToken): Task<ImmutableArray<Diagnostic>> = | ||
| if document.Project.IsFSharpMetadata then Task.FromResult(ImmutableArray.Empty) | ||
| else | ||
|
|
||
| asyncMaybe { | ||
| let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document, cancellationToken, userOpName) | ||
| return! | ||
|
|
@@ -125,14 +128,14 @@ type internal FSharpDocumentDiagnosticAnalyzer | |
| |> RoslynHelpers.StartAsyncAsTask cancellationToken | ||
|
|
||
| member this.AnalyzeSemanticsAsync(document: Document, cancellationToken: CancellationToken): Task<ImmutableArray<Diagnostic>> = | ||
| if document.Project.IsFSharpMiscellaneousOrMetadata && not document.IsFSharpScript then Task.FromResult(ImmutableArray.Empty) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typically here we would move this into the computation expression and say do! (not document.Project.IsFSharpMiscellaneousOrMetadata || document.IsFSharpScript)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I would also find it confusing for it to be used in that way. A simple
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does, it's |
||
| else | ||
|
|
||
| asyncMaybe { | ||
| let! parsingOptions, _, projectOptions = projectInfoManager.TryGetOptionsForDocumentOrProject(document, cancellationToken, userOpName) | ||
| if document.Project.Name <> FSharpConstants.FSharpMiscellaneousFilesName || isScriptFile document.FilePath then | ||
| return! | ||
| FSharpDocumentDiagnosticAnalyzer.GetDiagnostics(checkerProvider.Checker, document, parsingOptions, projectOptions, DiagnosticsType.Semantic) | ||
| |> liftAsync | ||
| else | ||
| return ImmutableArray<Diagnostic>.Empty | ||
| return! | ||
| FSharpDocumentDiagnosticAnalyzer.GetDiagnostics(checkerProvider.Checker, document, parsingOptions, projectOptions, DiagnosticsType.Semantic) | ||
| |> liftAsync | ||
| } | ||
| |> Async.map (Option.defaultValue ImmutableArray<Diagnostic>.Empty) | ||
| |> RoslynHelpers.StartAsyncAsTask cancellationToken | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,6 +34,9 @@ type internal SimplifyNameDiagnosticAnalyzer | |
| interface IFSharpSimplifyNameDiagnosticAnalyzer with | ||
|
|
||
| member _.AnalyzeSemanticsAsync(descriptor, document: Document, cancellationToken: CancellationToken) = | ||
| if document.Project.IsFSharpMiscellaneousOrMetadata && not document.IsFSharpScript then Tasks.Task.FromResult(ImmutableArray.Empty) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typically here we would move this into the computation expression and say do! (not document.Project.IsFSharpMiscellaneousOrMetadata || document.IsFSharpScript)
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whoops, this should be |
||
| else | ||
|
|
||
| asyncMaybe { | ||
| do! Option.guard document.FSharpOptions.CodeFixes.SimplifyName | ||
| do Trace.TraceInformation("{0:n3} (start) SimplifyName", DateTime.Now.TimeOfDay.TotalSeconds) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,9 @@ type internal UnusedDeclarationsAnalyzer | |
| interface IFSharpUnusedDeclarationsDiagnosticAnalyzer with | ||
|
|
||
| member _.AnalyzeSemanticsAsync(descriptor, document, cancellationToken) = | ||
| if document.Project.IsFSharpMiscellaneousOrMetadata && not document.IsFSharpScript then Threading.Tasks.Task.FromResult(ImmutableArray.Empty) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typically here we would move this into the computation expression and say do! (not document.Project.IsFSharpMiscellaneousOrMetadata || document.IsFSharpScript) |
||
| else | ||
|
|
||
| asyncMaybe { | ||
| do! Option.guard document.FSharpOptions.CodeFixes.UnusedDeclarations | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,6 +38,9 @@ type internal UnusedOpensDiagnosticAnalyzer | |
| interface IFSharpUnusedOpensDiagnosticAnalyzer with | ||
|
|
||
| member _.AnalyzeSemanticsAsync(descriptor, document: Document, cancellationToken: CancellationToken) = | ||
| if document.Project.IsFSharpMiscellaneousOrMetadata && not document.IsFSharpScript then Tasks.Task.FromResult(ImmutableArray.Empty) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Typically here we would move this into the computation expression and say do! (not document.Project.IsFSharpMiscellaneousOrMetadata || document.IsFSharpScript) |
||
| else | ||
|
|
||
| asyncMaybe { | ||
| do Trace.TraceInformation("{0:n3} (start) UnusedOpensAnalyzer", DateTime.Now.TimeOfDay.TotalSeconds) | ||
| let! _parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document, cancellationToken, userOpName) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find