Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Stedfast <jestedfa@microsoft.com>2019-07-30 20:48:52 +0300
committerJeffrey Stedfast <jestedfa@microsoft.com>2019-07-30 20:48:52 +0300
commitac38cf05489e963cd7ea68d75ec814ce94e72b8b (patch)
treebc4218ddc1e9dbc6e9c37efdf6e144eb323aa2c8 /main/src/addins
parent4fcc0f0d2f014b7858fce2d1d0dac8cb8217c807 (diff)
parent370d5965b4b3b69d3010f916c7790afc15841a61 (diff)
Merge branch 'master' into vsts-866545-objectvaluetreeview
Diffstat (limited to 'main/src/addins')
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/CSharpOutlineTextEditorExtension.cs43
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/CSharpOutlineTextEditorExtensionProvider.cs2
-rw-r--r--main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/CustomSoftDebuggerEngine.cs2
-rw-r--r--main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol/MonoDevelop.Debugger.VsCodeDebugProtocol/VsCodeStackFrame.cs57
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/MonoDevelop.Debugger.Tests.csproj5
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/VsCodeStackFrameTests.cs49
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionOptionsPanel.cs1
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj6
-rw-r--r--main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor.Cocoa/MonoDevelop.TextEditor.Cocoa.csproj6
-rw-r--r--main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor.Cocoa/Properties/MonoDevelop.TextEditor.Cocoa.addin.xml5
-rw-r--r--main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor.Wpf/MonoDevelop.TextEditor.Wpf.csproj4
-rw-r--r--main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/MonoDevelop.TextEditor.csproj8
-rw-r--r--main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/TextViewContent.cs3
-rw-r--r--main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/TextViewImports.cs4
-rw-r--r--main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/ThemeToClassification.cs1
15 files changed, 165 insertions, 31 deletions
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/CSharpOutlineTextEditorExtension.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/CSharpOutlineTextEditorExtension.cs
index 09d51c74e1..ec2ba8e078 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/CSharpOutlineTextEditorExtension.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/CSharpOutlineTextEditorExtension.cs
@@ -41,6 +41,8 @@ using MonoDevelop.Ide.Editor;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.VisualStudio.Text.Editor;
+using Microsoft.CodeAnalysis.Text;
namespace MonoDevelop.CSharp.ClassOutline
{
@@ -74,16 +76,37 @@ namespace MonoDevelop.CSharp.ClassOutline
bool outlineReady;
Document providedAnalysisDocument;
-
+ ITextView textView;
public CSharpOutlineTextEditorExtension ()
{
// does nothing, but is here for legacy editor support
}
- public CSharpOutlineTextEditorExtension (Document document)
+ public CSharpOutlineTextEditorExtension (ITextView textView)
{
- providedAnalysisDocument = document;
+ this.textView = textView ?? throw new ArgumentNullException (nameof (textView));
+
+ textView.Closed += TextView_Closed;
+ textView.TextBuffer.Changed += UpdateAnalysisDocument;
+
+ UpdateAnalysisDocument (this, null);
+ }
+
+ void UpdateAnalysisDocument (object sender, Microsoft.VisualStudio.Text.TextContentChangedEventArgs e)
+ {
+ providedAnalysisDocument = textView.TextSnapshot.GetOpenDocumentInCurrentContextWithChanges ();
+ outlineReady = true; // we need this to compensate for the old behaviour
+ UpdateDocumentOutline (this, e);
+ }
+
+ void TextView_Closed (object sender, EventArgs e)
+ {
+ if (textView == null || textView.TextBuffer == null) return;
+
+ textView.Closed -= TextView_Closed;
+ textView.TextBuffer.Changed -= UpdateAnalysisDocument;
+ textView = null;
}
public override bool IsValidInContext (DocumentContext context)
@@ -110,6 +133,10 @@ namespace MonoDevelop.CSharp.ClassOutline
lastCU = null;
settings = null;
comparer = null;
+
+ // also, unsubscribe from text view events, if we're in the new editor
+ TextView_Closed (this, null);
+
base.Dispose ();
}
@@ -232,7 +259,15 @@ namespace MonoDevelop.CSharp.ClassOutline
var workspace = providedAnalysisDocument.Project.Solution.Workspace;
var navigationService = workspace.Services.GetService<Microsoft.CodeAnalysis.Navigation.IDocumentNavigationService> ();
- navigationService.TryNavigateToSpan (workspace, providedAnalysisDocument.Id, syntaxNode?.Span ?? ((SyntaxTrivia)o).FullSpan);
+ try {
+ navigationService.TryNavigateToSpan (workspace, providedAnalysisDocument.Id, syntaxNode?.Span ?? ((SyntaxTrivia)o).FullSpan);
+ } catch {
+ // if this happens, there's a big chance that the document was updated and we didn't update our
+ // tree with the latest analysis. What we can do is try and update the analysis document again.
+ // Specific use case for this is when the enough code is removed, and we try navigating to the
+ // last span in the document.
+ UpdateAnalysisDocument (this, null);
+ }
return;
}
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/CSharpOutlineTextEditorExtensionProvider.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/CSharpOutlineTextEditorExtensionProvider.cs
index dc5daa54e1..e251455c5b 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/CSharpOutlineTextEditorExtensionProvider.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.ClassOutline/CSharpOutlineTextEditorExtensionProvider.cs
@@ -35,6 +35,6 @@ namespace MonoDevelop.CSharp
[TextViewRole (PredefinedTextViewRoles.PrimaryDocument)]
class CSharpOutlineTextEditorExtensionProvider : EditorContentInstanceProvider<CSharpOutlineTextEditorExtension>
{
- protected override CSharpOutlineTextEditorExtension CreateInstance (ITextView view) => new CSharpOutlineTextEditorExtension (view.TextSnapshot.GetOpenDocumentInCurrentContextWithChanges ());
+ protected override CSharpOutlineTextEditorExtension CreateInstance (ITextView view) => new CSharpOutlineTextEditorExtension (view);
}
}
diff --git a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/CustomSoftDebuggerEngine.cs b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/CustomSoftDebuggerEngine.cs
index 2e5e08f885..0ed6f75f22 100644
--- a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/CustomSoftDebuggerEngine.cs
+++ b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/CustomSoftDebuggerEngine.cs
@@ -340,7 +340,7 @@ namespace MonoDevelop.Debugger.Soft
TimeBetweenConnectionAttempts = 800,
MaxConnectionAttempts = -1,
};
- };
+ }
var dsi = new SoftDebuggerStartInfo (startArgs) {
Command = StringParserService.Parse (command),
diff --git a/main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol/MonoDevelop.Debugger.VsCodeDebugProtocol/VsCodeStackFrame.cs b/main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol/MonoDevelop.Debugger.VsCodeDebugProtocol/VsCodeStackFrame.cs
index 09930da9ee..a72aeb7634 100644
--- a/main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol/MonoDevelop.Debugger.VsCodeDebugProtocol/VsCodeStackFrame.cs
+++ b/main/src/addins/MonoDevelop.Debugger.VSCodeDebugProtocol/MonoDevelop.Debugger.VsCodeDebugProtocol/VsCodeStackFrame.cs
@@ -10,7 +10,7 @@ using VsFormat = Microsoft.VisualStudio.Shared.VSCodeDebugProtocol.Messages.Stac
namespace MonoDevelop.Debugger.VsCodeDebugProtocol
{
- class VsCodeStackFrame : Mono.Debugging.Client.StackFrame
+ public class VsCodeStackFrame : Mono.Debugging.Client.StackFrame
{
public static VsFormat GetStackFrameFormat (EvaluationOptions evalOptions)
{
@@ -58,25 +58,58 @@ namespace MonoDevelop.Debugger.VsCodeDebugProtocol
this.frameId = frame.Id;
}
- static byte [] HexToByteArray (string hex)
+ static byte ToXDigit (char c)
+ {
+ if (c >= 'A' && c <= 'F')
+ return (byte) ((c - 'A') + 10);
+
+ if (c >= 'a' && c <= 'f')
+ return (byte) ((c - 'a') + 10);
+
+ if (c >= '0' && c <= '9')
+ return (byte) (c - '0');
+
+ throw new ArgumentException ();
+ }
+
+ public static byte[] HexToByteArray (string hex)
{
if (hex.Length % 2 == 1)
- throw new ArgumentException ();
- byte [] bytes = new byte [hex.Length / 2];
- for (int i = 0; i < bytes.Length; i++) {
- bytes [i] = Convert.ToByte (hex.Substring (i * 2, 2), 16);
+ return null;
+
+ try {
+ var bytes = new byte[hex.Length / 2];
+ for (int i = 0, j = 0; i < bytes.Length; i++, j += 2) {
+ var x1 = ToXDigit (hex[j]);
+ var x2 = ToXDigit (hex[j + 1]);
+
+ bytes[i] = (byte) ((x1 << 4) | x2);
+ }
+
+ return bytes;
+ } catch {
+ return null;
}
- return bytes;
}
- static byte [] GetHashBytes (Source source)
+ static byte[] GetHashBytes (Source source)
{
if (source == null)
return null;
- var checkSum = source.Checksums.FirstOrDefault (c => c.Algorithm == ChecksumAlgorithm.SHA1);
- if (checkSum == null)
- return null;
- return HexToByteArray (checkSum.ChecksumValue);
+
+ foreach (var checksum in source.Checksums) {
+ switch (checksum.Algorithm) {
+ case ChecksumAlgorithm.SHA256:
+ case ChecksumAlgorithm.SHA1:
+ case ChecksumAlgorithm.MD5:
+ var hash = HexToByteArray (checksum.ChecksumValue);
+ if (hash != null)
+ return hash;
+ break;
+ }
+ }
+
+ return null;
}
public override string FullStackframeText {
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/MonoDevelop.Debugger.Tests.csproj b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/MonoDevelop.Debugger.Tests.csproj
index 66a368f365..75a26167f2 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/MonoDevelop.Debugger.Tests.csproj
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/MonoDevelop.Debugger.Tests.csproj
@@ -21,6 +21,7 @@
<Compile Include="..\..\..\..\external\debugger-libs\UnitTests\Mono.Debugging.Tests\Shared\Win32\*.cs" />
<Compile Include="DebugTests.MonoDevelop.cs" />
<Compile Include="TextFile.cs" />
+ <Compile Include="VsCodeStackFrameTests.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MonoDevelop.Debugger.csproj">
@@ -63,6 +64,10 @@
<Name>Mono.Debugging.Soft</Name>
<Private>False</Private>
</ProjectReference>
+ <ProjectReference Include="..\..\MonoDevelop.Debugger.VSCodeDebugProtocol\MonoDevelop.Debugger.VsCodeDebugProtocol\MonoDevelop.Debugger.VsCodeDebugProtocol.csproj">
+ <Project>{10F5BBD5-8A1D-4563-BCE4-DE681DFD82FD}</Project>
+ <Name>MonoDevelop.Debugger.VsCodeDebugProtocol</Name>
+ </ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Target Name="AfterBuild">
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/VsCodeStackFrameTests.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/VsCodeStackFrameTests.cs
new file mode 100644
index 0000000000..3576b8d19f
--- /dev/null
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests/VsCodeStackFrameTests.cs
@@ -0,0 +1,49 @@
+//
+// VsCodeStackFrameTests.cs
+//
+// Author:
+// Jeffrey Stedfast <jestedfa@microsoft.com>
+//
+// Copyright (c) 2019 Microsoft Corp.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+using NUnit.Framework;
+
+using MonoDevelop.Debugger.VsCodeDebugProtocol;
+
+namespace MonoDevelop.Debugger.Tests
+{
+ [TestFixture]
+ public class VsCodeStackFrameTests
+ {
+ [Test]
+ public void TestHexDecode ()
+ {
+ var result = VsCodeStackFrame.HexToByteArray ("fFaAbB0012a1");
+
+ Assert.AreEqual ((byte) 0xff, result[0], "result[0]");
+ Assert.AreEqual ((byte) 0xaa, result[1], "result[1]");
+ Assert.AreEqual ((byte) 0xbb, result[2], "result[2]");
+ Assert.AreEqual ((byte) 0x00, result[3], "result[3]");
+ Assert.AreEqual ((byte) 0x12, result[4], "result[4]");
+ Assert.AreEqual ((byte) 0xa1, result[5], "result[5]");
+ }
+ }
+}
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionOptionsPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionOptionsPanel.cs
index a529938466..989b024377 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionOptionsPanel.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/CompletionOptionsPanel.cs
@@ -93,6 +93,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels
void IOptionsPanel.ApplyChanges ()
{
DefaultSourceEditorOptions.Instance.EnableAutoCodeCompletion = autoCodeCompletionCheckbutton.Active;
+ IdeApp.Preferences.Roslyn.CSharp.TriggerOnTypingLetters.Value = autoCodeCompletionCheckbutton.Active;
IdeApp.Preferences.AddImportedItemsToCompletionList.Value = showImportsCheckbutton.Active;
IdeApp.Preferences.Roslyn.CSharp.ShowItemsFromUnimportedNamespaces.Value = showImportsCheckbutton.Active;
IdeApp.Preferences.IncludeKeywordsInCompletionList.Value = includeKeywordsCheckbutton.Active;
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj
index 545da52d8b..45bdc1bcf6 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj
@@ -84,9 +84,9 @@
</Reference>
</ItemGroup>
<ItemGroup>
- <Compile Include="..\..\..\external\vs-editor-api\src\Editor\Text\Util\TextUIUtil\VacuousTextDataModel.cs" Link="Util\VacuousTextDataModel.cs" />
- <Compile Include="..\..\..\external\vs-editor-api\src\Editor\Text\Util\TextUIUtil\VacuousTextViewModel.cs" Link="Util\VacuousTextViewModel.cs" />
- <Compile Include="..\..\..\external\vs-editor-api\src\Editor\Text\Util\TextUIUtil\UIExtensionSelector.cs" Link="Util\UIExtensionSelector.cs" />
+ <Compile Include="$(VSEditorApiDirectory)src\Editor\Text\Util\TextUIUtil\VacuousTextDataModel.cs" Link="Util\VacuousTextDataModel.cs" />
+ <Compile Include="$(VSEditorApiDirectory)src\Editor\Text\Util\TextUIUtil\VacuousTextViewModel.cs" Link="Util\VacuousTextViewModel.cs" />
+ <Compile Include="$(VSEditorApiDirectory)src\Editor\Text\Util\TextUIUtil\UIExtensionSelector.cs" Link="Util\UIExtensionSelector.cs" />
<None Include="MonoDevelop.SourceEditor.dll.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
diff --git a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor.Cocoa/MonoDevelop.TextEditor.Cocoa.csproj b/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor.Cocoa/MonoDevelop.TextEditor.Cocoa.csproj
index a595d31d84..b2494e44ec 100644
--- a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor.Cocoa/MonoDevelop.TextEditor.Cocoa.csproj
+++ b/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor.Cocoa/MonoDevelop.TextEditor.Cocoa.csproj
@@ -61,6 +61,7 @@
<ProjectReference Include="$(VSEditorCoreDirectory)src\Editor\Text\Impl\VisibleWhitespace\VisibleWhitespaceImpl.csproj" Private="True" />
<ProjectReference Include="$(VSEditorCoreDirectory)src\Editor\Text\Impl\GlyphMargin\GlyphMarginImpl.csproj" Private="True" />
<ProjectReference Include="$(VSEditorCoreDirectory)src\Editor\Text\Impl\Structure\StructureImpl.csproj" Private="true" />
+ <ProjectReference Include="$(VSEditorCoreDirectory)src\Editor\Text\Impl\TaskTagger\TaskTagger.csproj" Private="true" />
<ProjectReference Include="$(VSEditorCoreDirectory)src\Editor\Text\Impl\UrlTagger\UrlTagger.csproj" Private="true" />
<ProjectReference Include="$(VSEditorCoreDirectory)src\Editor\Text\Impl\DragDrop\DragDropImpl.csproj" Private="True" />
<ProjectReference Include="$(VSEditorCoreDirectory)src\Editor\Text\Impl\ChangeTagger\ChangeTagger.csproj" Private="True" />
@@ -71,10 +72,10 @@
</Reference>
</ItemGroup>
<ItemGroup>
- <None Include="..\..\..\..\..\..\md-addins\external\vs-editor-core\bin\TextMate\Onig\libonig.dylib">
+ <None Include="$(VSEditorCoreDirectory)bin\TextMate\Onig\libonig.dylib">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
- <None Include="..\..\..\..\..\..\md-addins\external\vs-editor-core\src\TextMate\VSWindows\Setup\**\*">
+ <None Include="$(VSEditorCoreDirectory)src\TextMate\VSWindows\Setup\**\*">
<Link>%(RecursiveDir)%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
@@ -95,6 +96,7 @@
<IncludeCopyLocal Include="Microsoft.VisualStudio.UI.Text.Wpf.GlyphMargin.Implementation.dll" />
<IncludeCopyLocal Include="Microsoft.VisualStudio.UI.Text.AdornmentLibrary.VisibleWhitespace.Implementation.dll" />
<IncludeCopyLocal Include="Microsoft.VisualStudio.UI.Text.CurrentLineHighlighter.Implementation.dll" />
+ <IncludeCopyLocal Include="Microsoft.VisualStudio.Logic.Text.TaskTagger.Implementation.dll" />
<IncludeCopyLocal Include="Microsoft.VisualStudio.Logic.Text.UrlTagger.Implementation.dll" />
<IncludeCopyLocal Include="Microsoft.VisualStudio.UI.Text.Cocoa.DragDrop.Implementation.dll" />
<IncludeCopyLocal Include="Microsoft.VisualStudio.Logic.Text.ChangeTagger.Implementation.dll" />
diff --git a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor.Cocoa/Properties/MonoDevelop.TextEditor.Cocoa.addin.xml b/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor.Cocoa/Properties/MonoDevelop.TextEditor.Cocoa.addin.xml
index 49668b7ccb..3cbda1c2bc 100644
--- a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor.Cocoa/Properties/MonoDevelop.TextEditor.Cocoa.addin.xml
+++ b/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor.Cocoa/Properties/MonoDevelop.TextEditor.Cocoa.addin.xml
@@ -32,7 +32,7 @@
<Import assembly="Microsoft.VisualStudio.UI.Controls.macOS.dll" />
</Runtime>
<Extension path="/MonoDevelop/Ide/Composition">
- <!-- These are coming from vs-editor-api (no Cocoa dependency) -->
+ <!-- these are coming from vs-editor-core (Cocoa implementations) -->
<Assembly file="Microsoft.CodeAnalysis.EditorFeatures.Cocoa.dll" />
<Assembly file="Microsoft.VisualStudio.Language.StandardClassification.Implementation.dll" />
<Assembly file="Microsoft.VisualStudio.Logic.Text.Navigation.NavigationProviders.dll" />
@@ -49,8 +49,9 @@
<Assembly file="Microsoft.VisualStudio.UI.Text.Wpf.GlyphMargin.Implementation.dll" />
<Assembly file="Microsoft.VisualStudio.UI.Text.Cocoa.DragDrop.Implementation.dll" />
<Assembly file="Microsoft.VisualStudio.Logic.Text.ChangeTagger.Implementation.dll" />
+ <Assembly file="Microsoft.VisualStudio.Logic.Text.TaskTagger.Implementation.dll" />
<Assembly file="MonoDevelop.TextEditor.Cocoa.dll" />
- <!-- these are coming from vs-editor-core (Cocoa implementations) -->
+ <!-- These are coming from vs-editor-api (no Cocoa dependency) -->
<Assembly file="../../../bin/Microsoft.VisualStudio.CoreUtilityImplementation.dll" />
<Assembly file="../../../bin/Microsoft.VisualStudio.Editor.Imaging.dll" />
<Assembly file="../../../bin/Microsoft.VisualStudio.Language.Implementation.dll" />
diff --git a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor.Wpf/MonoDevelop.TextEditor.Wpf.csproj b/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor.Wpf/MonoDevelop.TextEditor.Wpf.csproj
index 33d8819118..30a7e8f7df 100644
--- a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor.Wpf/MonoDevelop.TextEditor.Wpf.csproj
+++ b/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor.Wpf/MonoDevelop.TextEditor.Wpf.csproj
@@ -19,8 +19,8 @@
<PackageReference Include="Microsoft.VisualStudio.Language" Version="$(NuGetVersionVSEditor)" PrivateAssets="all" ExcludeAssets="runtime" />
<PackageReference Include="Microsoft.VisualStudio.Language.Intellisense" Version="$(NuGetVersionVSEditor)" PrivateAssets="all" ExcludeAssets="runtime" />
<ProjectReference Include="..\MonoDevelop.TextEditor\MonoDevelop.TextEditor.csproj" Private="False" />
- <ProjectReference Include="..\..\..\..\external\vs-editor-api\src\Editor\Imaging\Def\Imaging.csproj" />
- <ProjectReference Include="..\..\..\..\external\vs-editor-api\src\Editor\Text\Def\Extras\Extras.csproj" />
+ <ProjectReference Include="$(VSEditorApiDirectory)src\Editor\Imaging\Def\Imaging.csproj" />
+ <ProjectReference Include="$(VSEditorApiDirectory)src\Editor\Text\Def\Extras\Extras.csproj" />
<ProjectReference Include="..\..\..\..\external\xwt\Xwt\Xwt.csproj" Private="False" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
diff --git a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/MonoDevelop.TextEditor.csproj b/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/MonoDevelop.TextEditor.csproj
index 179f76e3b6..3edbd5e600 100644
--- a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/MonoDevelop.TextEditor.csproj
+++ b/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/MonoDevelop.TextEditor.csproj
@@ -10,7 +10,7 @@
<DefineConstants Condition="$(OS) == 'Windows_NT'">$(DefineConstants);WINDOWS;WIN32</DefineConstants>
</PropertyGroup>
<ItemGroup>
- <ProjectReference Include="..\..\..\..\external\vs-editor-api\src\Editor\Text\Def\Extras\Extras.csproj" />
+ <ProjectReference Include="$(VSEditorApiDirectory)src\Editor\Text\Def\Extras\Extras.csproj" />
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="MonoDevelop.TextEditor.Cocoa" />
@@ -20,8 +20,8 @@
<ProjectReference Include="..\..\MonoDevelop.DesignerSupport\MonoDevelop.DesignerSupport.csproj" Private="false" />
</ItemGroup>
<ItemGroup>
- <Compile Include="..\..\..\..\external\vs-editor-api\src\Editor\Text\Util\TextUIUtil\VacuousTextDataModel.cs" Link="Util\VacuousTextDataModel.cs" />
- <Compile Include="..\..\..\..\external\vs-editor-api\src\Editor\Text\Util\TextUIUtil\UIExtensionSelector.cs" Link="Util\UIExtensionSelector.cs" />
- <Compile Include="..\..\..\..\external\vs-editor-api\src\Editor\Text\Util\TextUIUtil\VacuousTextViewModel.cs" Link="Util\VacuousTextViewModel.cs" />
+ <Compile Include="$(VSEditorApiDirectory)src\Editor\Text\Util\TextUIUtil\VacuousTextDataModel.cs" Link="Util\VacuousTextDataModel.cs" />
+ <Compile Include="$(VSEditorApiDirectory)src\Editor\Text\Util\TextUIUtil\UIExtensionSelector.cs" Link="Util\UIExtensionSelector.cs" />
+ <Compile Include="$(VSEditorApiDirectory)src\Editor\Text\Util\TextUIUtil\VacuousTextViewModel.cs" Link="Util\VacuousTextViewModel.cs" />
</ItemGroup>
</Project> \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/TextViewContent.cs b/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/TextViewContent.cs
index 558ec7c203..0e5aa25a14 100644
--- a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/TextViewContent.cs
+++ b/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/TextViewContent.cs
@@ -369,6 +369,9 @@ namespace MonoDevelop.TextEditor
{
UpdateLineNumberMarginOption ();
+ var foldMargin = PropertyService.Get<bool> ("ShowFoldMargin");
+ Imports.OutliningManagerService.GetOutliningManager (TextView).Enabled = foldMargin;
+
var newPolicyContainer = (Owner as IPolicyProvider)?.Policies;
if (newPolicyContainer != policyContainer) {
if (policyContainer != null)
diff --git a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/TextViewImports.cs b/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/TextViewImports.cs
index 1861089e23..e9cb83dd19 100644
--- a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/TextViewImports.cs
+++ b/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/TextViewImports.cs
@@ -32,6 +32,7 @@ using Microsoft.VisualStudio.Text.Classification;
using Microsoft.VisualStudio.Text.Operations;
using Microsoft.VisualStudio.Text.Find;
using Microsoft.VisualStudio.Text.Projection;
+using Microsoft.VisualStudio.Text.Outlining;
namespace MonoDevelop.TextEditor
{
@@ -78,5 +79,8 @@ namespace MonoDevelop.TextEditor
[Import(AllowDefault = true)]
internal IInfoBarPresenterFactory InfoBarPresenterFactory { get; set; }
+
+ [Import]
+ internal IOutliningManagerService OutliningManagerService { get; set; }
}
} \ No newline at end of file
diff --git a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/ThemeToClassification.cs b/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/ThemeToClassification.cs
index e9e9afa34e..462d3831b3 100644
--- a/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/ThemeToClassification.cs
+++ b/main/src/addins/MonoDevelop.TextEditor/MonoDevelop.TextEditor/ThemeToClassification.cs
@@ -168,6 +168,7 @@ namespace MonoDevelop.TextEditor
("HTML Operator", "HTML Operator"),
("HTML Server-Side Script", "HTML Server-Side Script"),
("HTML Tag Delimiter", "HTML Tag Delimiter"),
+ ("taskformat", "Comment Tags"),
};
void UpdateEditorFormatMap (object sender, EventArgs args)