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

Commit2f0ad0f

Browse files
make QuickInfo description and signature help synchronous
1 parent468a395 commit2f0ad0f

File tree

3 files changed

+191
-163
lines changed

3 files changed

+191
-163
lines changed

‎src/fsharp/vs/ServiceDeclarations.fs‎

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,19 +1306,30 @@ type FSharpDeclarationListItem(name: string, nameInCode: string, glyphMajor: Gly
13061306
memberdecl.Name= name
13071307
memberdecl.NameInCode= nameInCode
13081308

1309+
//member decl.StructuredDescriptionTextAsync =
1310+
// match info with
1311+
// | Choice1Of2 (items, infoReader, m, denv, reactor:IReactorOperations, checkAlive) ->
1312+
// // reactor causes the lambda to execute on the background compiler thread, through the Reactor
1313+
// reactor.EnqueueAndAwaitOpAsync ("DescriptionTextAsync", fun _ct ->
1314+
// // This is where we do some work which may touch TAST data structures owned by the IncrementalBuilder - infoReader, item etc.
1315+
// // It is written to be robust to a disposal of an IncrementalBuilder, in which case it will just return the empty string.
1316+
// // It is best to think of this as a "weak reference" to the IncrementalBuilder, i.e. this code is written to be robust to its
1317+
// // disposal. Yes, you are right to scratch your head here, but this is ok.
1318+
// if checkAlive() then FSharpToolTipText(items |> Seq.toList |> List.map (FormatStructuredDescriptionOfItem true infoReader m denv))
1319+
// else FSharpToolTipText [ FSharpStructuredToolTipElement.Single(wordL (tagText (FSComp.SR.descriptionUnavailable())), FSharpXmlDoc.None) ])
1320+
// | Choice2Of2 result ->
1321+
// async.Return result
1322+
13091323
memberdecl.StructuredDescriptionTextAsync=
1324+
async{
13101325
match infowith
1311-
| Choice1Of2(items, infoReader, m, denv, reactor:IReactorOperations, checkAlive)->
1312-
// reactor causes the lambda to execute on the background compiler thread, through the Reactor
1313-
reactor.EnqueueAndAwaitOpAsync("DescriptionTextAsync",fun _ct->
1314-
// This is where we do some work which may touch TAST data structures owned by the IncrementalBuilder - infoReader, item etc.
1315-
// It is written to be robust to a disposal of an IncrementalBuilder, in which case it will just return the empty string.
1316-
// It is best to think of this as a "weak reference" to the IncrementalBuilder, i.e. this code is written to be robust to its
1317-
// disposal. Yes, you are right to scratch your head here, but this is ok.
1318-
if checkAlive()then FSharpToolTipText(items|> Seq.toList|> List.map(FormatStructuredDescriptionOfItemtrue infoReader m denv))
1319-
else FSharpToolTipText[ FSharpStructuredToolTipElement.Single(wordL(tagText(FSComp.SR.descriptionUnavailable())), FSharpXmlDoc.None)])
1326+
| Choice1Of2(items, infoReader, m, denv, _:IReactorOperations, checkAlive)->
1327+
return
1328+
if checkAlive()then FSharpToolTipText(items|> Seq.toList|> List.map(FormatStructuredDescriptionOfItemtrue infoReader m denv))
1329+
else FSharpToolTipText[ FSharpStructuredToolTipElement.Single(wordL(tagText(FSComp.SR.descriptionUnavailable())), FSharpXmlDoc.None)]
13201330
| Choice2Of2 result->
1321-
async.Return result
1331+
return result
1332+
}
13221333

13231334
memberdecl.DescriptionTextAsync=
13241335
decl.StructuredDescriptionTextAsync

‎src/fsharp/vs/service.fs‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1998,9 +1998,14 @@ type FSharpCheckFileResults(errors: FSharpErrorInfo[], scopeOptX: TypeCheckInfo
19981998

19991999
// Resolve the names at the given location to a set of methods
20002000
memberinfo.GetMethodsAlternate(line,colAtEndOfNames,lineStr,names)=
2001-
letdflt= FSharpMethodGroup("",[||])
2002-
reactorOp"GetMethods" dflt(fun scope->
2003-
scope.GetMethods(line, lineStr, colAtEndOfNames, names))
2001+
async{
2002+
letdflt= FSharpMethodGroup("",[||])
2003+
return
2004+
threadSafeOp
2005+
(fun()-> dflt)
2006+
(fun(scope,_,_)->
2007+
scope.GetMethods(line, lineStr, colAtEndOfNames, names))
2008+
}
20042009

20052010
memberinfo.GetDeclarationLocationAlternate(line,colAtEndOfNames,lineStr,names,?preferFlag)=
20062011
letdflt= FSharpFindDeclResult.DeclNotFound FSharpFindDeclFailureReason.Unknown

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp