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

Commitf3f2fc0

Browse files
authored
Merge pull requestdotnet#4644 from brettfo/quick-info-async
consume the new VS QuickInfo APIs
2 parents1b6c1ba +cee7f90 commitf3f2fc0

File tree

13 files changed

+469
-303
lines changed

13 files changed

+469
-303
lines changed

‎NuGet.Config‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<addkey="myget.org roslyn-tools"value="https://dotnet.myget.org/F/roslyn-tools/api/v3/index.json" />
1717
<addkey="api.nuget.org"value="https://api.nuget.org/v3/index.json" />
1818
<addkey="myget.org roslyn tools"value="https://dotnet.myget.org/F/roslyn-tools/api/v3/index.json" />
19-
<addkey="myget.org roslyn"value="https://dotnet.myget.org/F/roslyn-for-vs-for-mac/api/v3/index.json" />
19+
<addkey="myget.org roslyn"value="https://dotnet.myget.org/F/roslyn/api/v3/index.json" />
2020
<addkey="myget.org symreader-converter"value="https://dotnet.myget.org/F/symreader-converter/api/v3/index.json" />
2121
</packageSources>
2222

‎RoslynPackageVersion.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.6.0-vs-for-mac-62329-05
1+
2.7.0-beta3-62720-08

‎build/targets/PackageVersions.props‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121
<MicrosoftVisualStudioComponentModelHostPackageVersion>15.0.26201-alpha</MicrosoftVisualStudioComponentModelHostPackageVersion>
2222
<MicrosoftVisualStudioDesignerInterfacesPackageVersion>1.1.4322</MicrosoftVisualStudioDesignerInterfacesPackageVersion>
2323
<MicrosoftVisualStudioEditorPackageVersion>15.0.26201</MicrosoftVisualStudioEditorPackageVersion>
24-
<MicrosoftVisualStudioLanguageStandardClassificationPackageVersion>15.0.26201</MicrosoftVisualStudioLanguageStandardClassificationPackageVersion>
25-
<MicrosoftVisualStudioLanguageIntellisensePackageVersion>15.0.26201</MicrosoftVisualStudioLanguageIntellisensePackageVersion>
24+
<MicrosoftVisualStudioLanguageStandardClassificationPackageVersion>15.6.27740</MicrosoftVisualStudioLanguageStandardClassificationPackageVersion>
25+
<MicrosoftVisualStudioLanguagePackageVersion>15.6.27740</MicrosoftVisualStudioLanguagePackageVersion>
26+
<MicrosoftVisualStudioLanguageIntellisensePackageVersion>15.6.27740</MicrosoftVisualStudioLanguageIntellisensePackageVersion>
2627
<MicrosoftVisualStudioManagedInterfacesPackageVersion>8.0.50727</MicrosoftVisualStudioManagedInterfacesPackageVersion>
2728
<MicrosoftVisualStudioPackageLanguageService150PackageVersion>15.0.26201</MicrosoftVisualStudioPackageLanguageService150PackageVersion>
2829
<MicrosoftVisualStudioProjectAggregatorPackageVersion>8.0.50727</MicrosoftVisualStudioProjectAggregatorPackageVersion>
@@ -35,6 +36,8 @@
3536
<MicrosoftVisualStudioShellInterop100PackageVersion>10.0.30319</MicrosoftVisualStudioShellInterop100PackageVersion>
3637
<MicrosoftVisualStudioShellInterop110PackageVersion>11.0.61030</MicrosoftVisualStudioShellInterop110PackageVersion>
3738
<MicrosoftVisualStudioShellInterop120PackageVersion>12.0.30110</MicrosoftVisualStudioShellInterop120PackageVersion>
39+
<MicrosoftVisualStudioTextUIPackageVersion>15.6.27740</MicrosoftVisualStudioTextUIPackageVersion>
40+
<MicrosoftVisualStudioTextUIWpfPackageVersion>15.6.27740</MicrosoftVisualStudioTextUIWpfPackageVersion>
3841
<MicrosoftVisualStudioTextManagerInteropPackageVersion>7.10.6070</MicrosoftVisualStudioTextManagerInteropPackageVersion>
3942
<MicrosoftVisualStudioTextManagerInterop80PackageVersion>8.0.50727</MicrosoftVisualStudioTextManagerInterop80PackageVersion>
4043
<MicrosoftVisualStudioTextManagerInterop100PackageVersion>10.0.30319</MicrosoftVisualStudioTextManagerInterop100PackageVersion>

