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

Commit ceb73ec

Browse files
authored
P2p references (dotnet#3777)
* P2p references * Fix test * test fix * go faster stripes * new project works better * Re-add debug assert for sourcefiles
1 parent cb90024 commit ceb73ec

File tree

7 files changed

+93
-148
lines changed

7 files changed

+93
-148
lines changed

Classification/ColorizationService.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type internal FSharpColorizationService
4040
asyncMaybe {
4141
do Trace.TraceInformation("{0:n3} (start) SemanticColorization", DateTime.Now.TimeOfDay.TotalSeconds)
4242
do! Async.Sleep DefaultTuning.SemanticColorizationInitialDelay |> liftAsync // be less intrusive, give other work priority most of the time
43-
let! _parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForDocumentOrProject(document)
43+
let! _, _, projectOptions = projectInfoManager.TryGetOptionsForDocumentOrProject(document)
4444
let! sourceText = document.GetTextAsync(cancellationToken)
4545
let! _, _, checkResults = checkerProvider.Checker.ParseAndCheckDocument(document, projectOptions, sourceText = sourceText, allowStaleResults = false, userOpName=userOpName)
4646
// it's crucial to not return duplicated or overlapping `ClassifiedSpan`s because Find Usages service crashes.

Diagnostics/DocumentDiagnosticAnalyzer.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ type internal FSharpDocumentDiagnosticAnalyzer() =
122122
override this.AnalyzeSemanticsAsync(document: Document, cancellationToken: CancellationToken): Task<ImmutableArray<Diagnostic>> =
123123
let projectInfoManager = getProjectInfoManager document
124124
asyncMaybe {
125-
let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForDocumentOrProject(document)
125+
let! parsingOptions, _, projectOptions = projectInfoManager.TryGetOptionsForDocumentOrProject(document)
126126
let! sourceText = document.GetTextAsync(cancellationToken)
127127
let! textVersion = document.GetTextVersionAsync(cancellationToken)
128128
return!

LanguageService/LanguageService.fs

Lines changed: 85 additions & 140 deletions
Large diffs are not rendered by default.

LanguageService/SymbolHelpers.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ module internal SymbolHelpers =
5959
|> Seq.map (fun project ->
6060
async {
6161
match projectInfoManager.TryGetOptionsForProject(project.Id) with
62-
| Some (_parsingOptions, projectOptions) ->
62+
| Some (_parsingOptions, _site, projectOptions) ->
6363
let! projectCheckResults = checker.ParseAndCheckProject(projectOptions, userOpName = userOpName)
6464
return! projectCheckResults.GetUsesOfSymbol(symbol)
6565
| None -> return [||]

Navigation/FindUsagesService.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ type internal FSharpFindUsagesService
5151
asyncMaybe {
5252
let! sourceText = document.GetTextAsync(context.CancellationToken) |> Async.AwaitTask |> liftAsync
5353
let checker = checkerProvider.Checker
54-
let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForDocumentOrProject(document)
54+
let! parsingOptions, _, projectOptions = projectInfoManager.TryGetOptionsForDocumentOrProject(document)
5555
let! _, _, checkFileResults = checker.ParseAndCheckDocument(document, projectOptions, sourceText = sourceText, allowStaleResults = true, userOpName = userOpName)
5656
let textLine = sourceText.Lines.GetLineFromPosition(position).ToString()
5757
let lineNumber = sourceText.Lines.GetLinePosition(position).Line + 1
@@ -112,7 +112,7 @@ type internal FSharpFindUsagesService
112112
projectsToCheck
113113
|> Seq.map (fun project ->
114114
asyncMaybe {
115-
let! _parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForProject(project.Id)
115+
let! _parsingOptions, _site, projectOptions = projectInfoManager.TryGetOptionsForProject(project.Id)
116116
let! projectCheckResults = checker.ParseAndCheckProject(projectOptions, userOpName = userOpName) |> liftAsync
117117
return! projectCheckResults.GetUsesOfSymbol(symbolUse.Symbol) |> liftAsync
118118
} |> Async.map (Option.defaultValue [||]))

Navigation/NavigateToSearchService.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ type internal FSharpNavigateToSearchService
233233
interface INavigateToSearchService with
234234
member __.SearchProjectAsync(project, searchPattern, cancellationToken) : Task<ImmutableArray<INavigateToSearchResult>> =
235235
asyncMaybe {
236-
let! parsingOptions, _options = projectInfoManager.TryGetOptionsForProject(project.Id)
236+
let! parsingOptions, _site, _options = projectInfoManager.TryGetOptionsForProject(project.Id)
237237
let! items =
238238
project.Documents
239239
|> Seq.map (fun document -> getCachedIndexedNavigableItems(document, parsingOptions))
@@ -265,7 +265,7 @@ type internal FSharpNavigateToSearchService
265265

266266
member __.SearchDocumentAsync(document, searchPattern, cancellationToken) : Task<ImmutableArray<INavigateToSearchResult>> =
267267
asyncMaybe {
268-
let! parsingOptions, _options = projectInfoManager.TryGetOptionsForDocumentOrProject(document)
268+
let! parsingOptions, _, _ = projectInfoManager.TryGetOptionsForDocumentOrProject(document)
269269
let! items = getCachedIndexedNavigableItems(document, parsingOptions) |> liftAsync
270270
return items.Find(searchPattern)
271271
}

QuickInfo/QuickInfoProvider.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ module private FSharpQuickInfo =
5555
let extLineText = (extSourceText.Lines.GetLineFromPosition extSpan.Start).ToString()
5656

5757
// project options need to be retrieved because the signature file could be in another project
58-
let! extParsingOptions, extProjectOptions = projectInfoManager.TryGetOptionsForProject extDocId.ProjectId
58+
let! extParsingOptions, _extSite, extProjectOptions = projectInfoManager.TryGetOptionsForProject extDocId.ProjectId
5959
let extDefines = CompilerEnvironment.GetCompilationDefinesForEditing (extDocument.FilePath, extParsingOptions)
6060
let! extLexerSymbol = Tokenizer.getSymbolAtPosition(extDocId, extSourceText, extSpan.Start, declRange.FileName, extDefines, SymbolLookupKind.Greedy, true)
6161
let! _, _, extCheckFileResults = checker.ParseAndCheckDocument(extDocument, extProjectOptions, allowStaleResults=true, sourceText=extSourceText, userOpName = userOpName)

0 commit comments

Comments
 (0)