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

Commitcee7f90

Browse files
committed
rename tooltip to quickInfo where appropriate
1 parenta71287f commitcee7f90

File tree

1 file changed

+76
-76
lines changed

1 file changed

+76
-76
lines changed

‎vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs‎

Lines changed: 76 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ open Microsoft.FSharp.Compiler
2323

2424
openInternal.Utilities.StructuredFormat
2525

26-
typeprivateTooltipInfo=
27-
{ StructuredText:FSharpStructuredToolTipText
26+
typeprivateQuickInfo=
27+
{ StructuredText:FSharpStructuredToolTipText
2828
Span:TextSpan
2929
Symbol:FSharpSymbol
3030
SymbolKind:LexerSymbolKind}
@@ -35,17 +35,17 @@ module private FSharpQuickInfo =
3535

3636
// when a construct has been declared in a signature file the documentation comments that are
3737
// written in that file are the ones that go into the generated xml when the project is compiled
38-
// therefore we should include these doccoms in our design timetooltips
39-
letgetTooltipFromRange
38+
// therefore we should include these doccoms in our design timequick info
39+
letgetQuickInfoFromRange
4040
(
41-
checker:FSharpChecker,
42-
projectInfoManager:FSharpProjectOptionsManager,
43-
document:Document,
44-
declRange:range,
41+
checker:FSharpChecker,
42+
projectInfoManager:FSharpProjectOptionsManager,
43+
document:Document,
44+
declRange:range,
4545
cancellationToken:CancellationToken
46-
)
47-
:Async<TooltipInfooption>=
48-
46+
)
47+
:Async<QuickInfooption>=
48+
4949
asyncMaybe{
5050
letsolution= document.Project.Solution
5151
// ascertain the location of the target declaration in the signature file
@@ -54,41 +54,41 @@ module private FSharpQuickInfo =
5454
let!extSourceText= extDocument.GetTextAsync cancellationToken
5555
let!extSpan= RoslynHelpers.TryFSharpRangeToTextSpan(extSourceText, declRange)
5656
letextLineText=(extSourceText.Lines.GetLineFromPosition extSpan.Start).ToString()
57-
58-
// project options need to be retrieved because the signature file could be in another project
57+
58+
// project options need to be retrieved because the signature file could be in another project
5959
let!extParsingOptions,_extSite,extProjectOptions= projectInfoManager.TryGetOptionsForProject extDocId.ProjectId
6060
letextDefines= CompilerEnvironment.GetCompilationDefinesForEditing extParsingOptions
6161
let!extLexerSymbol= Tokenizer.getSymbolAtPosition(extDocId, extSourceText, extSpan.Start, declRange.FileName, extDefines, SymbolLookupKind.Greedy,true)
6262
let!_,_,extCheckFileResults= checker.ParseAndCheckDocument(extDocument, extProjectOptions, allowStaleResults=true, sourceText=extSourceText, userOpName= userOpName)
63-
64-
let!extTooltipText=
63+
64+
let!extQuickInfoText=
6565
extCheckFileResults.GetStructuredToolTipText
6666
(declRange.StartLine, extLexerSymbol.Ident.idRange.EndColumn, extLineText, extLexerSymbol.FullIsland, FSharpTokenTag.IDENT, userOpName=userOpName)|> liftAsync
67-
68-
matchextTooltipTextwith
69-
| FSharpToolTipText[]
67+
68+
matchextQuickInfoTextwith
69+
| FSharpToolTipText[]
7070
| FSharpToolTipText[FSharpStructuredToolTipElement.None]->return! None
71-
|extTooltipText->
71+
|extQuickInfoText->
7272
let!extSymbolUse=
7373
extCheckFileResults.GetSymbolUseAtLocation(declRange.StartLine, extLexerSymbol.Ident.idRange.EndColumn, extLineText, extLexerSymbol.FullIsland, userOpName=userOpName)
7474
let!span= RoslynHelpers.TryFSharpRangeToTextSpan(extSourceText, extLexerSymbol.Range)
75-
76-
return{ StructuredText=extTooltipText
75+
76+
return{ StructuredText=extQuickInfoText
7777
Span= span
7878
Symbol= extSymbolUse.Symbol
7979
SymbolKind= extLexerSymbol.Kind}
8080
}
8181

82-
/// Gettooltip combined from doccom of Signature and definition
83-
letgetTooltipInfo
82+
/// GetQuickInfo combined from doccom of Signature and definition
83+
letgetQuickInfo
8484
(
85-
checker:FSharpChecker,
86-
projectInfoManager:FSharpProjectOptionsManager,
87-
document:Document,
88-
position:int,
85+
checker:FSharpChecker,
86+
projectInfoManager:FSharpProjectOptionsManager,
87+
document:Document,
88+
position:int,
8989
cancellationToken:CancellationToken
90-
)
91-
:Async<(FSharpSymbolUse*TooltipInfo option*TooltipInfo option)option>=
90+
)
91+
:Async<(FSharpSymbolUse*QuickInfo option*QuickInfo option)option>=
9292