‎vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@
7474
<CompileInclude="Navigation\NavigationBarItemService.fs" />
7575
<CompileInclude="Navigation\NavigateToSearchService.fs" />
7676
<CompileInclude="Navigation\FindUsagesService.fs" />
77+
<CompileInclude="QuickInfo\NavigableTextRun.fs" />
78+
<CompileInclude="QuickInfo\WpfNagivableTextRunViewElementFactory.fs" />
7779
<CompileInclude="QuickInfo\Navigation.fs" />
7880
<CompileInclude="QuickInfo\Views.fs" />
7981
<CompileInclude="QuickInfo\QuickInfoProvider.fs" />
@@ -128,6 +130,7 @@
128130
<PackageReferenceInclude="Microsoft.Composition"Version="$(MicrosoftCompositionPackageVersion)" />
129131
<PackageReferenceInclude="Microsoft.VisualStudio.ComponentModelHost"Version="$(MicrosoftVisualStudioComponentModelHostPackageVersion)" />
130132
<PackageReferenceInclude="Microsoft.VisualStudio.Editor"Version="$(MicrosoftVisualStudioEditorPackageVersion)" />
133+
<PackageReferenceInclude="Microsoft.VisualStudio.Language"Version="$(MicrosoftVisualStudioLanguagePackageVersion)" />
131134
<PackageReferenceInclude="Microsoft.VisualStudio.Language.Intellisense"Version="$(MicrosoftVisualStudioLanguageIntellisensePackageVersion)" />
132135
<PackageReferenceInclude="Microsoft.VisualStudio.Language.StandardClassification"Version="$(MicrosoftVisualStudioLanguageStandardClassificationPackageVersion)" />
133136
<PackageReferenceInclude="Microsoft.VisualStudio.LanguageServices"Version="$(MicrosoftVisualStudioLanguageServicesPackageVersion)" />
@@ -137,6 +140,8 @@
137140
<PackageReferenceInclude="Microsoft.VisualStudio.Shell.Immutable.10.0"Version="$(MicrosoftVisualStudioShellImmutable100PackageVersion)" />
138141
<PackageReferenceInclude="Microsoft.VisualStudio.Shell.Immutable.11.0"Version="$(MicrosoftVisualStudioShellImmutable110PackageVersion)" />
139142
<PackageReferenceInclude="Microsoft.VisualStudio.Shell.Interop.11.0"Version="$(MicrosoftVisualStudioShellInterop110PackageVersion)" />
143+
<PackageReferenceInclude="Microsoft.VisualStudio.Text.UI"Version="$(MicrosoftVisualStudioTextUIPackageVersion)" />
144+
<PackageReferenceInclude="Microsoft.VisualStudio.Text.UI.Wpf"Version="$(MicrosoftVisualStudioTextUIWpfPackageVersion)" />
140145
<PackageReferenceInclude="Microsoft.VisualStudio.TextManager.Interop"Version="$(MicrosoftVisualStudioTextManagerInteropPackageVersion)" />
141146
<PackageReferenceInclude="Microsoft.VisualStudio.TextManager.Interop.8.0"Version="$(MicrosoftVisualStudioTextManagerInterop80PackageVersion)" />
142147
<PackageReferenceInclude="Microsoft.VSSDK.BuildTools"Version="$(MicrosoftVSSDKBuildToolsPackageVersion)"ExcludeAssets="all" />

‎vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs‎

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ open Microsoft.FSharp.Compiler
1717
openMicrosoft.FSharp.Compiler.Ast
1818
openMicrosoft.FSharp.Compiler.SourceCodeServices
1919

20+
openMicrosoft.VisualStudio.Core.Imaging
21+
openMicrosoft.VisualStudio.Imaging
2022

2123
[<RequireQualifiedAccess>]
2224
typeinternalLexerSymbolKind=
@@ -140,6 +142,101 @@ module internal Tokenizer =
140142
| FSharpGlyph.Variable-> Glyph.Local
141143
| FSharpGlyph.Error-> Glyph.Error
142144

145+
letGetImageIdForSymbol(symbol:FSharpSymbol,kind:LexerSymbolKind)=
146+
letimageId=
147+
match kindwith
148+
| LexerSymbolKind.Operator-> KnownImageIds.Operator
149+
|_->
150+
match symbolwith
151+
|:? FSharpUnionCaseas x->
152+
match Some x.Accessibilitywith
153+
| Public-> KnownImageIds.EnumerationPublic
154+
| Internal-> KnownImageIds.EnumerationInternal
155+
| Protected-> KnownImageIds.EnumerationProtected
156+
| Private-> KnownImageIds.EnumerationPrivate
157+
|:? FSharpActivePatternCase-> KnownImageIds.EnumerationPublic
158+
|:? FSharpFieldas x->
159+
if x.IsLiteralthen
160+
match Some x.Accessibilitywith
161+
| Public-> KnownImageIds.ConstantPublic
162+
| Internal-> KnownImageIds.ConstantInternal
163+
| Protected-> KnownImageIds.ConstantProtected
164+
| Private-> KnownImageIds.ConstantPrivate
165+
else
166+
match Some x.Accessibilitywith
167+
| Public-> KnownImageIds.FieldPublic
168+
| Internal-> KnownImageIds.FieldInternal
169+
| Protected-> KnownImageIds.FieldProtected
170+
| Private-> KnownImageIds.FieldPrivate
171+
|:? FSharpParameter-> KnownImageIds.Parameter
172+
|:? FSharpMemberOrFunctionOrValueas x->
173+
if x.LiteralValue.IsSomethen
174+
match Some x.Accessibilitywith
175+
| Public-> KnownImageIds.ConstantPublic
176+
| Internal-> KnownImageIds.ConstantInternal
177+
| Protected-> KnownImageIds.ConstantProtected
178+
| Private-> KnownImageIds.ConstantPrivate
179+
elif x.IsExtensionMemberthen KnownImageIds.ExtensionMethod
180+
elif x.IsProperty|| x.IsPropertyGetterMethod|| x.IsPropertySetterMethodthen
181+
match Some x.Accessibilitywith
182+
| Public-> KnownImageIds.PropertyPublic
183+
| Internal-> KnownImageIds.PropertyInternal
184+
| Protected-> KnownImageIds.PropertyProtected
185+
| Private-> KnownImageIds.PropertyPrivate
186+
elif x.IsEventthen
187+
match Some x.Accessibilitywith
188+
| Public-> KnownImageIds.EventPublic
189+
| Internal-> KnownImageIds.EventInternal
190+
| Protected-> KnownImageIds.EventProtected
191+
| Private-> KnownImageIds.EventPrivate
192+
else
193+
match Some x.Accessibilitywith
194+
| Public-> KnownImageIds.MethodPublic
195+
| Internal-> KnownImageIds.MethodInternal
196+
| Protected-> KnownImageIds.MethodProtected
197+
| Private-> KnownImageIds.MethodPrivate
198+
|:? FSharpEntityas x->
199+
if x.IsValueTypethen
200+
match Some x.Accessibilitywith
201+
| Public-> KnownImageIds.StructurePublic
202+
| Internal-> KnownImageIds.StructureInternal
203+
| Protected-> KnownImageIds.StructureProtected
204+
| Private-> KnownImageIds.StructurePrivate
205+
elif x.IsFSharpModulethen
206+
match Some x.Accessibilitywith
207+
| Public-> KnownImageIds.ModulePublic
208+
| Internal-> KnownImageIds.ModuleInternal
209+
| Protected-> KnownImageIds.ModuleProtected
210+
| Private-> KnownImageIds.ModulePrivate
211+
elif x.IsEnum|| x.IsFSharpUnionthen
212+
match Some x.Accessibilitywith
213+
| Public-> KnownImageIds.EnumerationPublic
214+
| Internal-> KnownImageIds.EnumerationInternal
215+
| Protected-> KnownImageIds.EnumerationProtected
216+
| Private-> KnownImageIds.EnumerationPrivate
217+
elif x.IsInterfacethen
218+
match Some x.Accessibilitywith
219+
| Public-> KnownImageIds.InterfacePublic
220+
| Internal-> KnownImageIds.InterfaceInternal
221+
| Protected-> KnownImageIds.InterfaceProtected
222+
| Private-> KnownImageIds.InterfacePrivate
223+
elif x.IsDelegatethen
224+
match Some x.Accessibilitywith
225+
| Public-> KnownImageIds.DelegatePublic
226+
| Internal-> KnownImageIds.DelegateInternal
227+
| Protected-> KnownImageIds.DelegateProtected
228+
| Private-> KnownImageIds.DelegatePrivate
229+
elif x.IsNamespacethen
230+
KnownImageIds.Namespace
231+
else
232+
match Some x.Accessibilitywith
233+
| Public-> KnownImageIds.ClassPublic
234+
| Internal-> KnownImageIds.ClassInternal
235+
| Protected-> KnownImageIds.ClassProtected
236+
| Private-> KnownImageIds.ClassPrivate
237+
|_-> KnownImageIds.None
238+
ImageId(KnownImageIds.ImageCatalogGuid, imageId)
239+
143240
letGetGlyphForSymbol(symbol:FSharpSymbol,kind:LexerSymbolKind)=
144241
match kindwith
145242
| LexerSymbolKind.Operator-> Glyph.Operator
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
2+
3+
namespaceMicrosoft.VisualStudio.FSharp.Editor
4+
5+
[<Sealed>]
6+
typeNavigableTextRun(classificationTypeName:string,text:string,navigateAction:unit->unit)=
7+
member__.ClassificationTypeName= classificationTypeName
8+
member__.Text= text
9+
member__.NavigateAction= navigateAction
Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
namespaceMicrosoft.VisualStudio.FSharp.Editor
1+
// Copyright (c)Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
22

