diff options
author | Mikayla Hutchinson <m.j.hutchinson@gmail.com> | 2017-02-15 02:03:10 +0300 |
---|---|---|
committer | Mikayla Hutchinson <m.j.hutchinson@gmail.com> | 2017-02-15 02:03:10 +0300 |
commit | 89070c862a68546ff5f148abd7f7bcb5906cb51c (patch) | |
tree | 144e7f8ec3f8b25d823e0c5acc646b8e07e3b462 | |
parent | 8acc93fe85a5cf1f6129b912f15c48412c12aadd (diff) | |
parent | 2484acde36ede88f8f027e397626586886e3acee (diff) |
Merge remote-tracking branch 'origin/vNext' into roslyn-ivt
101 files changed, 586 insertions, 188 deletions
diff --git a/main/Makefile.am b/main/Makefile.am index 6782724bd8..16ad128a16 100644 --- a/main/Makefile.am +++ b/main/Makefile.am @@ -22,7 +22,7 @@ clean-local: sln_clean cd build && $(MAKE) clean NUGET_FOUND = $$(echo $$(which nuget)) -NUGET_RESTORE = mono external/nuget-binary/nuget.exe restore; +NUGET_RESTORE = mono external/nuget-binary/nuget.exe restore -DisableParallelProcessing; #FIXME: move the restore logic into MSBuild (Before.sln.targets), # see: https://github.com/kzu/NuGet.Restore diff --git a/main/external/fsharpbinding/MonoDevelop.FSharp.Tests/UnusedOpens.fs b/main/external/fsharpbinding/MonoDevelop.FSharp.Tests/UnusedOpens.fs index dffafa3f66..69630b1a06 100644 --- a/main/external/fsharpbinding/MonoDevelop.FSharp.Tests/UnusedOpens.fs +++ b/main/external/fsharpbinding/MonoDevelop.FSharp.Tests/UnusedOpens.fs @@ -10,7 +10,7 @@ module ``Highlight unused opens`` = let doc = TestHelpers.createDoc source "defined" let res = highlightUnusedCode.getUnusedCode doc doc.Editor let opens = res.Value |> List.map(fun range -> highlightUnusedCode.textFromRange doc.Editor range) - opens |> should equal expected + Assert.AreEqual(expected, opens, sprintf "%A" opens) [<Test>] let Simple() = @@ -46,6 +46,26 @@ module ``Highlight unused opens`` = assertUnusedOpens source [] [<Test>] + let ``Active Patterns``() = + let source = + """ + namespace n + module ActivePattern = + let (|NotEmpty|_|) s = + match s with + | "" -> None + | _ -> Some NotEmpty + namespace namespace1 + open n.ActivePattern + module module1 = + let s = "" + match s with + | NotEmpty -> Some s + | _ -> None + """ + assertUnusedOpens source [] + + [<Test>] let ``Auto open namespace not needed for nested module``() = let source = """ @@ -59,7 +79,7 @@ module ``Highlight unused opens`` = module module3 = let y = module2.x """ - assertUnusedOpens source [] + assertUnusedOpens source ["module1namespace"] [<Test>] let ``Duplicated open statements``() = diff --git a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/FSharpBinding.addin.xml b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/FSharpBinding.addin.xml index bb07acb9a0..8fbda1e15e 100644 --- a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/FSharpBinding.addin.xml +++ b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/FSharpBinding.addin.xml @@ -145,10 +145,9 @@ <Extension path = "/MonoDevelop/ProjectModel/PolicySets/Mono" > <Policies resource="FSharpStylePolicy.xml" /> + <Policies resource="FSharpFormattingPolicy.xml" /> </Extension> - <Policies resource="FSharpFormattingPolicy.xml" /> - <Extension path = "/MonoDevelop/ProjectModel/Gui/MimeTypePolicyPanels"> <Panel id = "FSharpFormatting" _label = "F# Formatting" mimeType="text/x-fsharp" class = "MonoDevelop.FSharp.FSharpFormattingPolicyPanel" /> </Extension> diff --git a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/FSharpTextEditorCompletion.fs b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/FSharpTextEditorCompletion.fs index dd76126596..ffabe2da00 100644 --- a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/FSharpTextEditorCompletion.fs +++ b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/FSharpTextEditorCompletion.fs @@ -798,7 +798,7 @@ type FSharpTextEditorCompletion() = // Run completion automatically when the user hits '.' override x.HandleCodeCompletionAsync(context, triggerInfo, token) = if IdeApp.Preferences.EnableAutoCodeCompletion.Value then - if triggerInfo.CompletionTriggerReason = CompletionTriggerReason.CharTyped && triggerInfo.TriggerCharacter.Value = '.' || triggerInfo.CompletionTriggerReason = CompletionTriggerReason.CompletionCommand then + if triggerInfo.CompletionTriggerReason = CompletionTriggerReason.CharTyped || triggerInfo.TriggerCharacter.Value = '.' && triggerInfo.CompletionTriggerReason = CompletionTriggerReason.CompletionCommand then let computation = Completion.codeCompletionCommandImpl(x.Editor, x.DocumentContext, context, false) diff --git a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/HighlightUnusedCode.fs b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/HighlightUnusedCode.fs index 9d92f06ad2..1ac6d0e58e 100644 --- a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/HighlightUnusedCode.fs +++ b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/HighlightUnusedCode.fs @@ -102,19 +102,26 @@ module highlightUnusedCode = let isQualified = symbolIsFullyQualified editor sym match sym with | SymbolUse.Entity ent when not (isQualified ent.TryFullName) -> - getPartNamespace sym ent.TryFullName::entityNamespace (Some ent) + getPartNamespace sym ent.TryFullName :: entityNamespace (Some ent) | SymbolUse.Field f when not (isQualified (Some f.FullName)) -> - getPartNamespace sym (Some f.FullName)::entityNamespace (Some f.DeclaringEntity) + getPartNamespace sym (Some f.FullName) :: entityNamespace (Some f.DeclaringEntity) | SymbolUse.MemberFunctionOrValue mfv when not (isQualified (Some mfv.FullName)) -> - try - getPartNamespace sym (Some mfv.FullName)::entityNamespace mfv.EnclosingEntitySafe - with :? InvalidOperationException -> [None] + getPartNamespace sym (Some mfv.FullName) :: entityNamespace mfv.EnclosingEntitySafe | SymbolUse.Operator op when not (isQualified (Some op.FullName)) -> - getPartNamespace sym (Some op.FullName)::entityNamespace op.EnclosingEntitySafe + getPartNamespace sym (Some op.FullName) :: entityNamespace op.EnclosingEntitySafe + | SymbolUse.ActivePattern ap when not (isQualified (Some ap.FullName)) -> + getPartNamespace sym (Some ap.FullName) :: entityNamespace ap.EnclosingEntitySafe + | SymbolUse.ActivePatternCase apc when not (isQualified (Some apc.FullName)) -> + getPartNamespace sym (Some apc.FullName) :: entityNamespace apc.Group.EnclosingEntity + | SymbolUse.UnionCase uc when not (isQualified (Some uc.FullName)) -> + getPartNamespace sym (Some uc.FullName) :: entityNamespace (Some uc.ReturnType.TypeDefinition) + | SymbolUse.Parameter p when not (isQualified (Some p.FullName)) -> + getPartNamespace sym (Some p.FullName) :: entityNamespace (Some p.Type.TypeDefinition) | _ -> [None] let namespacesInUse = symbols + |> Seq.filter (fun s -> not s.IsFromDefinition) |> Seq.collect getPossibleNamespaces |> Seq.choose id |> Set.ofSeq diff --git a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/Templates/FSharpConsoleProject.xpt.xml b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/Templates/FSharpConsoleProject.xpt.xml index f0e7ff971d..25fe011c17 100644 --- a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/Templates/FSharpConsoleProject.xpt.xml +++ b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/Templates/FSharpConsoleProject.xpt.xml @@ -37,7 +37,7 @@ <Files> <FileTemplateReference TemplateID="FSharpAssemblyInfo" name="AssemblyInfo.fs" /> <UnformattedFile name = "Program.fs" AddStandardHeader="True"> - <![CDATA[// Learn more about F# at http://fsharp.net + <![CDATA[// Learn more about F# at http://fsharp.org // See the 'F# Tutorial' project for more help. [<EntryPoint>] diff --git a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/Templates/FSharpLibraryProject.xpt.xml b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/Templates/FSharpLibraryProject.xpt.xml index 1cbbac7de1..aaa0ef705d 100644 --- a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/Templates/FSharpLibraryProject.xpt.xml +++ b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/Templates/FSharpLibraryProject.xpt.xml @@ -43,7 +43,7 @@ type Class1() = member this.X = "F#" ]]></UnformattedFile> <UnformattedFile name = "Script.fsx" AddStandardHeader="True"> - <![CDATA[// Learn more about F# at http://fsharp.net. See the 'F# Tutorial' project + <![CDATA[// Learn more about F# at http://fsharp.org. See the 'F# Tutorial' project // for more guidance on F# programming. #load "Component1.fs" diff --git a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/Templates/PortableLibrary.xpt.xml b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/Templates/PortableLibrary.xpt.xml index 21441da6e2..3da22f129c 100644 --- a/main/external/fsharpbinding/MonoDevelop.FSharpBinding/Templates/PortableLibrary.xpt.xml +++ b/main/external/fsharpbinding/MonoDevelop.FSharpBinding/Templates/PortableLibrary.xpt.xml @@ -46,8 +46,8 @@ type Class1() = member this.X = "F#" ]]></UnformattedFile> <UnformattedFile name = "Script.fsx" AddStandardHeader="True"> - <![CDATA[// Learn more about F# at http://fsharp.net. See the 'F# Tutorial' project -// for more guidance on F# programming. + <![CDATA[// Learn more about F# at http://fsharp.org. See the 'F# Tutorial' project + for more guidance on F# programming. #load "Component1.fs" open ${Namespace} diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextPasteHandler.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextPasteHandler.cs index 96b8635c4f..836686d483 100644 --- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextPasteHandler.cs +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextPasteHandler.cs @@ -59,7 +59,16 @@ namespace MonoDevelop.CSharp.Formatting indent.Editor.Options.IndentStyle == IndentStyle.Auto) return; if (DefaultSourceEditorOptions.Instance.OnTheFlyFormatting) { - OnTheFlyFormatter.Format (indent.Editor, indent.DocumentContext, insertionOffset, insertionOffset + insertedChars); + int lineStartOffset = indent.Editor.GetLineByOffset (insertionOffset).Offset; + int formatCharsCount = insertedChars + (lineStartOffset - insertionOffset); + var newText = CSharpFormatter.FormatText ( + indent.DocumentContext.GetFormattingPolicy (), + indent.DocumentContext.Project.Policies.Get<Ide.Gui.Content.TextStylePolicy> (), + indent.Editor.GetTextBetween (lineStartOffset, insertionOffset + insertedChars), + lineStartOffset, + formatCharsCount + ); + indent.Editor.ReplaceText (lineStartOffset, formatCharsCount, newText); return; } // Just correct the start line of the paste operation - the text is already indented. diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32.png b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32.png Binary files differindex 2cc5e379ae..f1327f44a9 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32.png +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32.png diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32@2x.png b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32@2x.png Binary files differindex 58ef3be85c..aaa7efd2bd 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32@2x.png +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32@2x.png diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32~dark.png b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32~dark.png Binary files differindex d0a81ecc3f..e7dc9c7be0 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32~dark.png +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32~dark.png diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32~dark@2x.png b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32~dark@2x.png Binary files differindex b127b7fb3a..e549eb2fbf 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32~dark@2x.png +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32~dark@2x.png diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32~dark~sel.png b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32~dark~sel.png Binary files differindex 48b71c55d4..f544a27a3d 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32~dark~sel.png +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32~dark~sel.png diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32~dark~sel@2x.png b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32~dark~sel@2x.png Binary files differindex cf0d574dd7..8428542805 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32~dark~sel@2x.png +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32~dark~sel@2x.png diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32~sel.png b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32~sel.png Binary files differindex 48b71c55d4..f544a27a3d 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32~sel.png +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32~sel.png diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32~sel@2x.png b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32~sel@2x.png Binary files differindex cf0d574dd7..8428542805 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32~sel@2x.png +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-32~sel@2x.png diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-template.png b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-template.png Binary files differindex bfe1cb7ce1..fc1f83580c 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-template.png +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-template.png diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-template@2x.png b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-template@2x.png Binary files differindex 4df1c181dc..319197d702 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-template@2x.png +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-template@2x.png diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-template~dark.png b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-template~dark.png Binary files differindex 3ec008e1ce..e11f423e5e 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-template~dark.png +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-template~dark.png diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-template~dark@2x.png b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-template~dark@2x.png Binary files differindex 0227ef8781..5939530cea 100644 --- a/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-template~dark@2x.png +++ b/main/src/addins/Deployment/MonoDevelop.Deployment/templates/images/project-package-template~dark@2x.png diff --git a/main/src/addins/MacPlatform/MacPlatform.csproj b/main/src/addins/MacPlatform/MacPlatform.csproj index d33fb531a7..bba69d88ca 100644 --- a/main/src/addins/MacPlatform/MacPlatform.csproj +++ b/main/src/addins/MacPlatform/MacPlatform.csproj @@ -230,18 +230,6 @@ <EmbeddedResource Include="icons\status-stop-16~dark%402x.png"> <LogicalName>status-stop-16~dark@2x.png</LogicalName> </EmbeddedResource> - <EmbeddedResource Include="icons\status-stop-16~dark~hover.png"> - <LogicalName>status-stop-16~dark~hover.png</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="icons\status-stop-16~dark~hover%402x.png"> - <LogicalName>status-stop-16~dark~hover@2x.png</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="icons\status-stop-16~hover.png"> - <LogicalName>status-stop-16~hover.png</LogicalName> - </EmbeddedResource> - <EmbeddedResource Include="icons\status-stop-16~hover%402x.png"> - <LogicalName>status-stop-16~hover@2x.png</LogicalName> - </EmbeddedResource> </ItemGroup> <ItemGroup> <Folder Include="Dialogs\" /> diff --git a/main/src/addins/MacPlatform/MainToolbar/StatusBar.cs b/main/src/addins/MacPlatform/MainToolbar/StatusBar.cs index 55a49565a1..56b5cc2e89 100644 --- a/main/src/addins/MacPlatform/MainToolbar/StatusBar.cs +++ b/main/src/addins/MacPlatform/MainToolbar/StatusBar.cs @@ -340,7 +340,6 @@ namespace MonoDevelop.MacIntegration.MainToolbar class CancelButton : NSButton { readonly NSImage stopIcon = MultiResImage.CreateMultiResImage ("status-stop-16", string.Empty); - readonly NSImage stopIconHover = MultiResImage.CreateMultiResImage ("status-stop-16", "hover"); public CancelButton () { @@ -351,18 +350,6 @@ namespace MonoDevelop.MacIntegration.MainToolbar SetButtonType (NSButtonType.MomentaryChange); AddTrackingArea (new NSTrackingArea (CGRect.Empty, NSTrackingAreaOptions.MouseEnteredAndExited | NSTrackingAreaOptions.ActiveAlways | NSTrackingAreaOptions.InVisibleRect, this, null)); } - - public override void MouseEntered (NSEvent theEvent) - { - Image = stopIconHover; - base.MouseEntered (theEvent); - } - - public override void MouseExited (NSEvent theEvent) - { - Image = stopIcon; - base.MouseExited (theEvent); - } } [Register] diff --git a/main/src/addins/MacPlatform/icons/status-stop-16.png b/main/src/addins/MacPlatform/icons/status-stop-16.png Binary files differindex 39d54d332f..d79fa76388 100644 --- a/main/src/addins/MacPlatform/icons/status-stop-16.png +++ b/main/src/addins/MacPlatform/icons/status-stop-16.png diff --git a/main/src/addins/MacPlatform/icons/status-stop-16@2x.png b/main/src/addins/MacPlatform/icons/status-stop-16@2x.png Binary files differindex 09ac416b54..340f9c2c73 100644 --- a/main/src/addins/MacPlatform/icons/status-stop-16@2x.png +++ b/main/src/addins/MacPlatform/icons/status-stop-16@2x.png diff --git a/main/src/addins/MacPlatform/icons/status-stop-16~dark.png b/main/src/addins/MacPlatform/icons/status-stop-16~dark.png Binary files differindex 2694059347..856dce2905 100644 --- a/main/src/addins/MacPlatform/icons/status-stop-16~dark.png +++ b/main/src/addins/MacPlatform/icons/status-stop-16~dark.png diff --git a/main/src/addins/MacPlatform/icons/status-stop-16~dark@2x.png b/main/src/addins/MacPlatform/icons/status-stop-16~dark@2x.png Binary files differindex a7fd64d271..0c5a12cbe4 100644 --- a/main/src/addins/MacPlatform/icons/status-stop-16~dark@2x.png +++ b/main/src/addins/MacPlatform/icons/status-stop-16~dark@2x.png diff --git a/main/src/addins/MacPlatform/icons/status-stop-16~dark~hover.png b/main/src/addins/MacPlatform/icons/status-stop-16~dark~hover.png Binary files differdeleted file mode 100644 index 856dce2905..0000000000 --- a/main/src/addins/MacPlatform/icons/status-stop-16~dark~hover.png +++ /dev/null diff --git a/main/src/addins/MacPlatform/icons/status-stop-16~dark~hover@2x.png b/main/src/addins/MacPlatform/icons/status-stop-16~dark~hover@2x.png Binary files differdeleted file mode 100644 index 0c5a12cbe4..0000000000 --- a/main/src/addins/MacPlatform/icons/status-stop-16~dark~hover@2x.png +++ /dev/null diff --git a/main/src/addins/MacPlatform/icons/status-stop-16~hover.png b/main/src/addins/MacPlatform/icons/status-stop-16~hover.png Binary files differdeleted file mode 100644 index d79fa76388..0000000000 --- a/main/src/addins/MacPlatform/icons/status-stop-16~hover.png +++ /dev/null diff --git a/main/src/addins/MacPlatform/icons/status-stop-16~hover@2x.png b/main/src/addins/MacPlatform/icons/status-stop-16~hover@2x.png Binary files differdeleted file mode 100644 index 340f9c2c73..0000000000 --- a/main/src/addins/MacPlatform/icons/status-stop-16~hover@2x.png +++ /dev/null diff --git a/main/src/addins/MonoDevelop.ConnectedServices/ConnectedServices.cs b/main/src/addins/MonoDevelop.ConnectedServices/ConnectedServices.cs index 299077c415..8a2553b72f 100644 --- a/main/src/addins/MonoDevelop.ConnectedServices/ConnectedServices.cs +++ b/main/src/addins/MonoDevelop.ConnectedServices/ConnectedServices.cs @@ -15,7 +15,7 @@ namespace MonoDevelop.ConnectedServices /// <summary> /// Defines a set of constants for the Connected Services addin /// </summary> - static class ConnectedServices + public static class ConnectedServices { /// <summary> /// The extension point for service providers @@ -64,8 +64,11 @@ namespace MonoDevelop.ConnectedServices /// <summary> /// Displays the service details tab for the given service in the given project /// </summary> - public static void OpenServicesTab(DotNetProject project, string serviceId = null) + internal static void OpenServicesTab(DotNetProject project, string serviceId) { + if (project == null) + project = IdeApp.ProjectOperations.CurrentSelectedProject as DotNetProject; + ConnectedServicesViewContent servicesView = null; foreach (var view in IdeApp.Workbench.Documents) { @@ -83,6 +86,28 @@ namespace MonoDevelop.ConnectedServices } /// <summary> + /// Displays the service details tab for the given service + /// </summary> + public static Task OpenServicesTab (this IConnectedService service) + { + if (service == null) + throw new ArgumentNullException (nameof (service)); + + return Runtime.RunInMainThread (() => OpenServicesTab (service.Project, service.Id)); + } + + /// <summary> + /// Displays the services gallery tab for the given project + /// </summary> + public static Task OpenServicesTab (this DotNetProject project) + { + if (project == null) + throw new ArgumentNullException (nameof (project)); + + return Runtime.RunInMainThread (() => OpenServicesTab (project, null)); + } + + /// <summary> /// Removes the given service from the given project /// </summary> public static async Task RemoveServiceFromProject (DotNetProject project, string serviceId) diff --git a/main/src/addins/MonoDevelop.ConnectedServices/Gui.ServicesTab/ConnectedServicesViewContent.cs b/main/src/addins/MonoDevelop.ConnectedServices/Gui.ServicesTab/ConnectedServicesViewContent.cs index 380cd58e52..c055184031 100644 --- a/main/src/addins/MonoDevelop.ConnectedServices/Gui.ServicesTab/ConnectedServicesViewContent.cs +++ b/main/src/addins/MonoDevelop.ConnectedServices/Gui.ServicesTab/ConnectedServicesViewContent.cs @@ -51,13 +51,17 @@ namespace MonoDevelop.ConnectedServices.Gui.ServicesTab public void UpdateContent(string serviceId) { var binding = ((DotNetProject)this.Project).GetConnectedServicesBinding (); - if (string.IsNullOrEmpty (serviceId)) { - var services = binding.SupportedServices; - this.widget.ShowGallery (services, Project); - } else { + if (!string.IsNullOrEmpty (serviceId)) { var service = binding.SupportedServices.FirstOrDefault (x => x.Id == serviceId); - this.widget.ShowServiceDetails (service); + if (service != null) { + this.widget.ShowServiceDetails (service); + return; + } + LoggingService.LogError ("Showing service details failed, service id {0} not found", serviceId); } + + var services = binding.SupportedServices; + this.widget.ShowGallery (services, Project); } object currentNodeObject; diff --git a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Tests/MonoDevelop.DotNetCore.Tests.csproj b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Tests/MonoDevelop.DotNetCore.Tests.csproj index 12bb610210..b96ea93eeb 100644 --- a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Tests/MonoDevelop.DotNetCore.Tests.csproj +++ b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Tests/MonoDevelop.DotNetCore.Tests.csproj @@ -39,6 +39,7 @@ <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="MonoDevelop.DotNetCore.Tests\DotNetCoreProjectTests.cs" /> <Compile Include="MonoDevelop.DotNetCore.Tests\DotNetCoreMSBuildProjectTests.cs" /> + <Compile Include="MonoDevelop.DotNetCore.Tests\DotNetCoreSdkVersionTests.cs" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\..\..\..\external\guiunit\src\framework\GuiUnit_NET_4_5.csproj"> diff --git a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Tests/MonoDevelop.DotNetCore.Tests/DotNetCoreSdkVersionTests.cs b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Tests/MonoDevelop.DotNetCore.Tests/DotNetCoreSdkVersionTests.cs new file mode 100644 index 0000000000..18a76492ef --- /dev/null +++ b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.Tests/MonoDevelop.DotNetCore.Tests/DotNetCoreSdkVersionTests.cs @@ -0,0 +1,59 @@ +// +// DotNetCoreSdkVersionTests.cs +// +// Author: +// Matt Ward <matt.ward@xamarin.com> +// +// Copyright (c) 2017 Xamarin Inc. (http://xamarin.com) +// +// 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; + +namespace MonoDevelop.DotNetCore.Tests +{ + [TestFixture] + class DotNetCoreSdkVersionTests + { + [TestCase ("1.0.0-preview5-004460", 4460)] + [TestCase ("1.0.0-preview2-003156", 3156)] + [TestCase ("1.0.0-preview2-1-003177", 3177)] + [TestCase ("1.0.0-rc3-004530", 4530)] + [TestCase ("1.0.0-rc4-4771", 4771)] + public void ValidBuildVersions (string sdkVersion, int expectedBuildVersion) + { + int buildVersion = -1; + bool result = DotNetCoreSdkVersion.TryGetBuildVersion (sdkVersion, out buildVersion); + + Assert.AreEqual (expectedBuildVersion, buildVersion); + Assert.IsTrue (result); + } + + [TestCase ("")] + [TestCase (null)] + [TestCase ("1")] + public void InvalidBuildVersions (string sdkVersion) + { + int buildVersion = -1; + bool result = DotNetCoreSdkVersion.TryGetBuildVersion (sdkVersion, out buildVersion); + + Assert.IsFalse (result); + } + } +} diff --git a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.csproj b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.csproj index 0282c72212..6167fcce8e 100644 --- a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.csproj +++ b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore.csproj @@ -89,6 +89,8 @@ <Compile Include="MonoDevelop.DotNetCore.UnitTesting\IDotNetCoreTestProvider.cs" /> <Compile Include="MonoDevelop.DotNetCore.UnitTesting\IDotNetCoreTestRunner.cs" /> <Compile Include="MonoDevelop.DotNetCore.UnitTesting\TestResultBuilder.cs" /> + <Compile Include="MonoDevelop.DotNetCore\DotNetCoreProjectNodeBuilderExtension.cs" /> + <Compile Include="MonoDevelop.DotNetCore\DotNetCoreSdkVersion.cs" /> </ItemGroup> <ItemGroup> <Folder Include="MonoDevelop.DotNetCore\" /> diff --git a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore/DotNetCoreNotInstalledDialog.cs b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore/DotNetCoreNotInstalledDialog.cs index 7bd5369172..d115295623 100644 --- a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore/DotNetCoreNotInstalledDialog.cs +++ b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore/DotNetCoreNotInstalledDialog.cs @@ -33,6 +33,10 @@ namespace MonoDevelop.DotNetCore { class DotNetCoreNotInstalledDialog : IDisposable { + // TODO: This link needs to be changed. + // public static readonly string DotNetCoreDownloadUrl = "https://aka.ms/vs/mac/install-netcore"; + public static readonly string DotNetCoreDownloadUrl = "https://github.com/dotnet/core/blob/master/release-notes/rc4-download.md"; + GenericMessage message; AlertButton downloadButton; @@ -59,7 +63,7 @@ namespace MonoDevelop.DotNetCore void AlertButtonClicked (object sender, AlertButtonEventArgs e) { if (e.Button == downloadButton) - DesktopService.ShowUrl ("https://aka.ms/vs/mac/install-netcore"); + DesktopService.ShowUrl (DotNetCoreDownloadUrl); } public void Dispose () diff --git a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore/DotNetCoreProjectExtension.cs b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore/DotNetCoreProjectExtension.cs index 4df79acf0e..d567ccfff9 100644 --- a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore/DotNetCoreProjectExtension.cs +++ b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore/DotNetCoreProjectExtension.cs @@ -198,7 +198,7 @@ namespace MonoDevelop.DotNetCore }); } - Task ShowDotNetCoreNotInstalledDialog () + Task ShowDotNetCoreNotInstalledDialog (bool unsupportedSdkVersion) { return Runtime.RunInMainThread (() => { if (ShownDotNetCoreSdkNotInstalledDialogForSolution ()) @@ -207,6 +207,8 @@ namespace MonoDevelop.DotNetCore Project.ParentSolution.ExtendedProperties [ShownDotNetCoreSdkInstalledExtendedPropertyName] = "true"; using (var dialog = new DotNetCoreNotInstalledDialog ()) { + if (unsupportedSdkVersion) + dialog.Message = GettextCatalog.GetString ("The .NET Core SDK installed is not supported. Please install a more recent version."); dialog.Show (); } }); @@ -264,7 +266,7 @@ namespace MonoDevelop.DotNetCore return; if (HasSdk && !sdkPaths.Exist) { - ShowDotNetCoreNotInstalledDialog (); + ShowDotNetCoreNotInstalledDialog (sdkPaths.IsUnsupportedSdkVersion); } } @@ -297,7 +299,7 @@ namespace MonoDevelop.DotNetCore if (ProjectNeedsRestore ()) { return CreateNuGetRestoreRequiredBuildResult (); } else if (HasSdk && !sdkPaths.Exist) { - return CreateDotNetCoreSdkRequiredBuildResult (); + return CreateDotNetCoreSdkRequiredBuildResult (sdkPaths.IsUnsupportedSdkVersion); } return null; } @@ -325,9 +327,17 @@ namespace MonoDevelop.DotNetCore return result; } - BuildResult CreateDotNetCoreSdkRequiredBuildResult () + BuildResult CreateDotNetCoreSdkRequiredBuildResult (bool isUnsupportedVersion) { - return CreateBuildError (GettextCatalog.GetString (".NET Core SDK is not installed. This is required to build .NET Core projects. https://aka.ms/vs/mac/install-netcore")); + return CreateBuildError (GetDotNetCoreSdkRequiredBuildErrorMessage (isUnsupportedVersion)); + } + + static string GetDotNetCoreSdkRequiredBuildErrorMessage (bool isUnsupportedVersion) + { + if (isUnsupportedVersion) + return GettextCatalog.GetString ("The .NET Core SDK installed is not supported. Please install a more recent version. {0}", DotNetCoreNotInstalledDialog.DotNetCoreDownloadUrl); + + return GettextCatalog.GetString (".NET Core SDK is not installed. This is required to build .NET Core projects. {0}", DotNetCoreNotInstalledDialog.DotNetCoreDownloadUrl); } protected override void OnBeginLoad () @@ -418,5 +428,19 @@ namespace MonoDevelop.DotNetCore Runtime.AssertMainThread (); RestorePackagesInProjectHandler.Run (Project); } + + public bool IsDotNetCoreSdkInstalled () + { + if (sdkPaths != null) + return sdkPaths.Exist; + return true; + } + + public bool IsUnsupportedDotNetCoreSdkInstalled () + { + if (sdkPaths != null) + return sdkPaths.IsUnsupportedSdkVersion; + return false; + } } } diff --git a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore/DotNetCoreProjectNodeBuilderExtension.cs b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore/DotNetCoreProjectNodeBuilderExtension.cs new file mode 100644 index 0000000000..2dcb4802f9 --- /dev/null +++ b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore/DotNetCoreProjectNodeBuilderExtension.cs @@ -0,0 +1,66 @@ +// +// DotNetCoreProjectNodeBuilderExtension.cs +// +// Author: +// Matt Ward <matt.ward@xamarin.com> +// +// Copyright (c) 2017 Xamarin Inc. (http://xamarin.com) +// +// 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 System; +using MonoDevelop.Core; +using MonoDevelop.Ide.Gui.Components; +using MonoDevelop.Ide.Tasks; +using MonoDevelop.Projects; + +namespace MonoDevelop.DotNetCore +{ + class DotNetCoreProjectNodeBuilderExtension : NodeBuilderExtension + { + public override bool CanBuildNode (Type dataType) + { + return typeof (DotNetProject).IsAssignableFrom (dataType); + } + + public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, NodeInfo nodeInfo) + { + var project = dataObject as DotNetProject; + if (project == null) + return; + + var dotNetCoreProject = project.GetFlavor<DotNetCoreProjectExtension> (); + if (dotNetCoreProject == null) + return; + + if (dotNetCoreProject.HasSdk && !dotNetCoreProject.IsDotNetCoreSdkInstalled ()) { + nodeInfo.StatusSeverity = TaskSeverity.Error; + nodeInfo.StatusMessage = GetMessage (dotNetCoreProject); + } + } + + string GetMessage (DotNetCoreProjectExtension dotNetCoreProject) + { + if (dotNetCoreProject.IsUnsupportedDotNetCoreSdkInstalled ()) + return GettextCatalog.GetString ("The .NET Core SDK installed is not supported. Please install a more recent version. {0}", DotNetCoreNotInstalledDialog.DotNetCoreDownloadUrl); + + return GettextCatalog.GetString (".NET Core SDK is not installed. This is required to build .NET Core projects. {0}", DotNetCoreNotInstalledDialog.DotNetCoreDownloadUrl); + } + } +} diff --git a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore/DotNetCoreSdkPaths.cs b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore/DotNetCoreSdkPaths.cs index 38f96b8523..2237d16c79 100644 --- a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore/DotNetCoreSdkPaths.cs +++ b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore/DotNetCoreSdkPaths.cs @@ -27,6 +27,7 @@ using System; using System.IO; using System.Linq; +using MonoDevelop.Core; namespace MonoDevelop.DotNetCore { @@ -59,11 +60,40 @@ namespace MonoDevelop.DotNetCore ProjectImportTargets = Path.Combine (sdkMSBuildTargetsDirectory, "Sdk.targets"); Exist = File.Exists (ProjectImportProps) && File.Exists (ProjectImportTargets); + + if (Exist) { + CheckIsSupportedSdkVersion (sdkDirectory); + Exist = !IsUnsupportedSdkVersion; + } else { + IsUnsupportedSdkVersion = true; + } } + public bool IsUnsupportedSdkVersion { get; private set; } public bool Exist { get; private set; } public string ProjectImportProps { get; private set; } public string ProjectImportTargets { get; private set; } public string MSBuildSDKsPath { get; private set; } + + /// <summary> + /// .NET Core SDK version needs to be at least 1.0.0-preview5-004460 + /// </summary> + void CheckIsSupportedSdkVersion (string sdkDirectory) + { + try { + string sdkVersion = Path.GetFileName (sdkDirectory); + int buildVersion = -1; + if (DotNetCoreSdkVersion.TryGetBuildVersion (sdkVersion, out buildVersion)) { + if (buildVersion < DotNetCoreSdkVersion.MinimumSupportedBuildVersion) { + IsUnsupportedSdkVersion = true; + LoggingService.LogInfo ("Unsupported .NET Core SDK version installed '{0}'. Require at least 1.0.0-preview5-004460. '{1}'", sdkVersion, sdkDirectory); + } + } else { + LoggingService.LogWarning ("Unable to get version information for .NET Core SDK. '{0}'", sdkDirectory); + } + } catch (Exception ex) { + LoggingService.LogError ("Error checking sdk version.", ex); + } + } } } diff --git a/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore/DotNetCoreSdkVersion.cs b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore/DotNetCoreSdkVersion.cs new file mode 100644 index 0000000000..ab6bdbb2cb --- /dev/null +++ b/main/src/addins/MonoDevelop.DotNetCore/MonoDevelop.DotNetCore/DotNetCoreSdkVersion.cs @@ -0,0 +1,48 @@ +// +// DotNetCoreSdkVersion.cs +// +// Author: +// Matt Ward <matt.ward@xamarin.com> +// +// Copyright (c) 2017 Xamarin Inc. (http://xamarin.com) +// +// 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. + +namespace MonoDevelop.DotNetCore +{ + class DotNetCoreSdkVersion + { + public const int MinimumSupportedBuildVersion = 4460; + + public static bool TryGetBuildVersion (string sdkVersion, out int build) + { + build = -1; + + if (string.IsNullOrEmpty (sdkVersion)) + return false; + + int index = sdkVersion.LastIndexOf ('-'); + if (index < 0) + return false; + + string buildVersionText = sdkVersion.Substring (index + 1); + return int.TryParse (buildVersionText, out build); + } + } +} diff --git a/main/src/addins/MonoDevelop.DotNetCore/Properties/MonoDevelop.DotNetCore.addin.xml b/main/src/addins/MonoDevelop.DotNetCore/Properties/MonoDevelop.DotNetCore.addin.xml index 44b921faf4..0f53e08693 100644 --- a/main/src/addins/MonoDevelop.DotNetCore/Properties/MonoDevelop.DotNetCore.addin.xml +++ b/main/src/addins/MonoDevelop.DotNetCore/Properties/MonoDevelop.DotNetCore.addin.xml @@ -48,4 +48,8 @@ <Extension path="/MonoDevelop/UnitTesting/TestProviders"> <Class id="DnxTestProvider" class="MonoDevelop.DotNetCore.UnitTesting.DotNetCoreTestProvider" /> </Extension> + + <Extension path="/MonoDevelop/Ide/Pads/ProjectPad"> + <NodeBuilder class="MonoDevelop.DotNetCore.DotNetCoreProjectNodeBuilderExtension" /> + </Extension> </ExtensionModel>
\ No newline at end of file diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeRefactoringDescriptor.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeRefactoringDescriptor.cs index aa46055a1f..391f874721 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeRefactoringDescriptor.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeRefactoringDescriptor.cs @@ -60,16 +60,25 @@ namespace MonoDevelop.CodeActions /// </summary> public string Language { get { return attr.Languages.FirstOrDefault (); } } + string codeActionsProperty; + string CodeActionsProperty { + get { + if (codeActionsProperty == null) { + codeActionsProperty = "CodeActions." + Language + "." + IdString; + } + return codeActionsProperty; + } + } /// <summary> /// Gets or sets a value indicating whether this code action is enabled by the user. /// </summary> /// <value><c>true</c> if this code action is enabled; otherwise, <c>false</c>.</value> public bool IsEnabled { get { - return PropertyService.Get ("CodeActions." + Language + "." + IdString, true); + return PropertyService.Get (CodeActionsProperty, true); } set { - PropertyService.Set ("CodeActions." + Language + "." + IdString, value); + PropertyService.Set (CodeActionsProperty, value); } } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/FoldingScreenbackgroundRenderer.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/FoldingScreenbackgroundRenderer.cs index 236eee56cf..e986e86257 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/FoldingScreenbackgroundRenderer.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/FoldingScreenbackgroundRenderer.cs @@ -127,7 +127,7 @@ namespace Mono.TextEditor double rectangleWidth = 0, rectangleHeight = 0; lineLayout = textViewMargin.CreateLinePartLayout (segmentStartLine, segmentStartLine.Offset, segmentStartLine.Length, -1, -1); - var rectangleStart = lineLayout.Layout.IndexToPos (GetFirstNonWsIdx (lineLayout.Layout.Text)); + var rectangleStart = lineLayout.IndexToPos (GetFirstNonWsIdx (lineLayout.Text)); if (lineLayout.IsUncached) lineLayout.Dispose (); @@ -135,7 +135,7 @@ namespace Mono.TextEditor lineLayout = textViewMargin.CreateLinePartLayout (segmentEndLine, segmentEndLine.Offset, segmentEndLine.Length, -1, -1); - var rectangleEnd = lineLayout.Layout.IndexToPos (GetFirstNonWsIdx (lineLayout.Layout.Text)); + var rectangleEnd = lineLayout.IndexToPos (GetFirstNonWsIdx (lineLayout.Text)); if (lineLayout.IsUncached) lineLayout.Dispose (); diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs index b0a8cb44c0..8817365133 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextArea.cs @@ -2620,14 +2620,14 @@ namespace Mono.TextEditor int l, x1, x2; int index = Result.Offset - line.Offset - 1; if (index >= 0) { - lineLayout.Layout.IndexToLineX (index, true, out l, out x1); + lineLayout.IndexToLineX (index, true, out l, out x1); } else { l = x1 = 0; } index = Result.Offset - line.Offset - 1 + Result.Length; if (index >= 0) { - lineLayout.Layout.IndexToLineX (index, true, out l, out x2); + lineLayout.IndexToLineX (index, true, out l, out x2); } else { x2 = 0; Console.WriteLine ("Invalid end index :" + index); diff --git a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs index 024c3cb082..e3c3d7f3f9 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/Mono.TextEditor/Gui/TextViewMargin.cs @@ -58,6 +58,7 @@ namespace Mono.TextEditor Pango.Rectangle[] eolMarkerLayoutRect; internal double charWidth; + bool isMonospacedFont; double LineHeight { get { @@ -399,7 +400,13 @@ namespace Mono.TextEditor this.textEditor.GetTextEditorData ().LineHeight = System.Math.Ceiling (0.5 + (metrics.Ascent + metrics.Descent) / Pango.Scale.PangoScale); this.charWidth = metrics.ApproximateCharWidth / Pango.Scale.PangoScale; } - + var family = textEditor.PangoContext.Families.FirstOrDefault (f => f.Name == textEditor.Options.Font.Family); + if (family != null) { + isMonospacedFont = family.IsMonospace; + } else { + isMonospacedFont = false; + } + // Gutter font may be bigger using (var metrics = textEditor.PangoContext.GetMetrics (textEditor.Options.GutterFont, textEditor.PangoContext.Language)) { this.textEditor.GetTextEditorData ().LineHeight = System.Math.Max (this.textEditor.GetTextEditorData ().LineHeight, System.Math.Ceiling (0.5 + (metrics.Ascent + metrics.Descent) / Pango.Scale.PangoScale)); @@ -801,7 +808,7 @@ namespace Mono.TextEditor descriptor.Dispose (); layoutDict.Remove (line); } - var wrapper = new LayoutWrapper (textEditor.LayoutCache.RequestLayout ()); + var wrapper = new LayoutWrapper (this, textEditor.LayoutCache.RequestLayout ()); wrapper.IsUncached = containsPreedit; if (logicalRulerColumn < 0) logicalRulerColumn = line.GetLogicalColumn (textEditor.GetTextEditorData (), textEditor.Options.RulerColumn); @@ -962,28 +969,47 @@ namespace Mono.TextEditor atts.InsertOffsetList (textEditor.preeditAttrs, si, ei); } wrapper.LineChars = lineChars; - wrapper.Layout.SetText (lineText); + wrapper.Text = lineText; wrapper.IndentSize = 0; var tabSize = textEditor.Options != null ? textEditor.Options.TabSize : 4; - for (int i = 0; i < lineChars.Length; i++) { + int i = 0, lineWidth; + for (; i < lineChars.Length; i++) { char ch = lineChars [i]; if (ch == ' ') { wrapper.IndentSize++; } else if (ch == '\t') { - wrapper.IndentSize = GetNextTabstop (textEditor.GetTextEditorData (), wrapper.IndentSize, tabSize); + wrapper.IndentSize = GetNextTabstop (textEditor.GetTextEditorData (), wrapper.IndentSize + 1, tabSize) - 1; } else { break; } } + lineWidth = wrapper.IndentSize; + bool isFastPathPossible = isMonospacedFont; + if (isFastPathPossible) { + for (; i < lineChars.Length; i++) { + char ch = lineChars [i]; + if (ch == '\t') { + lineWidth = GetNextTabstop (textEditor.GetTextEditorData (), lineWidth + 1, tabSize) - 1; + } else { + if (ch > 255) { + // for non ASCII chars always fall back to pango. + isFastPathPossible = false; + break; + } + lineWidth++; + } + } + isFastPathPossible &= ((int)wrapper.Width) == (int)(lineWidth * charWidth); + } var nextLine = line.NextLine; atts.AssignTo (wrapper.Layout); atts.Dispose (); int w, h; - wrapper.Layout.GetSize (out w, out h); + wrapper.GetSize (out w, out h); wrapper.Width = System.Math.Floor (w / Pango.Scale.PangoScale); wrapper.Height = System.Math.Floor (h / Pango.Scale.PangoScale); - + wrapper.FastPath = isFastPathPossible; var lines = wrapper.Layout.LineCount; if (lines == 1) { @@ -1011,6 +1037,11 @@ namespace Mono.TextEditor } } + internal void GetSize (out int w, out int h) + { + throw new NotImplementedException (); + } + void OnLineShown (DocumentLine line) { LineShown?.Invoke (this, new LineEventArgs (line)); @@ -1198,6 +1229,8 @@ namespace Mono.TextEditor public class LayoutWrapper : IDisposable { + readonly TextViewMargin parent; + public int IndentSize { get; set; @@ -1205,7 +1238,7 @@ namespace Mono.TextEditor public LayoutCache.LayoutProxy Layout { get; - private set; + set; } public bool IsUncached { @@ -1223,6 +1256,15 @@ namespace Mono.TextEditor set; } + public string Text { + get { + return Layout.Text; + } + set { + Layout.SetText (value); + } + } + public char[] LineChars { get; set; @@ -1260,8 +1302,9 @@ namespace Mono.TextEditor set; } - public LayoutWrapper (LayoutCache.LayoutProxy layout) + public LayoutWrapper (TextViewMargin parent, LayoutCache.LayoutProxy layout) { + this.parent = parent; this.Layout = layout; this.IsUncached = false; } @@ -1307,6 +1350,48 @@ namespace Mono.TextEditor { return TextViewMargin.TranslateToUTF8Index (LineChars, textIndex, ref curIndex, ref byteIndex); } + + public bool FastPath { get; internal set; } + + public Pango.Rectangle IndexToPos (int index) + { + return Layout.IndexToPos (index); + } + + public void GetSize (out int width, out int height) + { + if (FastPath) { + width = (int)(Pango.Scale.PangoScale * LineChars.Length * parent.charWidth); + height = (int)(Pango.Scale.PangoScale * parent.LineHeight); + return; + } + Layout.GetSize (out width, out height); + } + + public void GetPixelSize (out int width, out int height) + { + if (FastPath) { + width = (int)(LineChars.Length * parent.charWidth); + height = (int)(parent.LineHeight); + return; + } + Layout.GetPixelSize (out width, out height); + } + + public void IndexToLineX (int index, bool trailing, out int line, out int xPos) + { + Layout.IndexToLineX (index, trailing, out line, out xPos); + } + + public bool XyToIndex (int x, int y, out int index, out int trailing) + { + return Layout.XyToIndex (x, y, out index, out trailing); + } + + public void GetCursorPos (int index, out Pango.Rectangle strong_pos, out Pango.Rectangle weak_pos) + { + Layout.GetCursorPos (index, out strong_pos, out weak_pos); + } } HslColor? selectionColor; @@ -1358,7 +1443,7 @@ namespace Mono.TextEditor //Get 1st visible character index from left based on HAdjustment int index, trailing; - layout.Layout.XyToIndex ((int)textEditor.HAdjustment.Value, 0, out index, out trailing); + layout.XyToIndex ((int)textEditor.HAdjustment.Value, 0, out index, out trailing); double ypos; if (spaceOrTab == ' ') { @@ -1392,12 +1477,12 @@ namespace Mono.TextEditor if (lastIndex == i) { posX = lastPosX; } else { - layout.Layout.IndexToLineX ((int)TranslateToUTF8Index (chars, (uint)i, ref curIndex, ref byteIndex), false, out line, out posX); + layout.IndexToLineX ((int)TranslateToUTF8Index (chars, (uint)i, ref curIndex, ref byteIndex), false, out line, out posX); } double xpos = x + posX / Pango.Scale.PangoScale; if (xpos > textEditorWidth) break; - layout.Layout.IndexToLineX ((int)TranslateToUTF8Index (chars, (uint)i + 1, ref curIndex, ref byteIndex), false, out line, out posX); + layout.IndexToLineX ((int)TranslateToUTF8Index (chars, (uint)i + 1, ref curIndex, ref byteIndex), false, out line, out posX); lastPosX = posX; lastIndex = i + 1; double xpos2 = x + posX / Pango.Scale.PangoScale; @@ -1527,13 +1612,13 @@ namespace Mono.TextEditor // predit layout already contains virtual space. if (!string.IsNullOrEmpty (textEditor.preeditString)) virtualSpace = ""; - LayoutWrapper wrapper = new LayoutWrapper (textEditor.LayoutCache.RequestLayout ()); + LayoutWrapper wrapper = new LayoutWrapper (this, textEditor.LayoutCache.RequestLayout ()); wrapper.LineChars = virtualSpace.ToCharArray (); - wrapper.Layout.SetText (virtualSpace); + wrapper.Text = virtualSpace; wrapper.Layout.Tabs = tabArray; wrapper.Layout.FontDescription = textEditor.Options.Font; int vy, vx; - wrapper.Layout.GetSize (out vx, out vy); + wrapper.GetSize (out vx, out vy); wrapper.Width = wrapper.LastLineWidth = vx / Pango.Scale.PangoScale; return wrapper; } @@ -1562,8 +1647,8 @@ namespace Mono.TextEditor if (BackgroundRenderer == null) { foreach (var bg in layout.BackgroundColors) { int x1, x2; - x1 = layout.Layout.IndexToPos (bg.FromIdx).X; - x2 = layout.Layout.IndexToPos (bg.ToIdx).X; + x1 = layout.IndexToPos (bg.FromIdx).X; + x2 = layout.IndexToPos (bg.ToIdx).X; DrawRectangleWithRuler ( cr, xPos + textEditor.HAdjustment.Value - TextStartPosition, new Cairo.Rectangle (x1 / Pango.Scale.PangoScale + position, y, (x2 - x1) / Pango.Scale.PangoScale + 1, _lineHeight), @@ -1616,11 +1701,11 @@ namespace Mono.TextEditor double endX; int endY; if (selectionStartOffset != offset + length) { - var start = layout.Layout.IndexToPos (layout.SelectionStartIndex); + var start = layout.IndexToPos (layout.SelectionStartIndex); startX = System.Math.Floor (start.X / Pango.Scale.PangoScale); startY = (int)(y + System.Math.Floor (start.Y / Pango.Scale.PangoScale)); - var end = layout.Layout.IndexToPos (layout.SelectionEndIndex); + var end = layout.IndexToPos (layout.SelectionEndIndex); endX = System.Math.Ceiling (end.X / Pango.Scale.PangoScale); endY = (int)(y + System.Math.Ceiling (end.Y / Pango.Scale.PangoScale)); } else { @@ -1684,8 +1769,8 @@ namespace Mono.TextEditor uint endTranslated = TranslateToUTF8Index (layout.LineChars, endIndex, ref curIndex, ref byteIndex); int l, x1, x2; - layout.Layout.IndexToLineX ((int)startTranslated, false, out l, out x1); - layout.Layout.IndexToLineX ((int)endTranslated, false, out l, out x2); + layout.IndexToLineX ((int)startTranslated, false, out l, out x1); + layout.IndexToLineX ((int)endTranslated, false, out l, out x2); int w = (int)System.Math.Ceiling ((x2 - x1) / Pango.Scale.PangoScale); int s = (int)System.Math.Floor (x1 / Pango.Scale.PangoScale + x); double corner = System.Math.Min (4, width) * textEditor.Options.Zoom; @@ -1773,7 +1858,7 @@ namespace Mono.TextEditor Pango.Rectangle strong_pos, weak_pos; curIndex = byteIndex = 0; int utf8ByteIndex = (int)TranslateToUTF8Index (layout.LineChars, (uint)index, ref curIndex, ref byteIndex); - layout.Layout.GetCursorPos (utf8ByteIndex, out strong_pos, out weak_pos); + layout.GetCursorPos (utf8ByteIndex, out strong_pos, out weak_pos); var cx = xPos + (strong_pos.X / Pango.Scale.PangoScale); var cy = y + (strong_pos.Y / Pango.Scale.PangoScale); if (textEditor.preeditCursorCharIndex == 0) { @@ -1781,7 +1866,7 @@ namespace Mono.TextEditor } else { var preeditIndex = (uint)(index + textEditor.preeditCursorCharIndex); utf8ByteIndex = (int)TranslateToUTF8Index (layout.LineChars, preeditIndex, ref curIndex, ref byteIndex); - layout.Layout.GetCursorPos (utf8ByteIndex, out strong_pos, out weak_pos); + layout.GetCursorPos (utf8ByteIndex, out strong_pos, out weak_pos); var pcx = xPos + (strong_pos.X / Pango.Scale.PangoScale); var pcy = y + (strong_pos.Y / Pango.Scale.PangoScale); SetVisibleCaretPosition (pcx, pcy, cx, cy); @@ -1983,10 +2068,10 @@ namespace Mono.TextEditor // folding marker int lineNr = args.LineNumber; foreach (var shownFolding in GetFoldRectangles (lineNr)) { - if (shownFolding.Item1.Contains ((int)(args.X + this.XOffset), (int)args.Y)) {
- shownFolding.Item2.IsCollapsed = false; - textEditor.Document.InformFoldChanged(new FoldSegmentEventArgs(shownFolding.Item2));
- return; + if (shownFolding.Key.Contains ((int)(args.X + this.XOffset), (int)args.Y)) { + shownFolding.Value.IsCollapsed = false; + textEditor.Document.InformFoldChanged (new FoldSegmentEventArgs (shownFolding.Value));
+ return; } } return; @@ -2332,8 +2417,8 @@ namespace Mono.TextEditor // folding marker int lineNr = args.LineNumber; foreach (var shownFolding in GetFoldRectangles (lineNr)) { - if (shownFolding.Item1.Contains ((int)(args.X + this.XOffset), (int)args.Y)) { - ShowTooltip (shownFolding.Item2.Segment, shownFolding.Item1); + if (shownFolding.Key.Contains ((int)(args.X + this.XOffset), (int)args.Y)) { + ShowTooltip (shownFolding.Value.Segment, shownFolding.Key); return; } } @@ -2505,7 +2590,7 @@ namespace Mono.TextEditor cr.Fill (); } - IEnumerable<Tuple<Gdk.Rectangle, FoldSegment>> GetFoldRectangles (int lineNr) + IEnumerable<KeyValuePair<Gdk.Rectangle, FoldSegment>> GetFoldRectangles (int lineNr) { if (lineNr < 0) yield break; @@ -2550,7 +2635,7 @@ namespace Mono.TextEditor var pixelWidth = width / Pango.Scale.PangoScale + foldXMargin * 2; var foldingRectangle = new Rectangle ((int)xPos, y, (int)pixelWidth, (int)LineHeight - 1); - yield return Tuple.Create (foldingRectangle, folding); + yield return new KeyValuePair<Rectangle, FoldSegment> (foldingRectangle, folding); xPos += pixelWidth; if (folding.GetEndLine (textEditor.Document) != line) { line = folding.GetEndLine (textEditor.Document); @@ -2987,14 +3072,14 @@ namespace Mono.TextEditor bool ConsumeLayout (LayoutWrapper layoutWrapper, int xp, int yp) { int trailing; - bool isInside = layoutWrapper.Layout.XyToIndex (xp, yp, out index, out trailing); + bool isInside = layoutWrapper.XyToIndex (xp, yp, out index, out trailing); if (isInside) { int lineNr; int xp1, xp2; - layoutWrapper.Layout.IndexToLineX (index, false, out lineNr, out xp1); - layoutWrapper.Layout.IndexToLineX (index + 1, false, out lineNr, out xp2); - index = TranslateIndexToUTF8 (layoutWrapper.Layout.Text, index); + layoutWrapper.IndexToLineX (index, false, out lineNr, out xp1); + layoutWrapper.IndexToLineX (index + 1, false, out lineNr, out xp2); + index = TranslateIndexToUTF8 (layoutWrapper.Text, index); if (snapCharacters && !IsNearX1 (xp, xp1, xp2)) index++; @@ -3046,7 +3131,7 @@ namespace Mono.TextEditor done |= ConsumeLayout (layoutWrapper, (int)(xp - xPos), (int)(yp - yPos)); if (done) break; - layoutWrapper.Layout.GetPixelSize (out width, out height); + layoutWrapper.GetPixelSize (out width, out height); } finally { if (layoutWrapper.IsUncached) layoutWrapper.Dispose (); @@ -3171,7 +3256,7 @@ namespace Mono.TextEditor Pango.Rectangle pos; try { index = (int)TranslateToUTF8Index (wrapper.LineChars, (uint)System.Math.Min (System.Math.Max (0, column), wrapper.LineChars.Length), ref curIndex, ref byteIndex); - pos = wrapper.Layout.IndexToPos (index); + pos = wrapper.IndexToPos (index); } catch { return 0; } finally { diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs index 9e272d79ed..9d5c65c262 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs @@ -649,9 +649,9 @@ namespace MonoDevelop.SourceEditor double endX; if (metrics.SelectionStart != metrics.TextEndOffset) { - var start = metrics.Layout.Layout.IndexToPos ((int)metrics.Layout.SelectionStartIndex); + var start = metrics.Layout.IndexToPos ((int)metrics.Layout.SelectionStartIndex); startX = (int)(start.X / Pango.Scale.PangoScale); - var end = metrics.Layout.Layout.IndexToPos ((int)metrics.Layout.SelectionEndIndex); + var end = metrics.Layout.IndexToPos ((int)metrics.Layout.SelectionEndIndex); endX = (int)(end.X / Pango.Scale.PangoScale); } else { startX = x2; @@ -712,7 +712,7 @@ namespace MonoDevelop.SourceEditor if (column >= metrics.Layout.LineChars.Length) continue; int index = (int)metrics.Layout.TranslateToUTF8Index (column, ref curIndex, ref byteIndex); - var pos = metrics.Layout.Layout.IndexToPos (index); + var pos = metrics.Layout.IndexToPos (index); var co = o + task.Column - 1; g.SetSourceColor (GetMarkerColor (false, metrics.SelectionStart <= co && co < metrics.SelectionEnd)); g.MoveTo ( diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SearchInSelectionMarker.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SearchInSelectionMarker.cs index 2f7926586f..270180388c 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SearchInSelectionMarker.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SearchInSelectionMarker.cs @@ -32,12 +32,12 @@ namespace MonoDevelop.SourceEditor uint curIndex = 0, byteIndex = 0; TextViewMargin.TranslateToUTF8Index (metrics.Layout.LineChars, (uint)(start - startOffset), ref curIndex, ref byteIndex); - int x_pos = metrics.Layout.Layout.IndexToPos ((int)byteIndex).X; + int x_pos = metrics.Layout.IndexToPos ((int)byteIndex).X; @from = startXPos + (int)(x_pos / Pango.Scale.PangoScale); TextViewMargin.TranslateToUTF8Index (metrics.Layout.LineChars, (uint)(end - startOffset), ref curIndex, ref byteIndex); - x_pos = metrics.Layout.Layout.IndexToPos ((int)byteIndex).X; + x_pos = metrics.Layout.IndexToPos ((int)byteIndex).X; to = startXPos + (int)(x_pos / Pango.Scale.PangoScale); } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs index 57d5443ecc..3e4e78cbe2 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs @@ -429,7 +429,7 @@ namespace MonoDevelop.SourceEditor int lw, lh; var tmpWrapper = widget.TextEditor.TextViewMargin.GetLayout (line); - tmpWrapper.Layout.GetPixelSize (out lw, out lh); + tmpWrapper.GetPixelSize (out lw, out lh); if (tmpWrapper.IsUncached) tmpWrapper.Dispose (); lh = (int) TextEditor.TextViewMargin.GetLineHeight (widgetExtension.Line); @@ -1197,7 +1197,7 @@ namespace MonoDevelop.SourceEditor w.OffsetY = (int)widget.TextEditor.LineToY (w.Line); int lw, lh; var tmpWrapper = widget.TextEditor.TextViewMargin.GetLayout (line); - tmpWrapper.Layout.GetPixelSize (out lw, out lh); + tmpWrapper.GetPixelSize (out lw, out lh); if (tmpWrapper.IsUncached) tmpWrapper.Dispose (); w.OffsetX = (int)widget.TextEditor.TextViewMargin.XOffset + lw + 4; @@ -3125,12 +3125,12 @@ namespace MonoDevelop.SourceEditor uint curIndex = 0, byteIndex = 0; TextViewMargin.TranslateToUTF8Index (metrics.Layout.LineChars, (uint)Math.Min (start - startOffset, metrics.Layout.LineChars.Length), ref curIndex, ref byteIndex); - int x_pos = metrics.Layout.Layout.IndexToPos ((int)byteIndex).X; + int x_pos = metrics.Layout.IndexToPos ((int)byteIndex).X; fromX = startXPos + (int)(x_pos / Pango.Scale.PangoScale); TextViewMargin.TranslateToUTF8Index (metrics.Layout.LineChars, (uint)Math.Min (end - startOffset, metrics.Layout.LineChars.Length), ref curIndex, ref byteIndex); - x_pos = metrics.Layout.Layout.IndexToPos ((int)byteIndex).X; + x_pos = metrics.Layout.IndexToPos ((int)byteIndex).X; toX = startXPos + (int)(x_pos / Pango.Scale.PangoScale); } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/DebugTextMarker.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/DebugTextMarker.cs index 8770bf7678..1212a48640 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/DebugTextMarker.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/DebugTextMarker.cs @@ -122,12 +122,12 @@ namespace MonoDevelop.SourceEditor uint curIndex = 0, byteIndex = 0; TextViewMargin.TranslateToUTF8Index (metrics.Layout.LineChars, (uint)(start - startOffset), ref curIndex, ref byteIndex); - int x_pos = metrics.Layout.Layout.IndexToPos ((int)byteIndex).X; + int x_pos = metrics.Layout.IndexToPos ((int)byteIndex).X; @from = startXPos + (int)(x_pos / Pango.Scale.PangoScale); TextViewMargin.TranslateToUTF8Index (metrics.Layout.LineChars, (uint)(end - startOffset), ref curIndex, ref byteIndex); - x_pos = metrics.Layout.Layout.IndexToPos ((int)byteIndex).X; + x_pos = metrics.Layout.IndexToPos ((int)byteIndex).X; to = startXPos + (int)(x_pos / Pango.Scale.PangoScale); } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/UsageSegmentMarker.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/UsageSegmentMarker.cs index a1850c966e..359378a7c2 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/UsageSegmentMarker.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/UsageSegmentMarker.cs @@ -66,12 +66,12 @@ namespace MonoDevelop.SourceEditor uint curIndex = 0, byteIndex = 0; TextViewMargin.TranslateToUTF8Index (metrics.Layout.LineChars, (uint)(start - startOffset), ref curIndex, ref byteIndex); - int x_pos = metrics.Layout.Layout.IndexToPos ((int)byteIndex).X; + int x_pos = metrics.Layout.IndexToPos ((int)byteIndex).X; @from = startXPos + (int)(x_pos / Pango.Scale.PangoScale); TextViewMargin.TranslateToUTF8Index (metrics.Layout.LineChars, (uint)(end - startOffset), ref curIndex, ref byteIndex); - x_pos = metrics.Layout.Layout.IndexToPos ((int)byteIndex).X; + x_pos = metrics.Layout.IndexToPos ((int)byteIndex).X; to = startXPos + (int)(x_pos / Pango.Scale.PangoScale); } diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/WavedLineMarker.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/WavedLineMarker.cs index b301a36c7c..843713c7a6 100644 --- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/WavedLineMarker.cs +++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/TextMarker/WavedLineMarker.cs @@ -69,7 +69,7 @@ namespace MonoDevelop.SourceEditor drawTo = endXPos; var line = editor.GetLineByOffset (startOffset); int offset = line.GetIndentation (editor.Document).Length; - drawFrom = startXPos + (layout.Layout.Layout.IndexToPos (offset).X / Pango.Scale.PangoScale); + drawFrom = startXPos + (layout.Layout.IndexToPos (offset).X / Pango.Scale.PangoScale); } else { int start; if (startOffset < markerStart) { @@ -82,9 +82,9 @@ namespace MonoDevelop.SourceEditor int end = endOffset < markerEnd ? endOffset : markerEnd; int x_pos; - x_pos = layout.Layout.Layout.IndexToPos (start - startOffset).X; + x_pos = layout.Layout.IndexToPos (start - startOffset).X; drawFrom = startXPos + (int)(x_pos / Pango.Scale.PangoScale); - x_pos = layout.Layout.Layout.IndexToPos (end - startOffset).X; + x_pos = layout.Layout.IndexToPos (end - startOffset).X; drawTo = startXPos + (int)(x_pos / Pango.Scale.PangoScale); } diff --git a/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor.Utils/ImmutableText.cs b/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor.Utils/ImmutableText.cs index d31db43232..c9a55acaf6 100644 --- a/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor.Utils/ImmutableText.cs +++ b/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor.Utils/ImmutableText.cs @@ -328,10 +328,11 @@ namespace Mono.TextEditor.Utils WriteTextTo (output, 0, Length); } - public void WriteTextTo (TextWriter output, int index, int count) + public void WriteTextTo (TextWriter output, int start, int count) { - while (index < index + count) { - output.Write (this [index]); + int index = 0; + while (index < count) { + output.Write (this [start + index]); index++; } } diff --git a/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/InsertionCursorEditMode.cs b/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/InsertionCursorEditMode.cs index 40243930bd..f8210b9f70 100644 --- a/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/InsertionCursorEditMode.cs +++ b/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/InsertionCursorEditMode.cs @@ -337,7 +337,7 @@ namespace Mono.TextEditor int l = 0, tmp; if (lineAbove != null) { var wrapper = editor.TextViewMargin.GetLayout (lineAbove); - wrapper.Layout.IndexToLineX (lineAbove.GetIndentation (editor.Document).Length, true, out l, out tmp); + wrapper.IndexToLineX (lineAbove.GetIndentation (editor.Document).Length, true, out l, out tmp); aboveStart = tmp / Pango.Scale.PangoScale; //aboveEnd = wrapper.PangoWidth / Pango.Scale.PangoScale; @@ -346,7 +346,7 @@ namespace Mono.TextEditor } if (lineBelow != null) { var wrapper = editor.TextViewMargin.GetLayout (lineBelow); - wrapper.Layout.IndexToLineX (lineBelow.GetIndentation (editor.Document).Length, true, out l, out tmp); + wrapper.IndexToLineX (lineBelow.GetIndentation (editor.Document).Length, true, out l, out tmp); belowStart = tmp / Pango.Scale.PangoScale; //belowEnd = wrapper.PangoWidth / Pango.Scale.PangoScale; diff --git a/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/TextLinkEditMode.cs b/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/TextLinkEditMode.cs index 38bdea06ce..6322195ffd 100644 --- a/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/TextLinkEditMode.cs +++ b/main/src/core/Mono.TextEditor.Shared/Mono.TextEditor/TextLinkEditMode.cs @@ -562,8 +562,8 @@ namespace Mono.TextEditor int strOffset = BaseOffset + segment.Offset - metrics.TextStartOffset; int strEndOffset = BaseOffset + segment.EndOffset - metrics.TextStartOffset; - int x_pos = metrics.Layout.Layout.IndexToPos (strOffset).X; - int x_pos2 = metrics.Layout.Layout.IndexToPos (strEndOffset).X; + int x_pos = metrics.Layout.IndexToPos (strOffset).X; + int x_pos2 = metrics.Layout.IndexToPos (strEndOffset).X; x_pos = (int)(x_pos / Pango.Scale.PangoScale); x_pos2 = (int)(x_pos2 / Pango.Scale.PangoScale); diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessWrapper.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessWrapper.cs index 9c6a3990aa..f2ecd2f0dd 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessWrapper.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Execution/ProcessWrapper.cs @@ -76,7 +76,7 @@ namespace MonoDevelop.Core.Execution if (OutputStreamChanged != null) { char[] buffer = new char [1024]; int nr; - while ((nr = await StandardOutput.ReadAsync (buffer, 0, buffer.Length)) > 0) { + while ((nr = await StandardOutput.ReadAsync (buffer, 0, buffer.Length).ConfigureAwait (false)) > 0) { OutputStreamChanged?.Invoke (this, new string (buffer, 0, nr)); } } @@ -116,7 +116,7 @@ namespace MonoDevelop.Core.Execution try { char[] buffer = new char [1024]; int nr; - while ((nr = await StandardError.ReadAsync (buffer, 0, buffer.Length)) > 0) { + while ((nr = await StandardError.ReadAsync (buffer, 0, buffer.Length).ConfigureAwait (false)) > 0) { ErrorStreamChanged?.Invoke (this, new string (buffer, 0, nr)); } } finally { diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/ITextSource.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/ITextSource.cs index 436b8a969f..101983550d 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/ITextSource.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/ITextSource.cs @@ -170,7 +170,7 @@ namespace MonoDevelop.Core.Text { if (source == null) throw new ArgumentNullException ("source"); - TextFileUtility.WriteText (fileName, source.Text, source.Encoding, source.UseBOM); + TextFileUtility.WriteText (fileName, source); } /// <summary> diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/TextFileUtility.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/TextFileUtility.cs index 79a457aaee..9d61529335 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/TextFileUtility.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Text/TextFileUtility.cs @@ -246,19 +246,29 @@ namespace MonoDevelop.Core.Text if (fileName == null) throw new ArgumentNullException ("fileName"); return GetText (File.ReadAllBytes (fileName), out encoding, out hadBom); - } - + }
+
#endregion - +
#region file methods - static string WriteTextInit (string fileName, string text, Encoding encoding) + static void ArgumentCheck (string fileName) { if (fileName == null) - throw new ArgumentNullException ("fileName"); + throw new ArgumentNullException ("fileName"); + } + + static void ArgumentCheck (string fileName, string text, Encoding encoding) + { + if (fileName == null)
+ throw new ArgumentNullException ("fileName"); if (text == null) throw new ArgumentNullException ("text"); if (encoding == null) throw new ArgumentNullException ("encoding"); + } + + static string WriteTextInit (string fileName) + { // atomic rename only works in the same directory on linux. The tmp files may be on another partition -> breaks save. string tmpPath = Path.Combine (Path.GetDirectoryName (fileName), ".#" + Path.GetFileName (fileName)); return tmpPath; @@ -278,9 +288,21 @@ namespace MonoDevelop.Core.Text } } + public static void WriteText (string fileName, ITextSource source) + { + ArgumentCheck (fileName); + var tmpPath = WriteTextInit (fileName); + using (var stream = new FileStream (tmpPath, FileMode.OpenOrCreate, FileAccess.Write, FileShare.Write)) + using (var sw = new StreamWriter (stream)) { + source.WriteTextTo (sw); + } + WriteTextFinal (tmpPath, fileName); + } + public static void WriteText (string fileName, string text, Encoding encoding, bool hadBom) { - var tmpPath = WriteTextInit (fileName, text, encoding); + ArgumentCheck (fileName, text, encoding); + var tmpPath = WriteTextInit (fileName); using (var stream = new FileStream (tmpPath, FileMode.OpenOrCreate, FileAccess.Write, FileShare.Write)) { if (hadBom) { var bom = encoding.GetPreamble (); @@ -296,7 +318,8 @@ namespace MonoDevelop.Core.Text const int DefaultBufferSize = 4096; public static async Task WriteTextAsync (string fileName, string text, Encoding encoding, bool hadBom) { - var tmpPath = WriteTextInit (fileName, text, encoding); + ArgumentCheck (fileName, text, encoding); + var tmpPath = WriteTextInit (fileName); using (var stream = new FileStream (tmpPath, FileMode.OpenOrCreate, FileAccess.Write, FileShare.Write, bufferSize: DefaultBufferSize, options: FileOptions.Asynchronous)) { if (hadBom) { var bom = encoding.GetPreamble (); diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/WebRequestHelper.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/WebRequestHelper.cs index 2c2f6d59b6..504b07cd64 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/WebRequestHelper.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/WebRequestHelper.cs @@ -87,14 +87,14 @@ namespace MonoDevelop.Core req.MakeCancelable (token); prepareRequest (req); - return (HttpWebResponse) await req.GetResponseAsync (); + return (HttpWebResponse) await req.GetResponseAsync ().ConfigureAwait (false); } var handler = new RequestHelper ( createRequest, prepareRequest, proxyCache, CredentialStore.Instance, credentialProvider ); - return await handler.GetResponseAsync (token); + return await handler.GetResponseAsync (token).ConfigureAwait (false); } /// <summary> diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectService.cs index 316392552e..44a6567069 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectService.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/MSBuildProjectService.cs @@ -133,7 +133,7 @@ namespace MonoDevelop.Projects.MSBuild globalPropertyProviders = AddinManager.GetExtensionObjects<IMSBuildGlobalPropertyProvider> (GlobalPropertyProvidersExtensionPath); foreach (var gpp in globalPropertyProviders) - gpp.GlobalPropertiesChanged -= HandleGlobalPropertyProviderChanged; + gpp.GlobalPropertiesChanged += HandleGlobalPropertyProviderChanged; // Get item type nodes @@ -231,7 +231,7 @@ namespace MonoDevelop.Projects.MSBuild var node = GetItemTypeNodes ().FirstOrDefault (n => n.CanHandleFile (fileName, typeGuid)); if (node != null) { - item = await node.CreateSolutionItem (monitor, ctx, fileName); + item = await node.CreateSolutionItem (monitor, ctx, fileName).ConfigureAwait (false); if (item == null) return null; } @@ -251,7 +251,7 @@ namespace MonoDevelop.Projects.MSBuild item.NotifyItemReady (); }; - await item.LoadAsync (monitor, fileName, expectedFormat, itemGuid); + await item.LoadAsync (monitor, fileName, expectedFormat, itemGuid).ConfigureAwait (false); return item; } @@ -978,7 +978,7 @@ namespace MonoDevelop.Projects.MSBuild try { connection = new RemoteProcessConnection (exe, runtime.GetExecutionHandler ()); - await connection.Connect (); + await connection.Connect ().ConfigureAwait (false); var props = GetCoreGlobalProperties (solutionFile); foreach (var gpp in globalPropertyProviders) { @@ -991,7 +991,7 @@ namespace MonoDevelop.Projects.MSBuild BinDir = binDir, CultureName = GettextCatalog.UICulture.Name, GlobalProperties = props - }); + }).ConfigureAwait (false); builder = new RemoteBuildEngine (connection); @@ -1008,13 +1008,13 @@ namespace MonoDevelop.Projects.MSBuild builders.Add (builderKey, builder); builder.ReferenceCount = 1; builder.Disconnected += async delegate { - using (await buildersLock.EnterAsync ()) + using (await buildersLock.EnterAsync ().ConfigureAwait (false)) builders.Remove (builder); }; if (lockBuilder) builder.Lock (); var pb = new RemoteProjectBuilder (file, builder); - await pb.Load (); + await pb.Load ().ConfigureAwait (false); return pb; }); } @@ -1066,7 +1066,7 @@ namespace MonoDevelop.Projects.MSBuild internal static async void ReleaseProjectBuilder (RemoteBuildEngine engine) { - using (await buildersLock.EnterAsync ()) { + using (await buildersLock.EnterAsync ().ConfigureAwait (false)) { if (--engine.ReferenceCount != 0) return; builders.Remove (engine); diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/RemoteProjectBuilder.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/RemoteProjectBuilder.cs index dce9df56a6..891c15fd21 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/RemoteProjectBuilder.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/RemoteProjectBuilder.cs @@ -329,7 +329,7 @@ namespace MonoDevelop.Projects.MSBuild throw new Exception ("Unknown failure"); return res; } catch (Exception ex) { - await CheckDisconnected (); + await CheckDisconnected ().ConfigureAwait (false); LoggingService.LogError ("RunTarget failed", ex); MSBuildTargetResult err = new MSBuildTargetResult (file, false, "", "", file, 1, 1, 1, 1, "Unknown MSBuild failure. Please try building the project again", ""); MSBuildResult res = new MSBuildResult (new [] { err }); @@ -361,9 +361,9 @@ namespace MonoDevelop.Projects.MSBuild result = await builder.Run ( configurations, -1, MSBuildEvent.None, MSBuildVerbosity.Quiet, new [] { "ResolveAssemblyReferences" }, new [] { "ReferencePath" }, null, null, taskId - ); + ).ConfigureAwait (false); } catch (Exception ex) { - await CheckDisconnected (); + await CheckDisconnected ().ConfigureAwait (false); LoggingService.LogError ("ResolveAssemblyReferences failed", ex); return new AssemblyReference [0]; } finally { @@ -441,10 +441,10 @@ namespace MonoDevelop.Projects.MSBuild try { BeginOperation (); - await builder.Refresh (); + await builder.Refresh ().ConfigureAwait (false); } catch (Exception ex) { LoggingService.LogError ("MSBuild refresh failed", ex); - await CheckDisconnected (); + await CheckDisconnected ().ConfigureAwait (false); } finally { EndOperation (); } @@ -460,10 +460,10 @@ namespace MonoDevelop.Projects.MSBuild try { BeginOperation (); - await builder.RefreshWithContent (projectContent); + await builder.RefreshWithContent (projectContent).ConfigureAwait (false); } catch (Exception ex) { LoggingService.LogError ("MSBuild refresh failed", ex); - await CheckDisconnected (); + await CheckDisconnected ().ConfigureAwait (false); } finally { EndOperation (); } diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/SlnFileFormat.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/SlnFileFormat.cs index a392948583..b74c2c1c54 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/SlnFileFormat.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.MSBuild/SlnFileFormat.cs @@ -77,7 +77,7 @@ namespace MonoDevelop.Projects.MSBuild try { monitor.BeginTask (GettextCatalog.GetString ("Saving solution: {0}", file), 1); - await WriteFileInternal (file, file, sol, saveProjects, monitor); + await WriteFileInternal (file, file, sol, saveProjects, monitor).ConfigureAwait (false); } catch (Exception ex) { monitor.ReportError (GettextCatalog.GetString ("Could not save solution: {0}", file), ex); LoggingService.LogError (GettextCatalog.GetString ("Could not save solution: {0}", file), ex); diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/MSBuildSerializationExtension.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/MSBuildSerializationExtension.cs index 0b2e8efdf9..f5b1f1922c 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/MSBuildSerializationExtension.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/MSBuildSerializationExtension.cs @@ -56,8 +56,8 @@ namespace MonoDevelop.Projects { return Task.Run (async () => { foreach (var f in MSBuildFileFormat.GetSupportedFormats ()) { - if (f.CanReadFile (fileName, typeof(WorkspaceItem))) - return (WorkspaceItem) await f.ReadFile (fileName, typeof(WorkspaceItem), monitor); + if (f.CanReadFile (fileName, typeof (WorkspaceItem))) + return (WorkspaceItem)await f.ReadFile (fileName, typeof (WorkspaceItem), monitor).ConfigureAwait (false); } throw new NotSupportedException (); }); diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs index 3d523c2893..bbdf03097b 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Project.cs @@ -423,7 +423,7 @@ namespace MonoDevelop.Projects async Task LoadAsync (ProgressMonitor monitor) { if (sourceProject == null || sourceProject.IsNewProject) { - sourceProject = await MSBuildProject.LoadAsync (FileName); + sourceProject = await MSBuildProject.LoadAsync (FileName).ConfigureAwait (false); if (MSBuildEngineSupport == MSBuildSupport.NotSupported) sourceProject.UseMSBuildEngine = false; sourceProject.Evaluate (); @@ -1042,9 +1042,9 @@ namespace MonoDevelop.Projects /// <param name='configuration'> /// Configuration to use to run the target /// </param> - public async Task<TargetEvaluationResult> RunTarget (ProgressMonitor monitor, string target, ConfigurationSelector configuration, TargetEvaluationContext context = null) + public Task<TargetEvaluationResult> RunTarget (ProgressMonitor monitor, string target, ConfigurationSelector configuration, TargetEvaluationContext context = null) { - return await ProjectExtension.OnRunTarget (monitor, target, configuration, context ?? new TargetEvaluationContext ()); + return ProjectExtension.OnRunTarget (monitor, target, configuration, context ?? new TargetEvaluationContext ()); } public bool SupportsTarget (string target) @@ -1168,11 +1168,11 @@ namespace MonoDevelop.Projects bool newBuilderRequested = false; - RemoteProjectBuilder builder = await GetProjectBuilder (); + RemoteProjectBuilder builder = await GetProjectBuilder ().ConfigureAwait (false); if (builder.IsBusy) { builder.ReleaseReference (); newBuilderRequested = true; - builder = await RequestLockedBuilder (); + builder = await RequestLockedBuilder ().ConfigureAwait (false); } else builder.Lock (); @@ -1184,7 +1184,7 @@ namespace MonoDevelop.Projects targets = new string [] { target }; try { - result = await builder.Run (configs, monitor.Log, new ProxyLogger (this, context.Loggers), context.LogVerbosity, targets, evaluateItems, evaluateProperties, globalProperties, monitor.CancellationToken); + result = await builder.Run (configs, monitor.Log, new ProxyLogger (this, context.Loggers), context.LogVerbosity, targets, evaluateItems, evaluateProperties, globalProperties, monitor.CancellationToken).ConfigureAwait (false); } finally { builder.Unlock (); builder.ReleaseReference (); diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Solution.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Solution.cs index 0f58656485..769fd27777 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Solution.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Solution.cs @@ -650,14 +650,14 @@ namespace MonoDevelop.Projects return Clean (monitor, (SolutionConfigurationSelector) configuration); } - public async Task<BuildResult> Clean (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext = null) + public Task<BuildResult> Clean (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext = null) { - return await SolutionExtension.Clean (monitor, configuration, operationContext); + return SolutionExtension.Clean (monitor, configuration, operationContext); } - public async Task<BuildResult> Build (ProgressMonitor monitor, string configuration, OperationContext operationContext = null) + public Task<BuildResult> Build (ProgressMonitor monitor, string configuration, OperationContext operationContext = null) { - return await SolutionExtension.Build (monitor, (SolutionConfigurationSelector) configuration, operationContext); + return SolutionExtension.Build (monitor, (SolutionConfigurationSelector) configuration, operationContext); } Task<BuildResult> IBuildTarget.Build (ProgressMonitor monitor, ConfigurationSelector configuration, bool buildReferencedTargets, OperationContext operationContext) @@ -665,9 +665,9 @@ namespace MonoDevelop.Projects return Build (monitor, configuration, operationContext); } - public async Task<BuildResult> Build (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext = null) + public Task<BuildResult> Build (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext = null) { - return await SolutionExtension.Build (monitor, configuration, operationContext); + return SolutionExtension.Build (monitor, configuration, operationContext); } public bool NeedsBuilding (ConfigurationSelector configuration) diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionFolder.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionFolder.cs index c554f63d4d..2fb6db8e1e 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionFolder.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/SolutionFolder.cs @@ -577,10 +577,10 @@ namespace MonoDevelop.Projects public async Task<BuildResult> Clean (ProgressMonitor monitor, ConfigurationSelector configuration, OperationContext operationContext = null) { if (ParentSolution == null) - return new BuildResult (); + return new BuildResult(); SolutionConfiguration conf = ParentSolution.GetConfiguration (configuration); if (conf == null) - return new BuildResult (); + return new BuildResult(); ReadOnlyCollection<SolutionItem> allProjects; try { diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Workspace.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Workspace.cs index 528872fadb..f8e469cc83 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Workspace.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/Workspace.cs @@ -81,6 +81,7 @@ namespace MonoDevelop.Projects [ThreadSafe] public async Task<BuildResult> Build (ProgressMonitor monitor, ConfigurationSelector configuration, bool buildReferencedTargets = false, OperationContext operationContext = null) { + AssertMainThread (); var res = new BuildResult { BuildCount = 0 }; foreach (var bt in Items.OfType<IBuildTarget> ()) res.Append (await bt.Build (monitor, configuration, operationContext:operationContext)); diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceItem.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceItem.cs index c0d02ffd33..f93a4f18e9 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceItem.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceItem.cs @@ -293,10 +293,10 @@ namespace MonoDevelop.Projects /// <summary> /// Called when a load operation for this item has started /// </summary> - internal protected async virtual Task OnBeginLoad () + internal protected virtual Task OnBeginLoad () { Loading = true; - await LoadUserProperties (); + return LoadUserProperties (); } /// <summary> @@ -334,14 +334,14 @@ namespace MonoDevelop.Projects await OnLoadUserProperties (); } - protected virtual async Task OnLoadUserProperties () + protected virtual Task OnLoadUserProperties () { userProperties.Dispose (); userProperties = new PropertyBag (); string preferencesFileName = GetPreferencesFileName (); - await Task.Run (() => { + return Task.Run (() => { if (!File.Exists (preferencesFileName)) return; diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceSerializationExtension.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceSerializationExtension.cs index c425d122d2..d05021ea41 100644 --- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceSerializationExtension.cs +++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/WorkspaceSerializationExtension.cs @@ -49,7 +49,7 @@ namespace MonoDevelop.Projects { return Task.Run (async () => { var workspaceItem = ReadWorkspaceItemFile (fileName, monitor); - await workspaceItem.LoadUserProperties (); + await workspaceItem.LoadUserProperties ().ConfigureAwait (false); return workspaceItem; }); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/RecentFileStorage.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/RecentFileStorage.cs index 06918d9e99..ce3e0d7adb 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/RecentFileStorage.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/RecentFileStorage.cs @@ -239,8 +239,8 @@ namespace MonoDevelop.Ide.Desktop // And we batch as many modifications as possible in a 1 second window. if (recentSaveTask == null) { recentSaveTask = Task.Run (async () => { - await Task.Delay (1000); - await SaveRecentFiles (); + await Task.Delay (1000).ConfigureAwait (false); + await SaveRecentFiles ().ConfigureAwait (false); }); } } @@ -259,7 +259,7 @@ namespace MonoDevelop.Ide.Desktop recentSaveTask = null; } - using (var fs = await AcquireFileExclusive (filePath)) { + using (var fs = await AcquireFileExclusive (filePath).ConfigureAwait (false)) { var list = ReadStore (fs); bool modified = false; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/ErrorHandlerTextEditorExtension.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/ErrorHandlerTextEditorExtension.cs index 7f41943c8d..1334966ce9 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/ErrorHandlerTextEditorExtension.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/ErrorHandlerTextEditorExtension.cs @@ -81,9 +81,9 @@ namespace MonoDevelop.Ide.Editor.Extension var ctx = DocumentContext; if (ctx == null) return; - await UpdateErrorUndelines (ctx, parsedDocument, token); + await UpdateErrorUndelines (ctx, parsedDocument, token).ConfigureAwait (false); token.ThrowIfCancellationRequested (); - await UpdateQuickTasks (ctx, parsedDocument, token); + await UpdateQuickTasks (ctx, parsedDocument, token).ConfigureAwait (false); } catch (OperationCanceledException) { // ignore } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/FoldingTextEditorExtension.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/FoldingTextEditorExtension.cs index f9cf665d44..0ad4db604e 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/FoldingTextEditorExtension.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Editor.Extension/FoldingTextEditorExtension.cs @@ -71,7 +71,7 @@ namespace MonoDevelop.Ide.Editor.Extension Task.Run (async () => { try { if (!isDisposed) - await UpdateFoldings (Editor, parsedDocument, caretLocation, false, token); + await UpdateFoldings (Editor, parsedDocument, caretLocation, false, token).ConfigureAwait (false); } catch (OperationCanceledException) {} }, token); } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FileProvider.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FileProvider.cs index 6ddb809ce7..f16c75d214 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FileProvider.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FileProvider.cs @@ -114,10 +114,10 @@ namespace MonoDevelop.Ide.FindInFiles } } - async Task<Document> SearchDocument () + Task<Document> SearchDocument () { string fullPath = Path.GetFullPath (FileName); - return await Runtime.RunInMainThread (() => IdeApp.Workbench.Documents.FirstOrDefault (d => !string.IsNullOrEmpty (d.FileName) && Path.GetFullPath (d.FileName) == fullPath)); + return Runtime.RunInMainThread (() => IdeApp.Workbench.Documents.FirstOrDefault (d => !string.IsNullOrEmpty (d.FileName) && Path.GetFullPath (d.FileName) == fullPath)); } Document document; diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Wizard/WizardDialogController.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Wizard/WizardDialogController.cs index ad446f4755..8272d504ba 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Wizard/WizardDialogController.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Wizard/WizardDialogController.cs @@ -191,13 +191,13 @@ namespace MonoDevelop.Ide.Gui.Wizard if (currentIndex == Pages.Count - 1) throw new InvalidOperationException (); else - return await Task.FromResult (pages [currentIndex + 1]); + return pages [currentIndex + 1]; } - protected override async Task<IWizardDialogPage> OnGoBack (CancellationToken token) + protected override Task<IWizardDialogPage> OnGoBack (CancellationToken token) { var currentIndex = Pages.IndexOf (CurrentPage); - return await Task.FromResult (pages [currentIndex - 1]); + return Task.FromResult (pages [currentIndex - 1]); } } } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs index 7670501079..242a605786 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs @@ -873,7 +873,9 @@ namespace MonoDevelop.Ide.Gui adhocSolution = new Solution (); adhocSolution.AddConfiguration ("", true); adhocSolution.DefaultSolutionFolder.AddItem (newProject); + MonoDevelopWorkspace.LoadingFinished -= TypeSystemService_WorkspaceItemLoaded; return TypeSystemService.Load (adhocSolution, new ProgressMonitor (), token).ContinueWith (task => { + MonoDevelopWorkspace.LoadingFinished += TypeSystemService_WorkspaceItemLoaded; if (token.IsCancellationRequested) return; UnsubscribeRoslynWorkspace (); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs index 269381c9a8..324f2fc919 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs @@ -1261,7 +1261,7 @@ namespace MonoDevelop.Ide.Gui try {
// DateTime t = DateTime.Now;
- await fileStatusLock.WaitAsync (); + await fileStatusLock.WaitAsync ().ConfigureAwait (false); if (fileStatus == null) return; List<FilePath> modified = new List<FilePath> (fileStatus.Count); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/CommentTasksView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/CommentTasksView.cs index 9df4ad07eb..c63799ea16 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/CommentTasksView.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/CommentTasksView.cs @@ -183,7 +183,7 @@ namespace MonoDevelop.Ide.Tasks var file = doc.FileName; Task.Run (async () => { try { - tags.UpdateTags (project, file, await pd.GetTagCommentsAsync (token)); + tags.UpdateTags (project, file, await pd.GetTagCommentsAsync (token).ConfigureAwait (false)); } catch (TaskCanceledException) { } catch (AggregateException ae) { ae.Flatten ().Handle (x => x is TaskCanceledException); diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs index ff69935867..04f94b3855 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/MonoDevelopWorkspace.cs @@ -244,7 +244,7 @@ namespace MonoDevelop.Ide.TypeSystem });
allTasks.Add (tp);
}
- await Task.WhenAll (allTasks.ToArray ());
+ await Task.WhenAll (allTasks.ToArray ()).ConfigureAwait (false);
if (token.IsCancellationRequested)
return null;
var modifiedWhileLoading = modifiedProjects = new List<MonoDevelop.Projects.DotNetProject> ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ParsedDocument.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ParsedDocument.cs index c08d5a3d69..ae17e7892c 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ParsedDocument.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/ParsedDocument.cs @@ -103,7 +103,7 @@ namespace MonoDevelop.Ide.TypeSystem public async Task<bool> HasErrorsAsync (CancellationToken cancellationToken = default (CancellationToken)) { - return (await GetErrorsAsync (cancellationToken)).Any (e => e.ErrorType == ErrorType.Error); + return (await GetErrorsAsync (cancellationToken).ConfigureAwait (false)).Any (e => e.ErrorType == ErrorType.Error); } [Obsolete ("Use the HasErrorsAsync method for cancellation and async support.")] diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/SolutionSizeTracker.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/SolutionSizeTracker.cs index c94d1decb3..bb477fd057 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/SolutionSizeTracker.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/SolutionSizeTracker.cs @@ -37,7 +37,7 @@ namespace MonoDevelop.Ide.TypeSystem { long result = 0; foreach (var project in workspace.CurrentSolution.Projects) { - result += await GetProjectSizeAsync (project, cancellationToken); + result += await GetProjectSizeAsync (project, cancellationToken).ConfigureAwait (false); } return result; } diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService_WorkspaceHandling.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService_WorkspaceHandling.cs index 7e9d9c96b1..f8085faa6a 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService_WorkspaceHandling.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService_WorkspaceHandling.cs @@ -127,7 +127,7 @@ namespace MonoDevelop.Ide.TypeSystem var ws = item as MonoDevelop.Projects.Workspace; if (ws != null) { foreach (var it in ws.Items) { - await InternalLoad (list, it, progressMonitor, cancellationToken); + await InternalLoad (list, it, progressMonitor, cancellationToken).ConfigureAwait (false); } ws.ItemAdded += OnWorkspaceItemAdded; ws.ItemRemoved += OnWorkspaceItemRemoved; @@ -139,7 +139,7 @@ namespace MonoDevelop.Ide.TypeSystem workspaces = workspaces.Add (workspace); list.Add (workspace); workspace.ShowStatusIcon (); - await workspace.TryLoadSolution (cancellationToken); + await workspace.TryLoadSolution (cancellationToken).ConfigureAwait (false); solution.SolutionItemAdded += OnSolutionItemAdded; solution.SolutionItemRemoved += OnSolutionItemRemoved; TaskCompletionSource<MonoDevelopWorkspace> request; diff --git a/main/src/core/MonoDevelop.Ide/icons/element-constant-16.png b/main/src/core/MonoDevelop.Ide/icons/element-constant-16.png Binary files differindex 7dc3946986..ba981ffab4 100644 --- a/main/src/core/MonoDevelop.Ide/icons/element-constant-16.png +++ b/main/src/core/MonoDevelop.Ide/icons/element-constant-16.png diff --git a/main/src/core/MonoDevelop.Ide/icons/element-constant-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-constant-16@2x.png Binary files differindex 08d9af7557..191ee575a4 100644 --- a/main/src/core/MonoDevelop.Ide/icons/element-constant-16@2x.png +++ b/main/src/core/MonoDevelop.Ide/icons/element-constant-16@2x.png diff --git a/main/src/core/MonoDevelop.Ide/icons/element-constant-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-constant-16~dark.png Binary files differindex 294208b496..5479bc8b89 100644 --- a/main/src/core/MonoDevelop.Ide/icons/element-constant-16~dark.png +++ b/main/src/core/MonoDevelop.Ide/icons/element-constant-16~dark.png diff --git a/main/src/core/MonoDevelop.Ide/icons/element-constant-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-constant-16~dark@2x.png Binary files differindex 23363677e3..cc7542a35d 100644 --- a/main/src/core/MonoDevelop.Ide/icons/element-constant-16~dark@2x.png +++ b/main/src/core/MonoDevelop.Ide/icons/element-constant-16~dark@2x.png diff --git a/main/src/core/MonoDevelop.Ide/icons/element-event-16.png b/main/src/core/MonoDevelop.Ide/icons/element-event-16.png Binary files differindex 1d1e1dac6b..abc41c198b 100644 --- a/main/src/core/MonoDevelop.Ide/icons/element-event-16.png +++ b/main/src/core/MonoDevelop.Ide/icons/element-event-16.png diff --git a/main/src/core/MonoDevelop.Ide/icons/element-event-16@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-event-16@2x.png Binary files differindex a40a378792..90237622ad 100644 --- a/main/src/core/MonoDevelop.Ide/icons/element-event-16@2x.png +++ b/main/src/core/MonoDevelop.Ide/icons/element-event-16@2x.png diff --git a/main/src/core/MonoDevelop.Ide/icons/element-event-16~dark.png b/main/src/core/MonoDevelop.Ide/icons/element-event-16~dark.png Binary files differindex 84cd47db79..5cebebf1ed 100644 --- a/main/src/core/MonoDevelop.Ide/icons/element-event-16~dark.png +++ b/main/src/core/MonoDevelop.Ide/icons/element-event-16~dark.png diff --git a/main/src/core/MonoDevelop.Ide/icons/element-event-16~dark@2x.png b/main/src/core/MonoDevelop.Ide/icons/element-event-16~dark@2x.png Binary files differindex 881e570336..5b6e0055aa 100644 --- a/main/src/core/MonoDevelop.Ide/icons/element-event-16~dark@2x.png +++ b/main/src/core/MonoDevelop.Ide/icons/element-event-16~dark@2x.png diff --git a/main/src/core/MonoDevelop.Ide/templates/images/project-package-32.png b/main/src/core/MonoDevelop.Ide/templates/images/project-package-32.png Binary files differindex 2cc5e379ae..f1327f44a9 100644 --- a/main/src/core/MonoDevelop.Ide/templates/images/project-package-32.png +++ b/main/src/core/MonoDevelop.Ide/templates/images/project-package-32.png diff --git a/main/src/core/MonoDevelop.Ide/templates/images/project-package-32@2x.png b/main/src/core/MonoDevelop.Ide/templates/images/project-package-32@2x.png Binary files differindex 58ef3be85c..aaa7efd2bd 100644 --- a/main/src/core/MonoDevelop.Ide/templates/images/project-package-32@2x.png +++ b/main/src/core/MonoDevelop.Ide/templates/images/project-package-32@2x.png diff --git a/main/src/core/MonoDevelop.Ide/templates/images/project-package-32~dark.png b/main/src/core/MonoDevelop.Ide/templates/images/project-package-32~dark.png Binary files differindex d0a81ecc3f..e7dc9c7be0 100644 --- a/main/src/core/MonoDevelop.Ide/templates/images/project-package-32~dark.png +++ b/main/src/core/MonoDevelop.Ide/templates/images/project-package-32~dark.png diff --git a/main/src/core/MonoDevelop.Ide/templates/images/project-package-32~dark@2x.png b/main/src/core/MonoDevelop.Ide/templates/images/project-package-32~dark@2x.png Binary files differindex b127b7fb3a..e549eb2fbf 100644 --- a/main/src/core/MonoDevelop.Ide/templates/images/project-package-32~dark@2x.png +++ b/main/src/core/MonoDevelop.Ide/templates/images/project-package-32~dark@2x.png diff --git a/main/src/core/MonoDevelop.Ide/templates/images/project-package-32~dark~sel.png b/main/src/core/MonoDevelop.Ide/templates/images/project-package-32~dark~sel.png Binary files differindex 48b71c55d4..f544a27a3d 100644 --- a/main/src/core/MonoDevelop.Ide/templates/images/project-package-32~dark~sel.png +++ b/main/src/core/MonoDevelop.Ide/templates/images/project-package-32~dark~sel.png diff --git a/main/src/core/MonoDevelop.Ide/templates/images/project-package-32~dark~sel@2x.png b/main/src/core/MonoDevelop.Ide/templates/images/project-package-32~dark~sel@2x.png Binary files differindex cf0d574dd7..8428542805 100644 --- a/main/src/core/MonoDevelop.Ide/templates/images/project-package-32~dark~sel@2x.png +++ b/main/src/core/MonoDevelop.Ide/templates/images/project-package-32~dark~sel@2x.png diff --git a/main/src/core/MonoDevelop.Ide/templates/images/project-package-32~sel.png b/main/src/core/MonoDevelop.Ide/templates/images/project-package-32~sel.png Binary files differindex 48b71c55d4..f544a27a3d 100644 --- a/main/src/core/MonoDevelop.Ide/templates/images/project-package-32~sel.png +++ b/main/src/core/MonoDevelop.Ide/templates/images/project-package-32~sel.png diff --git a/main/src/core/MonoDevelop.Ide/templates/images/project-package-32~sel@2x.png b/main/src/core/MonoDevelop.Ide/templates/images/project-package-32~sel@2x.png Binary files differindex cf0d574dd7..8428542805 100644 --- a/main/src/core/MonoDevelop.Ide/templates/images/project-package-32~sel@2x.png +++ b/main/src/core/MonoDevelop.Ide/templates/images/project-package-32~sel@2x.png diff --git a/main/src/core/MonoDevelop.Ide/templates/images/project-package-template.png b/main/src/core/MonoDevelop.Ide/templates/images/project-package-template.png Binary files differindex bfe1cb7ce1..fc1f83580c 100644 --- a/main/src/core/MonoDevelop.Ide/templates/images/project-package-template.png +++ b/main/src/core/MonoDevelop.Ide/templates/images/project-package-template.png diff --git a/main/src/core/MonoDevelop.Ide/templates/images/project-package-template@2x.png b/main/src/core/MonoDevelop.Ide/templates/images/project-package-template@2x.png Binary files differindex 4df1c181dc..319197d702 100644 --- a/main/src/core/MonoDevelop.Ide/templates/images/project-package-template@2x.png +++ b/main/src/core/MonoDevelop.Ide/templates/images/project-package-template@2x.png diff --git a/main/src/core/MonoDevelop.Ide/templates/images/project-package-template~dark.png b/main/src/core/MonoDevelop.Ide/templates/images/project-package-template~dark.png Binary files differindex 3ec008e1ce..e11f423e5e 100644 --- a/main/src/core/MonoDevelop.Ide/templates/images/project-package-template~dark.png +++ b/main/src/core/MonoDevelop.Ide/templates/images/project-package-template~dark.png diff --git a/main/src/core/MonoDevelop.Ide/templates/images/project-package-template~dark@2x.png b/main/src/core/MonoDevelop.Ide/templates/images/project-package-template~dark@2x.png Binary files differindex 0227ef8781..5939530cea 100644 --- a/main/src/core/MonoDevelop.Ide/templates/images/project-package-template~dark@2x.png +++ b/main/src/core/MonoDevelop.Ide/templates/images/project-package-template~dark@2x.png |