9393
asyncMaybe{
9494
let!sourceText= document.GetTextAsync cancellationToken
@@ -101,60 +101,60 @@ module private FSharpQuickInfo =
101101
letfcsTextLineNumber= Line.fromZ textLinePos.Line
102102
letlineText=(sourceText.Lines.GetLineFromPosition position).ToString()
103103
let!symbolUse= checkFileResults.GetSymbolUseAtLocation(fcsTextLineNumber, idRange.EndColumn, lineText, lexerSymbol.FullIsland, userOpName=userOpName)
104-
105-
/// Gets thetooltip information for the orignal target
106-
letgetTargetSymbolTooltip()=
104+
105+
/// Gets theQuickInfo information for the orignal target
106+
letgetTargetSymbolQuickInfo()=
107107
asyncMaybe{
108-
let!targetTooltip=
108+
let!targetQuickInfo=
109109
checkFileResults.GetStructuredToolTipText
110110
(fcsTextLineNumber, idRange.EndColumn, lineText, lexerSymbol.FullIsland, FSharpTokenTag.IDENT, userOpName=userOpName)|> liftAsync
111-
112-
matchtargetTooltipwith
113-
| FSharpToolTipText[]
111+
112+
matchtargetQuickInfowith
113+
| FSharpToolTipText[]
114114
| FSharpToolTipText[FSharpStructuredToolTipElement.None]->return! None
115-
|_->
115+
|_->
116116
let!targetTextSpan= RoslynHelpers.TryFSharpRangeToTextSpan(sourceText, lexerSymbol.Range)
117-
return{ StructuredText=targetTooltip
117+
return{ StructuredText=targetQuickInfo
118118
Span= targetTextSpan
119119
Symbol= symbolUse.Symbol
120120
SymbolKind= lexerSymbol.Kind}
121-
}
121+
}
122122

123-
// if the target is in a signature file, adjusting thetooltip info is unnecessary
123+
// if the target is in a signature file, adjusting thequick info is unnecessary
124124
if isSignatureFile document.FilePaththen
125-
let!targetTooltipInfo=getTargetSymbolTooltip()
126-
return symbolUse, None, SometargetTooltipInfo
125+
let!targetQuickInfo=getTargetSymbolQuickInfo()
126+
return symbolUse, None, SometargetQuickInfo
127127
else
128128
// find the declaration location of the target symbol, with a preference for signature files
129129
let!findSigDeclarationResult= checkFileResults.GetDeclarationLocation(idRange.StartLine, idRange.EndColumn, lineText, lexerSymbol.FullIsland, preferFlag=true, userOpName=userOpName)|> liftAsync
130-
131-
// it is necessary to retrieve the backuptooltip info because this acquires
132-
// the textSpan designating where we want thetooltip to appear.
133-
let!targetTooltipInfo=getTargetSymbolTooltip()
134-
130+
131+
// it is necessary to retrieve the backupquick info because this acquires
132+
// the textSpan designating where we want thequick info to appear.
133+
let!targetQuickInfo=getTargetSymbolQuickInfo()
134+
135135
let!result=
136136
match findSigDeclarationResultwith
137137
| FSharpFindDeclResult.DeclFound declRangewhen isSignatureFile declRange.FileName->
138138
asyncMaybe{
139-
let!sigTooltipInfo=getTooltipFromRange(checker, projectInfoManager, document, declRange, cancellationToken)
140-
139+
let!sigQuickInfo=getQuickInfoFromRange(checker, projectInfoManager, document, declRange, cancellationToken)
140+
141141
// if the target was declared in a signature file, and the current file
142142
// is not the corresponding module implementation file for that signature,
143-
// the doccoms from the signature will overwrite any doccoms that might be
143+
// the doccoms from the signature will overwrite any doccoms that might be
144144
// present on the definition/implementation
145-
let!findImplDefinitionResult= checkFileResults.GetDeclarationLocation(idRange.StartLine, idRange.EndColumn, lineText, lexerSymbol.FullIsland, preferFlag=false, userOpName=userOpName)|> liftAsync
146-
147-
match findImplDefinitionResultwith
148-
| FSharpFindDeclResult.DeclNotFound_
149-
| FSharpFindDeclResult.ExternalDecl_->return symbolUse, SomesigTooltipInfo, None
150-
| FSharpFindDeclResult.DeclFound declRange->
151-
let!implTooltipInfo=getTooltipFromRange(checker, projectInfoManager, document, declRange, cancellationToken)
152-
return symbolUse, SomesigTooltipInfo, Some{implTooltipInfowith Span=targetTooltipInfo.Span}
145+
let!findImplDefinitionResult= checkFileResults.GetDeclarationLocation(idRange.StartLine, idRange.EndColumn, lineText, lexerSymbol.FullIsland, preferFlag=false, userOpName=userOpName)|> liftAsync
146+
147+
match findImplDefinitionResultwith
148+
| FSharpFindDeclResult.DeclNotFound_
149+
| FSharpFindDeclResult.ExternalDecl_->return symbolUse, SomesigQuickInfo, None
150+
| FSharpFindDeclResult.DeclFound declRange->
151+
let!implQuickInfo=getQuickInfoFromRange(checker, projectInfoManager, document, declRange, cancellationToken)
152+
return symbolUse, SomesigQuickInfo, Some{implQuickInfowith Span=targetQuickInfo.Span}
153153
}
154154
|_-> async.Return None
155155
|> liftAsync
156-
157-
return result|> Option.defaultValue(symbolUse, None, SometargetTooltipInfo)
156+
157+
return result|> Option.defaultValue(symbolUse, None, SometargetQuickInfo)
158158
}
159159

