├── public.snk
├── .gitmodules
├── NuGet.Config
├── Microsoft.VisualStudio.MiniEditor
├── MiniEditorSetup.cs
├── CustomDef
│ ├── IAsyncCompletionSessionOperations2.cs
│ ├── IDynamicCommandHandler.cs
│ └── EditorOptionsExtensions.cs
├── BaseViewImpl
│ ├── ITextViewFactoryService.cs
│ ├── MockExperimentationService.cs
│ ├── MockBraceCompletionAdornmentService.cs
│ ├── MockTooltipService.cs
│ ├── TestViewScroller.cs
│ ├── TextViewFactoryService.cs
│ ├── TestSmartIndentationService.cs
│ ├── TestCommandHandlers.cs
│ ├── MockTextStructureNavigator.cs
│ ├── TestTextSelection.cs
│ ├── TestTextViewLineCollection.cs
│ ├── TextViewRoleSet.cs
│ ├── TestTextCaret.cs
│ ├── TestTextViewLine.cs
│ ├── TestTextView.cs
│ └── ViewOptionsCompat.cs
├── IFileSystemAbstraction.cs
├── CustomImpl
│ ├── System.Windows.Clipboard.cs
│ ├── DiagnosticLogger.cs
│ ├── CompletionUtilities.cs
│ └── EditorCommandHandlerService.cs
├── CustomErrorHandler.cs
├── CustomTextModel
│ ├── TextDocumentFactoryService.cs
│ └── TextDocument.cs
├── EditorEnvironment.cs
└── Microsoft.VisualStudio.MiniEditor.csproj
├── version.json
├── Microsoft.VisualStudio.MiniEditor.sln
├── LICENSE
├── azure-pipelines.yml
├── .gitignore
└── README.md
/public.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/garuma/MiniEditor/HEAD/public.snk
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "Microsoft.VisualStudio.MiniEditor/vs-editor-api"]
2 | path = Microsoft.VisualStudio.MiniEditor/vs-editor-api
3 | url = https://github.com/microsoft/vs-editor-api.git
4 |
--------------------------------------------------------------------------------
/NuGet.Config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Microsoft.VisualStudio.MiniEditor/MiniEditorSetup.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Microsoft.VisualStudio.MiniEditor
4 | {
5 | public static class MiniEditorSetup
6 | {
7 | public static IFileSystemAbstraction FileSystem { get; set; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/Microsoft.VisualStudio.MiniEditor/CustomDef/IAsyncCompletionSessionOperations2.cs:
--------------------------------------------------------------------------------
1 | namespace Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion
2 | {
3 | public interface IAsyncCompletionSessionOperations2 : IAsyncCompletionSessionOperations
4 | {
5 | bool CanToggleFilter (string accessKey);
6 | void ToggleFilter (string accessKey);
7 | }
8 | }
--------------------------------------------------------------------------------
/Microsoft.VisualStudio.MiniEditor/BaseViewImpl/ITextViewFactoryService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Microsoft.VisualStudio.Text.Editor
8 | {
9 | public interface ITextViewFactoryService
10 | {
11 | ITextView CreateTextView (ITextBuffer buffer);
12 |
13 | ITextView CreateTextView ();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Microsoft.VisualStudio.MiniEditor/BaseViewImpl/MockExperimentationService.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 | using Microsoft.VisualStudio.Text.Utilities;
3 |
4 | namespace Microsoft.VisualStudio.MiniEditor
5 | {
6 | [Export (typeof (IExperimentationServiceInternal))]
7 | class MockExperimentationService : IExperimentationServiceInternal
8 | {
9 | public bool IsCachedFlightEnabled (string flightName) => true;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/Microsoft.VisualStudio.MiniEditor/IFileSystemAbstraction.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Text;
4 | using Microsoft.VisualStudio.Text;
5 |
6 | namespace Microsoft.VisualStudio.MiniEditor
7 | {
8 | public interface IFileSystemAbstraction
9 | {
10 | Stream OpenFile (string filePath, out DateTime lastModifiedTimeUtc, out long fileSize);
11 | void PerformSave (ITextSnapshot textSnapshot, FileMode fileMode, string filePath, Encoding encoding, bool createFolder);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Microsoft.VisualStudio.MiniEditor/CustomImpl/System.Windows.Clipboard.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 |
4 | namespace System.Windows
5 | {
6 | static class Clipboard
7 | {
8 | static IDataObject dataObject;
9 |
10 | public static IDataObject GetDataObject () => dataObject;
11 |
12 | public static void SetDataObject (IDataObject data, bool copy)
13 | => dataObject = data;
14 |
15 | public static bool ContainsText () =>
16 | dataObject.GetFormats ()?.Any (f => f == DataFormats.UnicodeText) ?? false;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/version.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3 | "version": "1.0",
4 | "assemblyVersion": "1.0",
5 | "buildNumberOffset": 0,
6 | "publicReleaseRefSpec": [
7 | "^refs/heads/master$",
8 | "^refs/heads/v\\d+(?:.\\d+)?$"
9 | ],
10 | "cloudBuild": {
11 | "setVersionVariables": true,
12 | "buildNumber": {
13 | "enabled": true,
14 | "includeCommitId": {
15 | "when": "always",
16 | "where": "buildMetadata"
17 | }
18 | }
19 | }
20 | }
21 |
22 |
--------------------------------------------------------------------------------
/Microsoft.VisualStudio.MiniEditor/CustomDef/IDynamicCommandHandler.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.VisualStudio.Utilities;
2 |
3 | namespace Microsoft.VisualStudio.Commanding
4 | {
5 | ///
6 | /// A command handler that can opt out of .
7 | ///
8 | internal interface IDynamicCommandHandler where T : CommandArgs
9 | {
10 | ///
11 | /// Determines whether should be called.
12 | ///
13 | bool CanExecuteCommand(T args);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Microsoft.VisualStudio.MiniEditor/BaseViewImpl/MockBraceCompletionAdornmentService.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.Composition;
2 |
3 | using Microsoft.VisualStudio.Text.Editor;
4 |
5 | namespace Microsoft.VisualStudio.Text.BraceCompletion.Implementation
6 | {
7 | class MockBraceCompletionAdornmentService : IBraceCompletionAdornmentService
8 | {
9 | public ITrackingPoint Point {
10 | get => throw new System.NotImplementedException ();
11 | set { }
12 | }
13 | }
14 |
15 | [Export(typeof (IBraceCompletionAdornmentServiceFactory))]
16 | class MockBraceCompletionAdornmentServiceFactory : IBraceCompletionAdornmentServiceFactory
17 | {
18 | IBraceCompletionAdornmentService service = new MockBraceCompletionAdornmentService ();
19 |
20 | public IBraceCompletionAdornmentService GetOrCreateService (ITextView textView) => service;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Microsoft.VisualStudio.MiniEditor.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.VisualStudio.MiniEditor", "Microsoft.VisualStudio.MiniEditor\Microsoft.VisualStudio.MiniEditor.csproj", "{DD2087D3-ED47-49E8-AF08-CD3B3867C84D}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {DD2087D3-ED47-49E8-AF08-CD3B3867C84D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {DD2087D3-ED47-49E8-AF08-CD3B3867C84D}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {DD2087D3-ED47-49E8-AF08-CD3B3867C84D}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {DD2087D3-ED47-49E8-AF08-CD3B3867C84D}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | EndGlobal
18 |
--------------------------------------------------------------------------------
/Microsoft.VisualStudio.MiniEditor/BaseViewImpl/MockTooltipService.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel.Composition;
4 | using Microsoft.VisualStudio.Text.Adornments;
5 |
6 | namespace Microsoft.VisualStudio.Text.Editor.Implementation
7 | {
8 | [Export(typeof(IToolTipService))]
9 | class MockTooltipService : IToolTipService
10 | {
11 | public IToolTipPresenter CreatePresenter(ITextView textView, ToolTipParameters parameters = null)
12 | {
13 | return new MockToolTipPresenter();
14 | }
15 | }
16 |
17 | class MockToolTipPresenter : IToolTipPresenter
18 | {
19 | public event EventHandler Dismissed;
20 |
21 | public void Dismiss()
22 | {
23 | Dismissed?.Invoke(this, EventArgs.Empty);
24 | }
25 |
26 | public void StartOrUpdate(ITrackingSpan applicableToSpan, IEnumerable