3-
openSystem
3+
namespaceMicrosoft.VisualStudio.FSharp.Editor
44

5+
openSystem
56
openMicrosoft.CodeAnalysis
6-
77
openMicrosoft.FSharp.Compiler.Range
8-
openMicrosoft.FSharp.Compiler
98

109
typeinternalQuickInfoNavigation
1110
(
1211
gotoDefinitionService: FSharpGoToDefinitionService,
1312
initialDoc: Document,
1413
thisSymbolUseRange: range
1514
)=
15+
1616
letworkspace= initialDoc.Project.Solution.Workspace
1717
letsolution= workspace.CurrentSolution
1818

@@ -22,19 +22,19 @@ type internal QuickInfoNavigation
2222
solution.TryGetDocumentIdFromFSharpRange(range, initialDoc.Project.Id)|> Option.isSome
2323

2424
member__.RelativePath(range:range)=
25-
letrelativePathEscaped=
26-
match solution.FilePathwith
25+
letrelativePathEscaped=
26+
match solution.FilePathwith
2727
|null-> range.FileName
28-
| sfp->
28+
| sfp->
2929
lettargetUri= Uri(range.FileName)
3030
Uri(sfp).MakeRelativeUri(targetUri).ToString()
3131
relativePathEscaped|> Uri.UnescapeDataString
3232

33-
member__.NavigateTo(range:range)=
34-
asyncMaybe{
35-
lettargetPath= range.FileName
33+
member__.NavigateTo(range:range)=
34+
asyncMaybe{
35+
lettargetPath= range.FileName
3636
let!targetDoc= solution.TryGetDocumentFromFSharpRange(range, initialDoc.Project.Id)
37-
let!targetSource= targetDoc.GetTextAsync()
37+
let!targetSource= targetDoc.GetTextAsync()
3838
let!targetTextSpan= RoslynHelpers.TryFSharpRangeToTextSpan(targetSource, range)
3939
// to ensure proper navigation decsions we need to check the type of document the navigation call
4040
// is originating from and the target we're provided by default
@@ -43,14 +43,14 @@ type internal QuickInfoNavigation
4343
let(|Signature|Implementation|)filepath=
4444
if isSignatureFile filepaththen Signatureelse Implementation
4545

46-
match initialDoc.FilePath, targetPathwith
47-
| Signature, Signature
46+
match initialDoc.FilePath, targetPathwith
47+
| Signature, Signature
4848
| Implementation, Implementation->
4949
return gotoDefinitionService.TryNavigateToTextSpan(targetDoc, targetTextSpan)
5050
// adjust the target from signature to implementation
5151
| Implementation, Signature->
5252
return! gotoDefinitionService.NavigateToSymbolDefinitionAsync(targetDoc, targetSource, range)|> liftAsync
5353
// adjust the target from implmentation to signature
54-
| Signature, Implementation->
54+
| Signature, Implementation->
5555
return! gotoDefinitionService.NavigateToSymbolDeclarationAsync(targetDoc, targetSource, range)|> liftAsync
5656
}|> Async.Ignore|> Async.StartImmediate

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp