Skip to content
Permalink
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
tmat committed Nov 12, 2019
1 parent f828d26 commit a88aa571636d1347be750f88822edaa6a4f3f445
Showing with 390 additions and 500 deletions.
  1. +0 −35 Roslyn.sln
  2. +56 −5 src/EditorFeatures/CSharp/BlockCommentEditing/BlockCommentEditingCommandHandler.cs
  3. +18 −0 ...es/Core/ExternalAccess/VSTypeScript/Api/IVSTypeScriptBreakpointResolutionServiceImplementation.cs
  4. +22 −0 ...tures/Core/ExternalAccess/VSTypeScript/Api/IVSTypeScriptLanguageDebugInfoServiceImplementation.cs
  5. +28 −0 ...torFeatures/Core/ExternalAccess/VSTypeScript/Api/VSTypeScriptBreakpointResolutionResultWrapper.cs
  6. +21 −0 src/EditorFeatures/Core/ExternalAccess/VSTypeScript/Api/VSTypeScriptDebugDataTipInfoWrapper.cs
  7. +21 −0 src/EditorFeatures/Core/ExternalAccess/VSTypeScript/Api/VSTypeScriptDebugLocationInfoWrapper.cs
  8. +17 −0 ...EditorFeatures/Core/ExternalAccess/VSTypeScript/Api/VSTypeScriptSignatureHelpClassifierFactory.cs
  9. +39 −0 src/EditorFeatures/Core/ExternalAccess/VSTypeScript/VSTypeScriptBreakpointResolutionService.cs
  10. +34 −0 src/EditorFeatures/Core/ExternalAccess/VSTypeScript/VSTypeScriptLanguageDebugInfoService.cs
  11. +0 −29 ...itorFeatures/Core/Implementation/BlockCommentEditing/AbstractBlockCommentEditingCommandHandler.cs
  12. +0 −63 ...Features/Core/Implementation/BlockCommentEditing/BaseAbstractBlockCommentEditingCommandHandler.cs
  13. +13 −15 src/EditorFeatures/Core/Implementation/Debugging/BreakpointResolutionResult.cs
  14. +6 −6 src/EditorFeatures/Core/Implementation/Debugging/DebugDataTipInfo.cs
  15. +8 −8 src/EditorFeatures/Core/Implementation/Debugging/DebugLocationInfo.cs
  16. +3 −3 src/EditorFeatures/Core/Implementation/Debugging/IBreakpointResolutionService.cs
  17. +2 −0 src/EditorFeatures/Core/Implementation/Debugging/ILanguageDebugInfoService.cs
  18. +1 −1 src/EditorFeatures/Core/Microsoft.CodeAnalysis.EditorFeatures.csproj
  19. +14 −0 src/Features/Core/Portable/InternalLanguageNames.cs
  20. +0 −10 src/NuGet/VisualStudio/VS.ExternalAPIs.Roslyn.Package.csproj
  21. +0 −37 src/Tools/ExternalAccess/CodeLens/Microsoft.CodeAnalysis.ExternalAccess.CodeLens.csproj
  22. 0 src/Tools/ExternalAccess/CodeLens/PublicAPI.Shipped.txt
  23. +0 −1 src/Tools/ExternalAccess/CodeLens/PublicAPI.Unshipped.txt
  24. +29 −0 src/Tools/ExternalAccess/FSharp/Editor/Implementation/Debugging/FSharpBreakpointResolutionResult.cs
  25. +21 −0 src/Tools/ExternalAccess/FSharp/Editor/Implementation/Debugging/FSharpDebugDataTipInfo.cs
  26. +21 −0 src/Tools/ExternalAccess/FSharp/Editor/Implementation/Debugging/FSharpDebugLocationInfo.cs
  27. +3 −27 ...Tools/ExternalAccess/FSharp/Editor/Implementation/Debugging/IFSharpBreakpointResolutionService.cs
  28. +2 −37 src/Tools/ExternalAccess/FSharp/Editor/Implementation/Debugging/IFSharpLanguageDebugInfoService.cs
  29. +7 −23 ...ternalAccess/FSharp/Internal/Editor/Implementation/Debugging/FSharpBreakpointResolutionService.cs
  30. +4 −17 .../ExternalAccess/FSharp/Internal/Editor/Implementation/Debugging/FSharpLanguageDebugInfoService.cs
  31. +0 −34 src/Tools/ExternalAccess/IntelliTrace/Microsoft.CodeAnalysis.ExternalAccess.IntelliTrace.csproj
  32. 0 src/Tools/ExternalAccess/IntelliTrace/PublicAPI.Shipped.txt
  33. +0 −1 src/Tools/ExternalAccess/IntelliTrace/PublicAPI.Unshipped.txt
  34. +0 −39 src/Tools/ExternalAccess/ProjectSystem/Microsoft.CodeAnalysis.ExternalAccess.ProjectSystem.csproj
  35. 0 src/Tools/ExternalAccess/ProjectSystem/PublicAPI.Shipped.txt
  36. +0 −1 src/Tools/ExternalAccess/ProjectSystem/PublicAPI.Unshipped.txt
  37. +0 −36 src/Tools/ExternalAccess/TypeScript/Microsoft.CodeAnalysis.ExternalAccess.TypeScript.csproj
  38. 0 src/Tools/ExternalAccess/TypeScript/PublicAPI.Shipped.txt
  39. +0 −1 src/Tools/ExternalAccess/TypeScript/PublicAPI.Unshipped.txt
  40. +0 −35 src/Tools/ExternalAccess/UnitTesting/Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.csproj
  41. 0 src/Tools/ExternalAccess/UnitTesting/PublicAPI.Shipped.txt
  42. +0 −1 src/Tools/ExternalAccess/UnitTesting/PublicAPI.Unshipped.txt
  43. +0 −5 src/VisualStudio/Setup/AssemblyRedirects.cs
  44. +0 −25 src/VisualStudio/Setup/Roslyn.VisualStudio.Setup.csproj
  45. +0 −5 src/VisualStudio/Setup/source.extension.vsixmanifest
@@ -390,8 +390,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Exte
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.ExternalAccess.Razor", "src\Tools\ExternalAccess\Razor\Microsoft.CodeAnalysis.ExternalAccess.Razor.csproj", "{2FB6C157-DF91-4B1C-9827-A4D1C08C73EC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.ExternalAccess.TypeScript", "src\Tools\ExternalAccess\TypeScript\Microsoft.CodeAnalysis.ExternalAccess.TypeScript.csproj", "{1638FB04-0298-4341-B5E0-8A13B4823C81}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.VisualStudio.LanguageServices.CodeLens", "src\VisualStudio\CodeLens\Microsoft.VisualStudio.LanguageServices.CodeLens.csproj", "{5E6E9184-DEC5-4EC5-B0A4-77CFDC8CDEBE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Net.Compilers.Toolset.Package", "src\NuGet\Microsoft.Net.Compilers.Toolset\Microsoft.Net.Compilers.Toolset.Package.csproj", "{A74C7D2E-92FA-490A-B80A-28BEF56B56FC}"
@@ -402,8 +400,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Lang
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.ExternalAccess.Debugger", "src\Tools\ExternalAccess\Debugger\Microsoft.CodeAnalysis.ExternalAccess.Debugger.csproj", "{655A5B07-39B8-48CD-8590-8AC0C2B708D8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.ExternalAccess.UnitTesting", "src\Tools\ExternalAccess\UnitTesting\Microsoft.CodeAnalysis.ExternalAccess.UnitTesting.csproj", "{FA51A3CB-5174-4D99-B76E-DC31C5361DF3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.ExternalAccess.Xamarin.Remote", "src\Tools\ExternalAccess\Xamarin.Remote\Microsoft.CodeAnalysis.ExternalAccess.Xamarin.Remote.csproj", "{DE53934B-7FC1-48A0-85AB-C519FBBD02CF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Roslyn.VisualStudio.Setup.ServiceHub", "src\Setup\DevDivVsix\ServiceHubConfig\Roslyn.VisualStudio.Setup.ServiceHub.csproj", "{3D33BBFD-EC63-4E8C-A714-0A48A3809A87}"
@@ -412,12 +408,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Exte
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.ExternalAccess.Apex", "src\Tools\ExternalAccess\Apex\Microsoft.CodeAnalysis.ExternalAccess.Apex.csproj", "{FC32EF16-31B1-47B3-B625-A80933CB3F29}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.ExternalAccess.CodeLens", "src\Tools\ExternalAccess\CodeLens\Microsoft.CodeAnalysis.ExternalAccess.CodeLens.csproj", "{D5B1328C-A9EF-4E55-93D7-B8455855709A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.ExternalAccess.IntelliTrace", "src\Tools\ExternalAccess\IntelliTrace\Microsoft.CodeAnalysis.ExternalAccess.IntelliTrace.csproj", "{BDB3414C-35F8-4E2D-8603-DE9CF259540F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.ExternalAccess.ProjectSystem", "src\Tools\ExternalAccess\ProjectSystem\Microsoft.CodeAnalysis.ExternalAccess.ProjectSystem.csproj", "{620EA38F-F039-41B9-9003-5EBF5EC19D85}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.VisualStudio.LanguageServices.LiveShare", "src\VisualStudio\LiveShare\Impl\Microsoft.VisualStudio.LanguageServices.LiveShare.csproj", "{453C8E28-81D4-431E-BFB0-F3D413346E51}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.VisualStudio.LanguageServices.LiveShare.UnitTests", "src\VisualStudio\LiveShare\Test\Microsoft.VisualStudio.LanguageServices.LiveShare.UnitTests.csproj", "{CE7F7553-DB2D-4839-92E3-F042E4261B4E}"
@@ -1069,10 +1059,6 @@ Global
{2FB6C157-DF91-4B1C-9827-A4D1C08C73EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2FB6C157-DF91-4B1C-9827-A4D1C08C73EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2FB6C157-DF91-4B1C-9827-A4D1C08C73EC}.Release|Any CPU.Build.0 = Release|Any CPU
{1638FB04-0298-4341-B5E0-8A13B4823C81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1638FB04-0298-4341-B5E0-8A13B4823C81}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1638FB04-0298-4341-B5E0-8A13B4823C81}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1638FB04-0298-4341-B5E0-8A13B4823C81}.Release|Any CPU.Build.0 = Release|Any CPU
{5E6E9184-DEC5-4EC5-B0A4-77CFDC8CDEBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5E6E9184-DEC5-4EC5-B0A4-77CFDC8CDEBE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5E6E9184-DEC5-4EC5-B0A4-77CFDC8CDEBE}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -1093,10 +1079,6 @@ Global
{655A5B07-39B8-48CD-8590-8AC0C2B708D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{655A5B07-39B8-48CD-8590-8AC0C2B708D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{655A5B07-39B8-48CD-8590-8AC0C2B708D8}.Release|Any CPU.Build.0 = Release|Any CPU
{FA51A3CB-5174-4D99-B76E-DC31C5361DF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FA51A3CB-5174-4D99-B76E-DC31C5361DF3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FA51A3CB-5174-4D99-B76E-DC31C5361DF3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FA51A3CB-5174-4D99-B76E-DC31C5361DF3}.Release|Any CPU.Build.0 = Release|Any CPU
{DE53934B-7FC1-48A0-85AB-C519FBBD02CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DE53934B-7FC1-48A0-85AB-C519FBBD02CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DE53934B-7FC1-48A0-85AB-C519FBBD02CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -1113,18 +1095,6 @@ Global
{FC32EF16-31B1-47B3-B625-A80933CB3F29}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FC32EF16-31B1-47B3-B625-A80933CB3F29}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FC32EF16-31B1-47B3-B625-A80933CB3F29}.Release|Any CPU.Build.0 = Release|Any CPU
{D5B1328C-A9EF-4E55-93D7-B8455855709A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D5B1328C-A9EF-4E55-93D7-B8455855709A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D5B1328C-A9EF-4E55-93D7-B8455855709A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D5B1328C-A9EF-4E55-93D7-B8455855709A}.Release|Any CPU.Build.0 = Release|Any CPU
{BDB3414C-35F8-4E2D-8603-DE9CF259540F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BDB3414C-35F8-4E2D-8603-DE9CF259540F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BDB3414C-35F8-4E2D-8603-DE9CF259540F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BDB3414C-35F8-4E2D-8603-DE9CF259540F}.Release|Any CPU.Build.0 = Release|Any CPU
{620EA38F-F039-41B9-9003-5EBF5EC19D85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{620EA38F-F039-41B9-9003-5EBF5EC19D85}.Debug|Any CPU.Build.0 = Debug|Any CPU
{620EA38F-F039-41B9-9003-5EBF5EC19D85}.Release|Any CPU.ActiveCfg = Release|Any CPU
{620EA38F-F039-41B9-9003-5EBF5EC19D85}.Release|Any CPU.Build.0 = Release|Any CPU
{453C8E28-81D4-431E-BFB0-F3D413346E51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{453C8E28-81D4-431E-BFB0-F3D413346E51}.Debug|Any CPU.Build.0 = Debug|Any CPU
{453C8E28-81D4-431E-BFB0-F3D413346E51}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -1323,20 +1293,15 @@ Global
{8977A560-45C2-4EC2-A849-97335B382C74} = {FD0FAF5F-1DED-485C-99FA-84B97F3A8EEC}
{BD8CE303-5F04-45EC-8DCF-73C9164CD614} = {8977A560-45C2-4EC2-A849-97335B382C74}
{2FB6C157-DF91-4B1C-9827-A4D1C08C73EC} = {8977A560-45C2-4EC2-A849-97335B382C74}
{1638FB04-0298-4341-B5E0-8A13B4823C81} = {8977A560-45C2-4EC2-A849-97335B382C74}
{5E6E9184-DEC5-4EC5-B0A4-77CFDC8CDEBE} = {8DBA5174-B0AA-4561-82B1-A46607697753}
{A74C7D2E-92FA-490A-B80A-28BEF56B56FC} = {C52D8057-43AF-40E6-A01B-6CDBB7301985}
{686BF57E-A6FF-467B-AAB3-44DE916A9772} = {3E5FE3DB-45F7-4D83-9097-8F05D3B3AEC6}
{1DDE89EE-5819-441F-A060-2FF4A986F372} = {3E5FE3DB-45F7-4D83-9097-8F05D3B3AEC6}
{655A5B07-39B8-48CD-8590-8AC0C2B708D8} = {8977A560-45C2-4EC2-A849-97335B382C74}
{FA51A3CB-5174-4D99-B76E-DC31C5361DF3} = {8977A560-45C2-4EC2-A849-97335B382C74}
{DE53934B-7FC1-48A0-85AB-C519FBBD02CF} = {8977A560-45C2-4EC2-A849-97335B382C74}
{3D33BBFD-EC63-4E8C-A714-0A48A3809A87} = {BE25E872-1667-4649-9D19-96B83E75A44E}
{BFFB5CAE-33B5-447E-9218-BDEBFDA96CB5} = {8977A560-45C2-4EC2-A849-97335B382C74}
{FC32EF16-31B1-47B3-B625-A80933CB3F29} = {8977A560-45C2-4EC2-A849-97335B382C74}
{D5B1328C-A9EF-4E55-93D7-B8455855709A} = {8977A560-45C2-4EC2-A849-97335B382C74}
{BDB3414C-35F8-4E2D-8603-DE9CF259540F} = {8977A560-45C2-4EC2-A849-97335B382C74}
{620EA38F-F039-41B9-9003-5EBF5EC19D85} = {8977A560-45C2-4EC2-A849-97335B382C74}
{453C8E28-81D4-431E-BFB0-F3D413346E51} = {8DBA5174-B0AA-4561-82B1-A46607697753}
{CE7F7553-DB2D-4839-92E3-F042E4261B4E} = {8DBA5174-B0AA-4561-82B1-A46607697753}
{FF38E9C9-7A25-44F0-B2C4-24C9BFD6A8F6} = {FD0FAF5F-1DED-485C-99FA-84B97F3A8EEC}
@@ -1,35 +1,86 @@
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.ComponentModel.Composition;
using System.Diagnostics;
using System.Threading;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Editor.Implementation.BlockCommentEditing;
using Microsoft.CodeAnalysis.Editor.Shared.Extensions;
using Microsoft.CodeAnalysis.Editor.Shared.Options;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.CodeAnalysis.Text;
using Microsoft.CodeAnalysis.Text.Shared.Extensions;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using Microsoft.VisualStudio.Text.Operations;
using Microsoft.VisualStudio.Utilities;
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.Editor.CSharp.BlockCommentEditing
{
[Export(typeof(ICommandHandler))]
[ContentType(ContentTypeNames.CSharpContentType)]
[Name(nameof(BlockCommentEditingCommandHandler))]
[Order(After = PredefinedCompletionNames.CompletionCommandHandler)]
internal class BlockCommentEditingCommandHandler : AbstractBlockCommentEditingCommandHandler
internal sealed class BlockCommentEditingCommandHandler : ICommandHandler<ReturnKeyCommandArgs>
{
private readonly ITextUndoHistoryRegistry _undoHistoryRegistry;
private readonly IEditorOperationsFactoryService _editorOperationsFactoryService;

[ImportingConstructor]
public BlockCommentEditingCommandHandler(
ITextUndoHistoryRegistry undoHistoryRegistry,
IEditorOperationsFactoryService editorOperationsFactoryService) : base(undoHistoryRegistry, editorOperationsFactoryService)
IEditorOperationsFactoryService editorOperationsFactoryService)
{
Contract.ThrowIfNull(undoHistoryRegistry);
Contract.ThrowIfNull(editorOperationsFactoryService);

_undoHistoryRegistry = undoHistoryRegistry;
_editorOperationsFactoryService = editorOperationsFactoryService;
}

public string DisplayName => EditorFeaturesResources.Block_Comment_Editing;

public CommandState GetCommandState(ReturnKeyCommandArgs args)
=> CommandState.Unspecified;

public bool ExecuteCommand(ReturnKeyCommandArgs args, CommandExecutionContext context)
=> TryHandleReturnKey(args.SubjectBuffer, args.TextView);

private bool TryHandleReturnKey(ITextBuffer subjectBuffer, ITextView textView)
{
if (!subjectBuffer.GetFeatureOnOffOption(FeatureOnOffOptions.AutoInsertBlockCommentStartString))
{
return false;
}

var caretPosition = textView.GetCaretPoint(subjectBuffer);
if (caretPosition == null)
{
return false;
}

var exteriorText = GetExteriorTextForNextLine(caretPosition.Value);
if (exteriorText == null)
{
return false;
}

using var transaction = _undoHistoryRegistry.GetHistory(textView.TextBuffer).CreateTransaction(EditorFeaturesResources.Insert_new_line);

var editorOperations = _editorOperationsFactoryService.GetEditorOperations(textView);

editorOperations.InsertNewLine();
editorOperations.InsertText(exteriorText);

transaction.Complete();
return true;
}

protected override string GetExteriorTextForNextLine(SnapshotPoint caretPosition)
private string GetExteriorTextForNextLine(SnapshotPoint caretPosition)
{
var currentLine = caretPosition.GetContainingLine();

@@ -130,7 +181,7 @@ private static string GetPaddingOrIndentation(ITextSnapshotLine currentLine, int
Debug.Assert(firstNonWhitespaceOffset > -1);

var lineText = currentLine.GetText();
if ((lineText.Length == firstNonWhitespaceOffset + exteriorText.Length))
if (lineText.Length == firstNonWhitespaceOffset + exteriorText.Length)
{
// *|
return " ";
@@ -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);
}
}

0 comments on commit a88aa57

Please sign in to comment.
You can’t perform that action at this time.