Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8516358

Browse files
dhwedTIHan
authored andcommitted
only ParseAndCheckDocument once in the CompletionProvider (#4123)
1 parent19f1853 commit8516358

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

‎vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,10 @@ type internal FSharpCompletionProvider
9797

9898

9999
static memberProvideCompletionsAsyncAux(checker:FSharpChecker,sourceText:SourceText,caretPosition:int,options:FSharpProjectOptions,filePath:string,
100-
textVersionHash:int,getAllSymbols:unit->AssemblySymbol list)=
100+
textVersionHash:int,getAllSymbols:FSharpCheckFileResults->AssemblySymbol list)=
101101
asyncMaybe{
102102
let!parseResults,_,checkFileResults= checker.ParseAndCheckDocument(filePath, textVersionHash, sourceText.ToString(), options, allowStaleResults=true, userOpName= userOpName)
103103

104-
//#if DEBUG
105-
//Logging.Logging.logInfof "AST:\n%+A" parsedInput
106-
//#endif
107-
108104
lettextLines= sourceText.Lines
109105
letcaretLinePos= textLines.GetLinePosition(caretPosition)
110106
letcaretLine= textLines.GetLineFromPosition(caretPosition)
@@ -113,7 +109,7 @@ type internal FSharpCompletionProvider
113109
letpartialName= QuickParse.GetPartialLongNameEx(caretLine.ToString(), caretLineColumn-1)
114110

115111
letgetAllSymbols()=
116-
getAllSymbols()
112+
getAllSymbols checkFileResults
117113
|> List.filter(fun entity-> entity.FullName.Contains"."&&not(PrettyNaming.IsOperatorName entity.Symbol.DisplayName))
118114

119115
let!declarations= checkFileResults.GetDeclarationListInfo(Some(parseResults), fcsCaretLineNumber, caretLine.ToString(),
@@ -222,8 +218,7 @@ type internal FSharpCompletionProvider
222218
do! Option.guard(CompletionUtils.shouldProvideCompletion(document.Id, document.FilePath, defines, sourceText, context.Position))
223219
let!_parsingOptions,projectOptions= projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document)
224220
let!textVersion= context.Document.GetTextVersionAsync(context.CancellationToken)
225-
let!_,_,fileCheckResults= checker.ParseAndCheckDocument(document, projectOptions,true, userOpName=userOpName)
226-
letgetAllSymbols()=
221+
letgetAllSymbols(fileCheckResults:FSharpCheckFileResults)=
227222
if Settings.IntelliSense.ShowAllSymbols
228223
then assemblyContentProvider.GetAllEntitiesInProjectAndReferencedAssemblies(fileCheckResults)
229224
else[]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp