Permalink
Please
sign in to comment.
Browse files
Add external access shims for TypeScript editor features layer. (#39456)
* Remove unused ExternalAccess projects * Add external access shims for TypeScript editor features layer. * Feedback * Use wrapper pattern * Add nullable checks, clean up * Use -Implementation and -Wrapper suffixes
- Loading branch information
Showing
with
390 additions
and 500 deletions.
- +0 −35 Roslyn.sln
- +56 −5 src/EditorFeatures/CSharp/BlockCommentEditing/BlockCommentEditingCommandHandler.cs
- +18 −0 ...es/Core/ExternalAccess/VSTypeScript/Api/IVSTypeScriptBreakpointResolutionServiceImplementation.cs
- +22 −0 ...tures/Core/ExternalAccess/VSTypeScript/Api/IVSTypeScriptLanguageDebugInfoServiceImplementation.cs
- +28 −0 ...torFeatures/Core/ExternalAccess/VSTypeScript/Api/VSTypeScriptBreakpointResolutionResultWrapper.cs
- +21 −0 src/EditorFeatures/Core/ExternalAccess/VSTypeScript/Api/VSTypeScriptDebugDataTipInfoWrapper.cs
- +21 −0 src/EditorFeatures/Core/ExternalAccess/VSTypeScript/Api/VSTypeScriptDebugLocationInfoWrapper.cs
- +17 −0 ...EditorFeatures/Core/ExternalAccess/VSTypeScript/Api/VSTypeScriptSignatureHelpClassifierFactory.cs
- +39 −0 src/EditorFeatures/Core/ExternalAccess/VSTypeScript/VSTypeScriptBreakpointResolutionService.cs
- +34 −0 src/EditorFeatures/Core/ExternalAccess/VSTypeScript/VSTypeScriptLanguageDebugInfoService.cs
- +0 −29 ...itorFeatures/Core/Implementation/BlockCommentEditing/AbstractBlockCommentEditingCommandHandler.cs
- +0 −63 ...Features/Core/Implementation/BlockCommentEditing/BaseAbstractBlockCommentEditingCommandHandler.cs
- +13 −15 src/EditorFeatures/Core/Implementation/Debugging/BreakpointResolutionResult.cs
- +6 −6 src/EditorFeatures/Core/Implementation/Debugging/DebugDataTipInfo.cs
- +8 −8 src/EditorFeatures/Core/Implementation/Debugging/DebugLocationInfo.cs
- +3 −3 src/EditorFeatures/Core/Implementation/Debugging/IBreakpointResolutionService.cs
- +2 −0 src/EditorFeatures/Core/Implementation/Debugging/ILanguageDebugInfoService.cs
- +1 −1 src/EditorFeatures/Core/Microsoft.CodeAnalysis.EditorFeatures.csproj
- +14 −0 src/Features/Core/Portable/InternalLanguageNames.cs
- +0 −10 src/NuGet/VisualStudio/VS.ExternalAPIs.Roslyn.Package.csproj
- +0 −37 src/Tools/ExternalAccess/CodeLens/Microsoft.CodeAnalysis.ExternalAccess.CodeLens.csproj
- 0 src/Tools/ExternalAccess/CodeLens/PublicAPI.Shipped.txt
- +0 −1 src/Tools/ExternalAccess/CodeLens/PublicAPI.Unshipped.txt
- +29 −0 src/Tools/ExternalAccess/FSharp/Editor/Implementation/Debugging/FSharpBreakpointResolutionResult.cs
- +21 −0 src/Tools/ExternalAccess/FSharp/Editor/Implementation/Debugging/FSharpDebugDataTipInfo.cs
- +21 −0 src/Tools/ExternalAccess/FSharp/Editor/Implementation/Debugging/FSharpDebugLocationInfo.cs
- +3 −27 ...Tools/ExternalAccess/FSharp/Editor/Implementation/Debugging/IFSharpBreakpointResolutionService.cs
- +2 −37 src/Tools/ExternalAccess/FSharp/Editor/Implementation/Debugging/IFSharpLanguageDebugInfoService.cs
- +7 −23 ...ternalAccess/FSharp/Internal/Editor/Implementation/Debugging/FSharpBreakpointResolutionService.cs
- +4 −17 .../ExternalAccess/FSharp/Internal/Editor/Implementation/Debugging/FSharpLanguageDebugInfoService.cs
- +0 −34 src/Tools/ExternalAccess/IntelliTrace/Microsoft.CodeAnalysis.ExternalAccess.IntelliTrace.csproj
- 0 src/Tools/ExternalAccess/IntelliTrace/PublicAPI.Shipped.txt
- +0 −1 src/Tools/ExternalAccess/IntelliTrace/PublicAPI.Unshipped.txt
- +0 −39 src/Tools/ExternalAccess/ProjectSystem/Microsoft.CodeAnalysis.ExternalAccess.ProjectSystem.csproj
- 0 src/Tools/ExternalAccess/ProjectSystem/PublicAPI.Shipped.txt
- +0 −1 src/Tools/ExternalAccess/ProjectSystem/PublicAPI.Unshipped.txt
- +0 −36 src/Tools/ExternalAccess/TypeScript/Microsoft.CodeAnalysis.ExternalAccess.TypeScript.csproj
- 0 src/Tools/ExternalAccess/TypeScript/PublicAPI.Shipped.txt
- +0 −1 src/Tools/ExternalAccess/TypeScript/PublicAPI.Unshipped.txt
- +0 −35 src/Tools/ExternalAccess/UnitTesting/Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.csproj
- 0 src/Tools/ExternalAccess/UnitTesting/PublicAPI.Shipped.txt
- +0 −1 src/Tools/ExternalAccess/UnitTesting/PublicAPI.Unshipped.txt
- +0 −5 src/VisualStudio/Setup/AssemblyRedirects.cs
- +0 −25 src/VisualStudio/Setup/Roslyn.VisualStudio.Setup.csproj
- +0 −5 src/VisualStudio/Setup/source.extension.vsixmanifest
@@ -0,0 +1,18 @@ | ||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
#nullable enable | ||
|
||
using System.Collections.Generic; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Microsoft.CodeAnalysis.Text; | ||
|
||
namespace Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript.Api | ||
{ | ||
internal interface IVSTypeScriptBreakpointResolutionServiceImplementation | ||
{ | ||
Task<VSTypeScriptBreakpointResolutionResultWrapper> ResolveBreakpointAsync(Document document, TextSpan textSpan, CancellationToken cancellationToken = default); | ||
|
||
Task<IEnumerable<VSTypeScriptBreakpointResolutionResultWrapper>> ResolveBreakpointsAsync(Solution solution, string name, CancellationToken cancellationToken = default); | ||
} | ||
} |
@@ -0,0 +1,22 @@ | ||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
#nullable enable | ||
|
||
using System.Threading; | ||
using System.Threading.Tasks; | ||
|
||
namespace Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript.Api | ||
{ | ||
internal interface IVSTypeScriptLanguageDebugInfoServiceImplementation | ||
{ | ||
Task<VSTypeScriptDebugLocationInfoWrapper> GetLocationInfoAsync(Document document, int position, CancellationToken cancellationToken); | ||
|
||
/// <summary> | ||
/// Find an appropriate span to pass the debugger given a point in a snapshot. Optionally | ||
/// pass back a string to pass to the debugger instead if no good span can be found. For | ||
/// example, if the user hovers on "var" then we actually want to pass the fully qualified | ||
/// name of the type that 'var' binds to, to the debugger. | ||
/// </summary> | ||
Task<VSTypeScriptDebugDataTipInfoWrapper> GetDataTipInfoAsync(Document document, int position, CancellationToken cancellationToken); | ||
} | ||
} |
@@ -0,0 +1,28 @@ | ||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
#nullable enable | ||
|
||
using Microsoft.CodeAnalysis.Editor.Implementation.Debugging; | ||
using Microsoft.CodeAnalysis.Text; | ||
|
||
namespace Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript.Api | ||
{ | ||
internal readonly struct VSTypeScriptBreakpointResolutionResultWrapper | ||
{ | ||
internal readonly BreakpointResolutionResult UnderlyingObject; | ||
|
||
private VSTypeScriptBreakpointResolutionResultWrapper(BreakpointResolutionResult result) | ||
=> UnderlyingObject = result; | ||
|
||
public Document Document => UnderlyingObject.Document; | ||
public TextSpan TextSpan => UnderlyingObject.TextSpan; | ||
public string? LocationNameOpt => UnderlyingObject.LocationNameOpt; | ||
public bool IsLineBreakpoint => UnderlyingObject.IsLineBreakpoint; | ||
|
||
public static VSTypeScriptBreakpointResolutionResultWrapper CreateSpanResult(Document document, TextSpan textSpan, string? locationNameOpt = null) | ||
=> new VSTypeScriptBreakpointResolutionResultWrapper(BreakpointResolutionResult.CreateSpanResult(document, textSpan, locationNameOpt)); | ||
|
||
public static VSTypeScriptBreakpointResolutionResultWrapper CreateLineResult(Document document, string? locationNameOpt = null) | ||
=> new VSTypeScriptBreakpointResolutionResultWrapper(BreakpointResolutionResult.CreateLineResult(document, locationNameOpt)); | ||
} | ||
} |
@@ -0,0 +1,21 @@ | ||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
#nullable enable | ||
|
||
using Microsoft.CodeAnalysis.Editor.Implementation.Debugging; | ||
using Microsoft.CodeAnalysis.Text; | ||
|
||
namespace Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript.Api | ||
{ | ||
internal readonly struct VSTypeScriptDebugDataTipInfoWrapper | ||
{ | ||
internal readonly DebugDataTipInfo UnderlyingObject; | ||
|
||
public VSTypeScriptDebugDataTipInfoWrapper(TextSpan span, string text) | ||
=> UnderlyingObject = new DebugDataTipInfo(span, text); | ||
|
||
public readonly TextSpan Span => UnderlyingObject.Span; | ||
public readonly string Text => UnderlyingObject.Text; | ||
public bool IsDefault => UnderlyingObject.IsDefault; | ||
} | ||
} |
@@ -0,0 +1,21 @@ | ||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
#nullable enable | ||
|
||
using System.Diagnostics; | ||
using Microsoft.CodeAnalysis.Editor.Implementation.Debugging; | ||
|
||
namespace Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript.Api | ||
{ | ||
internal readonly struct VSTypeScriptDebugLocationInfoWrapper | ||
{ | ||
internal readonly DebugLocationInfo UnderlyingObject; | ||
|
||
public VSTypeScriptDebugLocationInfoWrapper(string name, int lineOffset) | ||
=> UnderlyingObject = new DebugLocationInfo(name, lineOffset); | ||
|
||
public readonly string Name => UnderlyingObject.Name; | ||
public readonly int LineOffset => UnderlyingObject.LineOffset; | ||
internal bool IsDefault => UnderlyingObject.IsDefault; | ||
} | ||
} |
@@ -0,0 +1,17 @@ | ||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
#nullable enable | ||
|
||
using Microsoft.VisualStudio.Text.Classification; | ||
using Microsoft.CodeAnalysis.Editor.Shared.Utilities; | ||
using Microsoft.VisualStudio.Text; | ||
using Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Presentation; | ||
|
||
namespace Microsoft.CodeAnalysis.ExternalAccess.VSTypeScript.Api | ||
{ | ||
internal static class VSTypeScriptSignatureHelpClassifierFactory | ||
{ | ||
public static IClassifier Create(ITextBuffer textBuffer, ClassificationTypeMap typeMap) | ||
=> new SignatureHelpClassifier(textBuffer, typeMap); | ||
} | ||
} |

Oops, something went wrong.
0 comments on commit
a88aa57