160160
typeinternalFSharpAsyncQuickInfoSource
@@ -196,26 +196,26 @@ type internal FSharpAsyncQuickInfoSource
196196
letdocumentationBuilder= XmlDocumentation.CreateDocumentationBuilder(xmlMemberIndexService, serviceProvider.DTE)
197197
asyncMaybe{
198198
letdocument= textBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges()
199-
let!symbolUse,sigTooltipInfo,targetTooltipInfo= FSharpQuickInfo.getTooltipInfo(checkerProvider.Checker, projectInfoManager, document, triggerPoint.Position, cancellationToken)
199+
let!symbolUse,sigQuickInfo,targetQuickInfo= FSharpQuickInfo.getQuickInfo(checkerProvider.Checker, projectInfoManager, document, triggerPoint.Position, cancellationToken)
200200
letgetTrackingSpan(span:TextSpan)=
201201
textBuffer.CurrentSnapshot.CreateTrackingSpan(span.Start, span.Length, SpanTrackingMode.EdgeInclusive)
202202

203-
matchsigTooltipInfo, targetTooltipInfowith
203+
matchsigQuickInfo, targetQuickInfowith
204204
| None, None->returnnull
205-
| Sometooltip, None
206-
| None, Sometooltip->
205+
| SomequickInfo, None
206+
| None, SomequickInfo->
207207
letmainDescription,documentation,typeParameterMap,usage,exceptions= ResizeArray(), ResizeArray(), ResizeArray(), ResizeArray(), ResizeArray()
208-
XmlDocumentation.BuildDataTipText(documentationBuilder, mainDescription.Add, documentation.Add, typeParameterMap.Add, usage.Add, exceptions.Add,tooltip.StructuredText)
209-
letimageId= Tokenizer.GetImageIdForSymbol(tooltip.Symbol,tooltip.SymbolKind)
208+
XmlDocumentation.BuildDataTipText(documentationBuilder, mainDescription.Add, documentation.Add, typeParameterMap.Add, usage.Add, exceptions.Add,quickInfo.StructuredText)
209+
letimageId= Tokenizer.GetImageIdForSymbol(quickInfo.Symbol,quickInfo.SymbolKind)
210210
letnavigation= QuickInfoNavigation(gotoDefinitionService, document, symbolUse.RangeAlternate)
211211
letcontent= QuickInfoViewProvider.provideContent(imageId, mainDescription, documentation, typeParameterMap, usage, exceptions, navigation)
212-
letspan= getTrackingSpantooltip.Span
212+
letspan= getTrackingSpanquickInfo.Span
213213
return QuickInfoItem(span, content)
214214

215-
| SomesigTooltip, SometargetTooltip->
215+
| SomesigQuickInfo, SometargetQuickInfo->
216216
letmainDescription,targetDocumentation,sigDocumentation,typeParameterMap,exceptions,usage= ResizeArray(), ResizeArray(), ResizeArray(), ResizeArray(), ResizeArray(), ResizeArray()
217-
XmlDocumentation.BuildDataTipText(documentationBuilder, ignore, sigDocumentation.Add, ignore, ignore, ignore,sigTooltip.StructuredText)
218-
XmlDocumentation.BuildDataTipText(documentationBuilder, mainDescription.Add, targetDocumentation.Add, typeParameterMap.Add, exceptions.Add, usage.Add,targetTooltip.StructuredText)
217+
XmlDocumentation.BuildDataTipText(documentationBuilder, ignore, sigDocumentation.Add, ignore, ignore, ignore,sigQuickInfo.StructuredText)
218+
XmlDocumentation.BuildDataTipText(documentationBuilder, mainDescription.Add, targetDocumentation.Add, typeParameterMap.Add, exceptions.Add, usage.Add,targetQuickInfo.StructuredText)
219219

220220
letwidth=
221221
mainDescription
@@ -242,28 +242,28 @@ type internal FSharpAsyncQuickInfoSource
242242
if String.IsNullOrWhiteSpace tt.Textthen sbelse sb.Append tt.Text)
243243
|> string
244244
if String.IsNullOrWhiteSpace textthen Noneelse Some text
245-
246-
letdocumentation=
245+
246+
letdocumentation=
247247
[match getText targetDocumentation, getText sigDocumentationwith
248248
| None, None->()
249249
| None, Some_->yield! sigDocumentation
250250
| Some_, None->yield! targetDocumentation
251251
| Some implText, Some sigTextwhen implText.Equals(sigText, StringComparison.OrdinalIgnoreCase)->
252252
yield! sigDocumentation
253-
| Some_, Some_->
253+
| Some_, Some_->
254254
yield! sigDocumentation
255255
yield lineBreak
256256
yield seperator
257257
yield lineBreak
258258
yield! targetDocumentation]
259259
|> ResizeArray
260-
letimageId= Tokenizer.GetImageIdForSymbol(targetTooltip.Symbol,targetTooltip.SymbolKind)
260+
letimageId= Tokenizer.GetImageIdForSymbol(targetQuickInfo.Symbol,targetQuickInfo.SymbolKind)
261261
letnavigation= QuickInfoNavigation(gotoDefinitionService, document, symbolUse.RangeAlternate)
262262
letcontent= QuickInfoViewProvider.provideContent(imageId, mainDescription, documentation, typeParameterMap, usage, exceptions, navigation)
263-
letspan= getTrackingSpantargetTooltip.Span
263+
letspan= getTrackingSpantargetQuickInfo.Span
264264
return QuickInfoItem(span, content)
265265
}|> Async.map Option.toObj
266-
|> RoslynHelpers.StartAsyncAsTask cancellationToken
266+
|> RoslynHelpers.StartAsyncAsTask cancellationToken
267267

268268
[<Export(typeof<IAsyncQuickInfoSourceProvider>)>]
269269
[<Name("F# Quick Info Provider")>]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp