Branch: refs/heads/retina
Home: https://github.com/mono/monodevelop
Compare: https://github.com/mono/monodevelop/compare/0528a7c14343...d569180fd686
Commit: 75cd0abe55d44ea774f44c592bf3d6c5f993cad1
Author: Martin Potter <[email protected]> (martinpotter)
Date: 2013-07-22 21:01:11 GMT
URL: https://github.com/mono/monodevelop/commit/75cd0abe55d44ea774f44c592bf3d6c5f993cad1
[Core] Use correct configuration selector.
Currently, when building a specific project within a solution using the command line, the ItemConfigurationSelector is used, resulting in referenced projects using the projects configuration rather than the configuration specified by the solution.
This changes the behavior of the command line to match the behavior within the IDE.
Changed paths:
M main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildTool.cs
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildTool.cs
===================================================================
@@ -128,14 +128,26 @@ public int Run (string[] arguments)
if (config == null && configTarget != null)
config = configTarget.DefaultConfigurationId;
- ConfigurationSelector configuration;
- if (item is SolutionEntityItem)
- configuration = new ItemConfigurationSelector (config);
- else
- configuration = new SolutionConfigurationSelector (config);
-
monitor = new ConsoleProgressMonitor ();
- BuildResult res = item.RunTarget (monitor, command, configuration);
+ BuildResult res = null;
+ if (item is SolutionEntityItem && ((SolutionEntityItem)item).ParentSolution == null) {
+ ConfigurationSelector configuration = new ItemConfigurationSelector (config);
+ res = item.RunTarget (monitor, command, configuration);
+ } else {
+ ConfigurationSelector configuration = new SolutionConfigurationSelector (config);
+ SolutionEntityItem solutionEntityItem = item as SolutionEntityItem;
+ if (solutionEntityItem != null) {
+ if (command == ProjectService.BuildTarget)
+ res = solutionEntityItem.Build (monitor, configuration, true);
+ else if (command == ProjectService.CleanTarget)
+ solutionEntityItem.Clean (monitor, configuration);
+ else
+ res = item.RunTarget (monitor, command, configuration);
+ } else {
+ res = item.RunTarget (monitor, command, configuration);
+ }
+ }
+
if (targetRuntime != null)
{
Commit: 7f587fe5f727f7ae8b56147a1c723e40c651d69c
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-09-30 17:08:27 GMT
URL: https://github.com/mono/monodevelop/commit/7f587fe5f727f7ae8b56147a1c723e40c651d69c
Bump nrefactory.
Changed paths:
M main/external/nrefactory
Modified: main/external/nrefactory
===================================================================
@@ -1 +1 @@
-Subproject commit ef4a829ae257fcbcc6845e345f9e3d4021405081
+Subproject commit cc387371f328000816a631d1256ba32f991bbce9
Commit: d6e5cc5067804f15e53e0dd7de4acb97927b02bd
Author: Michael Hutchinson <[email protected]> (mhutch)
Date: 2013-09-30 18:47:16 GMT
URL: https://github.com/mono/monodevelop/commit/d6e5cc5067804f15e53e0dd7de4acb97927b02bd
[CSharp] Discard generateXmlDocumentation from mdp files
Can't be bothered migrating it, no-one cares about mdp
Changed paths:
M main/src/addins/CSharpBinding/md1format.xml
Modified: main/src/addins/CSharpBinding/md1format.xml
===================================================================
@@ -8,7 +8,6 @@
<ItemProperty member="generateOverflowChecks" name="generateoverflowchecks"/>
<ItemProperty member="mainclass" name="mainclass" defaultValue=""/>
<ItemProperty member="definesymbols" name="definesymbols" defaultValue="" />
- <ItemProperty member="generateXmlDocumentation" name="generatexmldocumentation"/>
<ItemProperty member="win32Icon" name="win32Icon" defaultValue="" serializationDataType="MonoDevelop.Projects.PathDataType"/>
<ItemProperty member="win32Resource" name="win32Resource" defaultValue="" />
<ItemProperty member="codePage" name="codepage" defaultValue="0"/>
Commit: ef18867a701edbc24e268f5d0204f2efe63d9ddc
Author: Michael Hutchinson <[email protected]> (mhutch)
Date: 2013-09-30 19:15:15 GMT
URL: https://github.com/mono/monodevelop/commit/ef18867a701edbc24e268f5d0204f2efe63d9ddc
Fix the mdp tests for now
Changed paths:
M main/tests/test-projects/ContactBook/ContactBook/ContactBook.mdp
M main/tests/test-projects/ContactBook/CustomWidgets/CustomWidgets.mdp
M main/tests/test-projects/console-with-libs-mdp/console-with-libs-mdp/console-with-libs-mdp.mdp
M main/tests/test-projects/console-with-libs-mdp/library1/library1.mdp
M main/tests/test-projects/console-with-libs-mdp/library2/library2.mdp
M main/tests/test-projects/csharp-console-mdp/csharp-console-mdp/csharp-console-mdp.mdp
M main/tests/test-projects/generated-console-project/TestProject.mdp
M main/tests/test-projects/nested-solutions-mdp/console-project/console-project.mdp
M main/tests/test-projects/nested-solutions-mdp/nested-solution1/library1/library1.mdp
M main/tests/test-projects/nested-solutions-mdp/nested-solution1/library2/library2.mdp
M main/tests/test-projects/nested-solutions-mdp/nested-solution2/console-project2/console-project2.mdp
M main/tests/test-projects/nested-solutions-mdp/nested-solution2/nested-solution3/library3/library3.mdp
M main/tests/test-projects/nested-solutions-mdp/nested-solution2/nested-solution3/library4/library4.mdp
M main/tests/test-projects/test-build-configs/Lib1/Lib1.mdp
M main/tests/test-projects/test-build-configs/Lib2/Lib2.mdp
M main/tests/test-projects/test-build-configs/Lib3/Lib3.mdp
M main/tests/test-projects/test-build-configs/Lib4/Lib4.mdp
Modified: main/tests/test-projects/ContactBook/ContactBook/ContactBook.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="ContactBook" />
<Build debugmode="True" target="Exe" />
<Execution consolepause="True" runwithwarnings="True" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="ContactBook" />
<Build debugmode="False" target="Exe" />
<Execution consolepause="True" runwithwarnings="True" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
@@ -34,4 +34,4 @@
<ProjectReference type="Gac" localcopy="True" refto="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<ProjectReference type="Gac" localcopy="True" refto="Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
</References>
-</Project>
\ No newline at end of file
+</Project>
Modified: main/tests/test-projects/ContactBook/CustomWidgets/CustomWidgets.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="CustomWidgets" />
<Build debugmode="True" target="Library" />
<Execution consolepause="False" runwithwarnings="True" runtime="MsNet" clr-version="Net_1_1" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="CustomWidgets" />
<Build debugmode="False" target="Library" />
<Execution consolepause="False" runwithwarnings="True" runtime="MsNet" clr-version="Net_1_1" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
@@ -28,4 +28,4 @@
<ProjectReference type="Gac" localcopy="True" refto="System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference type="Gac" localcopy="True" refto="Mono.Posix, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
</References>
-</Project>
\ No newline at end of file
+</Project>
Modified: main/tests/test-projects/console-with-libs-mdp/console-with-libs-mdp/console-with-libs-mdp.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="console-with-libs-mdp" />
<Build debugmode="True" target="Exe" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" definesymbols="DEBUG" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="console-with-libs-mdp" />
<Build debugmode="False" target="Exe" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Modified: main/tests/test-projects/console-with-libs-mdp/library1/library1.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="library1" />
<Build debugmode="True" target="Library" />
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" definesymbols="DEBUG" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="library1" />
<Build debugmode="False" target="Library" />
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Modified: main/tests/test-projects/console-with-libs-mdp/library2/library2.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="library2" />
<Build debugmode="True" target="Library" />
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" definesymbols="DEBUG" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="library2" />
<Build debugmode="False" target="Library" />
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Modified: main/tests/test-projects/csharp-console-mdp/csharp-console-mdp/csharp-console-mdp.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="csharp-console-mdp" />
<Build debugmode="True" target="Exe" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" definesymbols="DEBUG" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release2" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="csharp-console-mdp" />
<Build debugmode="False" target="Exe" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Modified: main/tests/test-projects/generated-console-project/TestProject.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="TestProject" />
<Build debugmode="True" target="Exe" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="TestProject" />
<Build debugmode="False" target="Exe" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Modified: main/tests/test-projects/nested-solutions-mdp/console-project/console-project.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="console-project" />
<Build debugmode="True" target="Exe" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="console-project" />
<Build debugmode="False" target="Exe" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Modified: main/tests/test-projects/nested-solutions-mdp/nested-solution1/library1/library1.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="library1" />
<Build debugmode="True" target="Library" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="library1" />
<Build debugmode="False" target="Library" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Modified: main/tests/test-projects/nested-solutions-mdp/nested-solution1/library2/library2.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="library2" />
<Build debugmode="True" target="Library" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="library2" />
<Build debugmode="False" target="Library" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Modified: main/tests/test-projects/nested-solutions-mdp/nested-solution2/console-project2/console-project2.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="console-project2" />
<Build debugmode="True" target="Exe" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="console-project2" />
<Build debugmode="False" target="Exe" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Modified: main/tests/test-projects/nested-solutions-mdp/nested-solution2/nested-solution3/library3/library3.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="library3" />
<Build debugmode="True" target="Library" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="library3" />
<Build debugmode="False" target="Library" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Modified: main/tests/test-projects/nested-solutions-mdp/nested-solution2/nested-solution3/library4/library4.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="library4" />
<Build debugmode="True" target="Library" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="library4" />
<Build debugmode="False" target="Library" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Modified: main/tests/test-projects/test-build-configs/Lib1/Lib1.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="Lib1" />
<Build debugmode="True" target="Library" />
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="Lib1" />
<Build debugmode="False" target="Library" />
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
@@ -23,4 +23,4 @@
<ProjectReference type="Project" localcopy="True" refto="Lib3" />
<ProjectReference type="Project" localcopy="True" refto="Lib4" />
</References>
-</Project>
\ No newline at end of file
+</Project>
Modified: main/tests/test-projects/test-build-configs/Lib2/Lib2.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="Lib2" />
<Build debugmode="True" target="Library" />
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="Lib2" />
<Build debugmode="False" target="Library" />
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Modified: main/tests/test-projects/test-build-configs/Lib3/Lib3.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/DebugExtra" assembly="Lib3" />
<Build debugmode="True" target="Library" />
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release+Extra" ctype="DotNetProjectConfiguration">
<Output directory="bin/ReleaseExtra" assembly="Lib3" />
<Build debugmode="False" target="Library" />
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Modified: main/tests/test-projects/test-build-configs/Lib4/Lib4.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="Lib4" />
<Build debugmode="True" target="Library" />
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="Lib4" />
<Build debugmode="False" target="Library" />
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Commit: 0fd9db107551a099e51e799fddcfda9b93dccf6f
Author: Jeffrey Stedfast <[email protected]> (jstedfast)
Date: 2013-09-30 19:37:17 GMT
URL: https://github.com/mono/monodevelop/commit/0fd9db107551a099e51e799fddcfda9b93dccf6f
bumped debugger-libs for some fixes
Changed paths:
M main/external/debugger-libs
M main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/SoftDebuggerEngine.cs
Modified: main/external/debugger-libs
===================================================================
@@ -1 +1 @@
-Subproject commit ff905103422ff3b0af304ff9ed911593fb621004
+Subproject commit e1ba0651309070a25a68caf226721c8177e0fcea
Modified: main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/SoftDebuggerEngine.cs
===================================================================
@@ -140,7 +140,7 @@ class MDLogger : ICustomLogger
{
public void LogError (string message, Exception ex)
{
- MonoDevelop.Core.LoggingService.LogError (message, ex);
+ LoggingService.LogError (message, ex);
}
public void LogAndShowException (string message, Exception ex)
@@ -151,7 +151,7 @@ public void LogAndShowException (string message, Exception ex)
public void LogMessage (string messageFormat, params object[] args)
{
- MonoDevelop.Core.LoggingService.LogInfo (messageFormat, args);
+ LoggingService.LogInfo (messageFormat, args);
}
}
}
Commit: 0dd9941d5e4fd8c5aedb9ca13acf5167e2f9aa61
Author: Jeffrey Stedfast <[email protected]> (jstedfast)
Date: 2013-09-30 22:43:30 GMT
URL: https://github.com/mono/monodevelop/commit/0dd9941d5e4fd8c5aedb9ca13acf5167e2f9aa61
bumped debugger-libs for bug #15086
Changed paths:
M main/external/debugger-libs
Modified: main/external/debugger-libs
===================================================================
@@ -1 +1 @@
-Subproject commit e1ba0651309070a25a68caf226721c8177e0fcea
+Subproject commit a2c1ed51040dc96551c267e14bf4f44c7cd05be6
Commit: dc3ea2f5ccb38268f8f71cb12a9ae07221e3d79d
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-01 05:08:20 GMT
URL: https://github.com/mono/monodevelop/commit/dc3ea2f5ccb38268f8f71cb12a9ae07221e3d79d
[Refactoring] Removed show code generation window from the context
menu.
Changed paths:
M main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.addin.xml
Modified: main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.addin.xml
===================================================================
@@ -128,9 +128,6 @@
<CommandItem id = "MonoDevelop.Refactoring.RefactoryCommands.CurrentRefactoryOperations" insertafter="MonoDevelop.SourceEditor.SourceEditorCommands.MarkerOperations" insertbefore="MonoDevelop.Debugger.DebugCommands.ExpressionEvaluator"/>
--
- <CommandItem id = "MonoDevelop.CodeGeneration.CodeGenerationCommands.ShowCodeGenerationWindow"
- insertafter="MonoDevelop.Ide.Commands.TextEditorCommands.ShowCodeTemplateWindow" />
</Extension>
<Extension path = "/MonoDevelop/Ide/TextEditorExtensions">
Commit: 79839f7592e0b609a4e946e9d798910df1a69bff
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-01 05:08:21 GMT
URL: https://github.com/mono/monodevelop/commit/79839f7592e0b609a4e946e9d798910df1a69bff
Fixed 'Bug 15080 - Exception in text editor chain'.
Changed paths:
M main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/OnTheFlyFormatter.cs
Modified: main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/OnTheFlyFormatter.cs
===================================================================
@@ -112,7 +112,7 @@ static string BuildStub (MonoDevelop.Ide.Gui.Document data, CSharpCompletionText
}
memberStartOffset = sb.Length;
- var text = data.Editor.GetTextBetween (seg.Offset, endOffset);
+ var text = data.Editor.GetTextBetween (Math.Max (0, seg.Offset), endOffset);
sb.Append (text);
var lex = new CSharpCompletionEngineBase.MiniLexer (text);
Commit: 669a064d89178481c0a08052fc0b50dd465e4108
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-01 05:40:07 GMT
URL: https://github.com/mono/monodevelop/commit/669a064d89178481c0a08052fc0b50dd465e4108
Fixed 'Bug 15084 - Errors in framework lookups'.
Changed paths:
M main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/ResolveCommandHandler.cs
M main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs
Modified: main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/ResolveCommandHandler.cs
===================================================================
@@ -373,21 +373,22 @@ static IEnumerable<PossibleNamespace> GetPossibleNamespaces (Document doc, AstNo
scope = scope.Parent;
}
}
-
var allTypes = compilation == doc.Compilation ? compilation.GetAllTypeDefinitions () : compilation.MainAssembly.GetAllTypeDefinitions ();
if (resolveResult is UnknownIdentifierResolveResult) {
- var uiResult = resolveResult as UnknownIdentifierResolveResult;
- string possibleAttributeName = isInsideAttributeType ? uiResult.Identifier + "Attribute" : uiResult.Identifier;
- foreach (var typeDefinition in allTypes) {
- if ((typeDefinition.Name == possibleAttributeName || typeDefinition.Name == uiResult.Identifier) && typeDefinition.TypeParameterCount == tc &&
- lookup.IsAccessible (typeDefinition, false)) {
- if (typeDefinition.DeclaringTypeDefinition != null) {
- var builder = new TypeSystemAstBuilder (new CSharpResolver (doc.Compilation));
- foundIdentifier = true;
- yield return new PossibleNamespace (builder.ConvertType (typeDefinition.DeclaringTypeDefinition).ToString (), false, requiredReference);
- } else {
- foundIdentifier = true;
- yield return new PossibleNamespace (typeDefinition.Namespace, true, requiredReference);
+ if (node is AstType) {
+ var uiResult = resolveResult as UnknownIdentifierResolveResult;
+ string possibleAttributeName = isInsideAttributeType ? uiResult.Identifier + "Attribute" : uiResult.Identifier;
+ foreach (var typeDefinition in allTypes) {
+ if ((typeDefinition.Name == possibleAttributeName || typeDefinition.Name == uiResult.Identifier) && typeDefinition.TypeParameterCount == tc &&
+ lookup.IsAccessible (typeDefinition, false)) {
+ if (typeDefinition.DeclaringTypeDefinition != null) {
+ var builder = new TypeSystemAstBuilder (new CSharpResolver (doc.Compilation));
+ foundIdentifier = true;
+ yield return new PossibleNamespace (builder.ConvertType (typeDefinition.DeclaringTypeDefinition).ToString (), false, requiredReference);
+ } else {
+ foundIdentifier = true;
+ yield return new PossibleNamespace (typeDefinition.Namespace, true, requiredReference);
+ }
}
}
}
@@ -434,8 +435,9 @@ out inferredTypes
}
}
}
+
// Try to search framework types
- if (!foundIdentifier && frameworkLookup != null && resolveResult is UnknownIdentifierResolveResult) {
+ if (!foundIdentifier && frameworkLookup != null && resolveResult is UnknownIdentifierResolveResult && node is AstType) {
var uiResult = resolveResult as UnknownIdentifierResolveResult;
if (uiResult != null) {
var lookups = new List<Tuple<FrameworkLookup.AssemblyLookup, SystemAssembly>> ();
Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs
===================================================================
@@ -2373,14 +2373,16 @@ public static bool RecreateFrameworkLookup (DotNetProject netProject)
{
lock (frameworkLookup) {
FrameworkTask result;
- if (!frameworkLookup.TryGetValue (netProject.TargetFramework.Name, out result))
+ var frameworkName = netProject.TargetFramework.Name;
+ if (!frameworkLookup.TryGetValue (frameworkName, out result))
return false;
if (result.RetryCount > 5) {
- LoggingService.LogError ("Can't create framework lookup for:" + netProject.TargetFramework.Name);
+ LoggingService.LogError ("Can't create framework lookup for:" + frameworkName);
return false;
}
result.RetryCount++;
- LoggingService.LogInfo ("Trying to recreate framework lookup for {0}, try {1}.", netProject.TargetFramework.Name, result.RetryCount);
+ LoggingService.LogInfo ("Trying to recreate framework lookup for {0}, try {1}.", frameworkName, result.RetryCount);
+ result.Task = null;
StartFrameworkLookup (netProject);
return true;
}
Commit: 49fc2dcb73d957bfa7dcfbc001049a8ba59a572f
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-01 05:47:24 GMT
URL: https://github.com/mono/monodevelop/commit/49fc2dcb73d957bfa7dcfbc001049a8ba59a572f
Fixed 'Bug 15083 - UTF8 conversion errors in search results'.
Changed paths:
M main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs
Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs
===================================================================
@@ -491,7 +491,7 @@ void ResultTextDataFunc (TreeViewColumn column, CellRenderer cell, TreeModel mod
uint end;
try {
start = (uint)TextViewMargin.TranslateIndexToUTF8 (lineText, col);
- end = (uint)TextViewMargin.TranslateIndexToUTF8 (lineText, col + searchResult.Length);
+ end = (uint)TextViewMargin.TranslateIndexToUTF8 (lineText, Math.Min (lineText.Length, col + searchResult.Length));
} catch (Exception e) {
LoggingService.LogError ("Exception while translating index to utf8 (column was:" +col + " search result length:" + searchResult.Length + " line text:" + lineText + ")", e);
return;
Commit: bde75ac950f8b2908a95e28249834fcf6e64f961
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-01 06:27:38 GMT
URL: https://github.com/mono/monodevelop/commit/bde75ac950f8b2908a95e28249834fcf6e64f961
Bump nrefactory.
Changed paths:
M main/external/nrefactory
Modified: main/external/nrefactory
===================================================================
@@ -1 +1 @@
-Subproject commit cc387371f328000816a631d1256ba32f991bbce9
+Subproject commit 5a3a300543f660eb5dab16493e4eb30e2400f45d
Commit: 9e24b732541be2c7eff0e69cee7d541422e2cd2f
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-01 05:40:12 GMT
URL: https://github.com/mono/monodevelop/commit/9e24b732541be2c7eff0e69cee7d541422e2cd2f
[Core] Fixed start on windows.
Changed paths:
M main/src/core/MonoDevelop.Core/MonoDevelop.Core/FileService.cs
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Core/FileService.cs
===================================================================
@@ -77,7 +77,7 @@ static void UpdateExtensions ()
return;
}
- FileSystemExtension[] extensions = (FileSystemExtension[]) AddinManager.GetExtensionObjects (addinFileSystemExtensionPath, typeof(FileSystemExtension));
+ var extensions = AddinManager.GetExtensionObjects (addinFileSystemExtensionPath, typeof(FileSystemExtension)).Cast<FileSystemExtension> ().ToArray ();
for (int n=0; n<extensions.Length - 1; n++) {
extensions [n].Next = extensions [n + 1];
}
Commit: 8e971319006077de2d7d1b9f9590c62cb3623833
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-01 05:53:06 GMT
URL: https://github.com/mono/monodevelop/commit/8e971319006077de2d7d1b9f9590c62cb3623833
[Core] Fixed cast exceptions on Windows.
Changed paths:
M main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs
===================================================================
@@ -46,6 +46,7 @@
using MonoDevelop.Projects.Extensions;
using Mono.Unix;
using MonoDevelop.Core.StringParsing;
+using System.Linq;
namespace MonoDevelop.Projects
{
@@ -120,7 +121,7 @@ public ProjectServiceExtension GetExtensionChain (IBuildTarget target)
einfo.ItemTypeCondition.ObjType = target.GetType ();
einfo.ProjectLanguageCondition.TargetProject = target;
}
- ProjectServiceExtension[] extensions = (ProjectServiceExtension[]) einfo.ExtensionContext.GetExtensionObjects ("/MonoDevelop/ProjectModel/ProjectServiceExtensions", typeof(ProjectServiceExtension));
+ ProjectServiceExtension[] extensions = einfo.ExtensionContext.GetExtensionObjects ("/MonoDevelop/ProjectModel/ProjectServiceExtensions", typeof(ProjectServiceExtension)).Cast<ProjectServiceExtension> ().ToArray ();
chain = CreateExtensionChain (extensions);
}
else {
@@ -128,7 +129,7 @@ public ProjectServiceExtension GetExtensionChain (IBuildTarget target)
ExtensionContext ctx = AddinManager.CreateExtensionContext ();
ctx.RegisterCondition ("ItemType", new ItemTypeCondition (typeof(UnknownItem)));
ctx.RegisterCondition ("ProjectLanguage", new ProjectLanguageCondition (UnknownItem.Instance));
- ProjectServiceExtension[] extensions = (ProjectServiceExtension[]) ctx.GetExtensionObjects ("/MonoDevelop/ProjectModel/ProjectServiceExtensions", typeof(ProjectServiceExtension));
+ ProjectServiceExtension[] extensions = ctx.GetExtensionObjects ("/MonoDevelop/ProjectModel/ProjectServiceExtensions", typeof(ProjectServiceExtension)).Cast<ProjectServiceExtension> ().ToArray ();
defaultExtensionChain = CreateExtensionChain (extensions);
}
chain = defaultExtensionChain;
Commit: d8074aeed5457866142f12829e9a10e82f32889e
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-01 05:54:07 GMT
URL: https://github.com/mono/monodevelop/commit/d8074aeed5457866142f12829e9a10e82f32889e
[CSharpBinding] Improved performance of c# import symbols completion.
Changed paths:
M main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs
Modified: main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs
===================================================================
@@ -1173,7 +1173,7 @@ public override string GetDisplayDescription (bool isSelected)
get {
Initialize ();
if (generateUsing)
- return string.Format (GettextCatalog.GetString ("Add namespace import '{0}'"), type.Namespace);
+ return type.Namespace;
return null;
}
}
Commit: 74cd0da2ac982d57ac274a39435cf578750bc01a
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-01 08:53:56 GMT
URL: https://github.com/mono/monodevelop/commit/74cd0da2ac982d57ac274a39435cf578750bc01a
Bump nrefactory.
Changed paths:
M main/external/nrefactory
Modified: main/external/nrefactory
===================================================================
@@ -1 +1 @@
-Subproject commit 5a3a300543f660eb5dab16493e4eb30e2400f45d
+Subproject commit 760ede6a95b64838423fc3cf77bcc187ff7a186e
Commit: 4cdb28da1ad215488787861f6b8983a2bc0d0cd2
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-01 08:55:05 GMT
URL: https://github.com/mono/monodevelop/commit/4cdb28da1ad215488787861f6b8983a2bc0d0cd2
[CSharpBinding] Improved speed of automatic import symbol completion.
Changed paths:
M main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs
Modified: main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs
===================================================================
@@ -209,7 +209,7 @@ void HandleDocumentParsed (object sender, EventArgs e)
unstableTypeSystemSegmentTree = newTree;
}
newTree.InstallListener (document.Editor.Document);
-
+
this.Unit = newDocument.GetAst<SyntaxTree> ();
this.CSharpUnresolvedFile = newDocument.ParsedFile as CSharpUnresolvedFile;
this.UnresolvedFileCompilation = Document.Compilation;
@@ -304,7 +304,7 @@ CSharpTypeResolveContext CreateTypeResolveContext ()
return rctx;
}
-
+ CompletionEngineCache cache = new CompletionEngineCache ();
ICompletionDataList InternalHandleCodeCompletion (CodeCompletionContext completionContext, char completionChar, bool ctrlSpace, ref int triggerWordLength)
{
var data = TextEditorData;
@@ -332,6 +332,7 @@ ICompletionDataList InternalHandleCodeCompletion (CodeCompletionContext completi
completionDataFactory.Engine = engine;
engine.AutomaticallyAddImports = AddImportedItemsToCompletionList.Value;
engine.IncludeKeywordsInCompletionList = EnableAutoCodeCompletion || IncludeKeywordsInCompletionList.Value;
+ engine.CompletionEngineCache = cache;
if (FilterCompletionListByEditorBrowsable) {
engine.EditorBrowsableBehavior = IncludeEditorBrowsableAdvancedMembers ? EditorBrowsableBehavior.IncludeAdvanced : EditorBrowsableBehavior.Normal;
} else {
Commit: f21cf3ca89a90e22ce2fd130954ec9ef960022d2
Author: Lluis Sanchez <[email protected]> (slluis)
Date: 2013-10-01 11:30:56 GMT
URL: https://github.com/mono/monodevelop/commit/f21cf3ca89a90e22ce2fd130954ec9ef960022d2
[Core] Evaluate msbuild properties after loading
After loading a project do a light property evaluation. It is light in the
sense that it will ignore properties defined inside property groups
with conditions based on cofigurations. In other words, it evaluates
all properties that won't change after loading the project.
Changed paths:
M main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProject.cs
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProject.cs
===================================================================
@@ -34,12 +34,14 @@
using MonoDevelop.Projects.Utility;
using MonoDevelop.Projects.Text;
+using Microsoft.Build.BuildEngine;
namespace MonoDevelop.Projects.Formats.MSBuild
{
public class MSBuildProject
{
public XmlDocument doc;
+ string file;
Dictionary<XmlElement,MSBuildObject> elemCache = new Dictionary<XmlElement,MSBuildObject> ();
Dictionary<string, MSBuildItemGroup> bestGroups;
@@ -59,6 +61,10 @@ public class MSBuildProject
return manager;
}
}
+
+ public string FileName {
+ get { return file; }
+ }
public MSBuildProject ()
{
@@ -66,9 +72,10 @@ public MSBuildProject ()
doc.PreserveWhitespace = false;
doc.AppendChild (doc.CreateElement (null, "Project", Schema));
}
-
+
public void Load (string file)
{
+ this.file = file;
using (FileStream fs = File.OpenRead (file)) {
byte[] buf = new byte [1024];
int nread, i;
@@ -118,6 +125,7 @@ public void Load (string file)
string xml = File.ReadAllText (file);
doc.LoadXml (xml);
+ Evaluate ();
}
class ProjectWriter : StringWriter
@@ -160,6 +168,15 @@ public string SaveToString ()
return content;
}
+ public void Evaluate ()
+ {
+ MSBuildEvaluationContext context = new MSBuildEvaluationContext (this);
+ foreach (var pg in PropertyGroups)
+ pg.Evaluate (context);
+ foreach (var pg in ItemGroups)
+ pg.Evaluate (context);
+ }
+
public string DefaultTargets {
get { return doc.DocumentElement.GetAttribute ("DefaultTargets"); }
set { doc.DocumentElement.SetAttribute ("DefaultTargets", value); }
@@ -395,7 +412,8 @@ public void RemoveGroup (MSBuildPropertyGroup grp)
public class MSBuildObject
{
XmlElement elem;
-
+ XmlElement evaluatedElem;
+
public MSBuildObject (XmlElement elem)
{
this.elem = elem;
@@ -404,6 +422,15 @@ public MSBuildObject (XmlElement elem)
public XmlElement Element {
get { return elem; }
}
+
+ public XmlElement EvaluatedElement {
+ get { return evaluatedElem ?? elem; }
+ protected set { evaluatedElem = value; }
+ }
+
+ public bool IsEvaluated {
+ get { return evaluatedElem != null; }
+ }
protected XmlElement AddChildElement (string name)
{
@@ -423,6 +450,10 @@ protected XmlElement AddChildElement (string name)
Element.SetAttribute ("Condition", value);
}
}
+
+ internal virtual void Evaluate (MSBuildEvaluationContext context)
+ {
+ }
}
public class MSBuildProperty: MSBuildObject
@@ -435,10 +466,12 @@ public MSBuildProperty (XmlElement elem): base (elem)
get { return Element.Name; }
}
+ internal bool Overwritten { get; set; }
+
[Obsolete]
public string Value {
get {
- return Element.InnerText;
+ return EvaluatedElement.InnerText;
}
set {
Element.InnerText = value;
@@ -448,8 +481,8 @@ public MSBuildProperty (XmlElement elem): base (elem)
public string GetValue (bool isXml = false)
{
if (isXml)
- return Element.InnerXml;
- return Element.InnerText;
+ return EvaluatedElement.InnerXml;
+ return EvaluatedElement.InnerText;
}
public void SetValue (string value, bool isXml = false)
@@ -459,6 +492,32 @@ public void SetValue (string value, bool isXml = false)
else
Element.InnerText = value;
}
+
+ internal override void Evaluate (MSBuildEvaluationContext context)
+ {
+ EvaluatedElement = null;
+
+ if (!string.IsNullOrEmpty (Condition)) {
+ string cond;
+ if (!context.Evaluate (Condition, out cond)) {
+ // The value could not be evaluated, so if there is an existing value, it is not valid anymore
+ context.ClearPropertyValue (Name);
+ return;
+ }
+ if (!ConditionParser.ParseAndEvaluate (cond, context))
+ return;
+ }
+
+ XmlElement elem;
+
+ if (context.Evaluate (Element, out elem)) {
+ EvaluatedElement = elem;
+ context.SetPropertyValue (Name, GetValue ());
+ } else {
+ // The value could not be evaluated, so if there is an existing value, it is not valid anymore
+ context.ClearPropertyValue (Name);
+ }
+ }
}
public interface MSBuildPropertySet
@@ -564,11 +623,22 @@ void Prune (MSBuildPropertyGroup g)
public class MSBuildPropertyGroup: MSBuildObject, MSBuildPropertySet
{
Dictionary<string,MSBuildProperty> properties = new Dictionary<string,MSBuildProperty> ();
+ List<MSBuildProperty> propertyList = new List<MSBuildProperty> ();
MSBuildProject parent;
public MSBuildPropertyGroup (MSBuildProject parent, XmlElement elem): base (elem)
{
this.parent = parent;
+
+ foreach (var pelem in Element.ChildNodes.OfType<XmlElement> ()) {
+ MSBuildProperty prevSameName;
+ if (properties.TryGetValue (pelem.Name, out prevSameName))
+ prevSameName.Overwritten = true;
+
+ var prop = new MSBuildProperty (pelem);
+ propertyList.Add (prop);
+ properties [pelem.Name] = prop; // If a property is defined more than once, we only care about the last registered value
+ }
}
public MSBuildProject Parent {
@@ -580,33 +650,13 @@ public MSBuildPropertyGroup (MSBuildProject parent, XmlElement elem): base (elem
public MSBuildProperty GetProperty (string name)
{
MSBuildProperty prop;
- if (properties.TryGetValue (name, out prop))
- return prop;
- XmlElement propElem = Element [name, MSBuildProject.Schema];
- if (propElem != null) {
- prop = new MSBuildProperty (propElem);
- properties [name] = prop;
- return prop;
- }
- else
- return null;
+ properties.TryGetValue (name, out prop);
+ return prop;
}
public IEnumerable<MSBuildProperty> Properties {
get {
- foreach (XmlNode node in Element.ChildNodes) {
- XmlElement pelem = node as XmlElement;
- if (pelem == null)
- continue;
- MSBuildProperty prop;
- if (properties.TryGetValue (pelem.Name, out prop))
- yield return prop;
- else {
- prop = new MSBuildProperty (pelem);
- properties [pelem.Name] = prop;
- yield return prop;
- }
- }
+ return propertyList.Where (p => !p.Overwritten);
}
}
@@ -617,6 +667,7 @@ public MSBuildProperty SetPropertyValue (string name, string value, bool preserv
XmlElement pelem = AddChildElement (name);
prop = new MSBuildProperty (pelem);
properties [name] = prop;
+ propertyList.Add (prop);
prop.SetValue (value, isXml);
} else if (!preserveExistingCase || !string.Equals (value, prop.GetValue (isXml), StringComparison.OrdinalIgnoreCase)) {
prop.SetValue (value, isXml);
@@ -638,6 +689,7 @@ public bool RemoveProperty (string name)
MSBuildProperty prop = GetProperty (name);
if (prop != null) {
properties.Remove (name);
+ propertyList.Remove (prop);
Element.RemoveChild (prop.Element);
return true;
}
@@ -654,6 +706,7 @@ public void RemoveAllProperties ()
foreach (XmlNode node in toDelete)
Element.RemoveChild (node);
properties.Clear ();
+ propertyList.Clear ();
}
public void UnMerge (MSBuildPropertySet baseGrp, ISet<string> propsToExclude)
@@ -667,6 +720,25 @@ public void UnMerge (MSBuildPropertySet baseGrp, ISet<string> propsToExclude)
}
}
+ internal override void Evaluate (MSBuildEvaluationContext context)
+ {
+ if (!string.IsNullOrEmpty (Condition)) {
+ string cond;
+ if (!context.Evaluate (Condition, out cond)) {
+ // The condition could not be evaluated. Clear all properties that this group defines
+ // since we don't know if they will have a value or not
+ foreach (var prop in Properties)
+ context.ClearPropertyValue (prop.Name);
+ return;
+ }
+ if (!ConditionParser.ParseAndEvaluate (cond, context))
+ return;
+ }
+
+ foreach (var prop in propertyList)
+ prop.Evaluate (context);
+ }
+
public override string ToString()
{
string s = "[MSBuildPropertyGroup:";
@@ -684,7 +756,7 @@ public MSBuildItem (XmlElement elem): base (elem)
}
public string Include {
- get { return Element.GetAttribute ("Include"); }
+ get { return EvaluatedElement.GetAttribute ("Include"); }
set { Element.SetAttribute ("Include", value); }
}
@@ -694,7 +766,7 @@ public MSBuildItem (XmlElement elem): base (elem)
public bool HasMetadata (string name)
{
- return Element [name, MSBuildProject.Schema] != null;
+ return EvaluatedElement [name, MSBuildProject.Schema] != null;
}
public void SetMetadata (string name, string value, bool isXml = false)
@@ -722,7 +794,7 @@ public void UnsetMetadata (string name)
public string GetMetadata (string name, bool isXml = false)
{
- XmlElement elem = Element [name, MSBuildProject.Schema];
+ XmlElement elem = EvaluatedElement [name, MSBuildProject.Schema];
if (elem != null)
return isXml ? elem.InnerXml : elem.InnerText;
else
@@ -741,6 +813,15 @@ public void MergeFrom (MSBuildItem other)
SetMetadata (node.LocalName, node.InnerXml, true);
}
}
+
+ internal override void Evaluate (MSBuildEvaluationContext context)
+ {
+ XmlElement elem;
+ if (context.Evaluate (Element, out elem))
+ EvaluatedElement = elem;
+ else
+ EvaluatedElement = null;
+ }
}
public class MSBuildItemGroup: MSBuildObject
@@ -769,5 +850,140 @@ public MSBuildItem AddNewItem (string name, string include)
}
}
}
+
+ internal override void Evaluate (MSBuildEvaluationContext context)
+ {
+ foreach (var item in Items)
+ item.Evaluate (context);
+ }
+ }
+
+ internal class MSBuildEvaluationContext: IExpressionContext
+ {
+ Dictionary<string,string> properties = new Dictionary<string, string> ();
+ bool allResolved;
+ MSBuildProject project;
+
+ public MSBuildEvaluationContext (MSBuildProject project)
+ {
+ this.project = project;
+ }
+
+ public string GetPropertyValue (string name)
+ {
+ string val;
+ if (properties.TryGetValue (name, out val))
+ return val;
+ else
+ return "";
+ }
+
+ public void SetPropertyValue (string name, string value)
+ {
+ properties [name] = value;
+ }
+
+ public void ClearPropertyValue (string name)
+ {
+ properties.Remove (name);
+ }
+
+ public bool Evaluate (XmlElement source, out XmlElement result)
+ {
+ allResolved = true;
+ result = (XmlElement) EvaluateNode (source);
+ return allResolved;
+ }
+
+ XmlNode EvaluateNode (XmlNode source)
+ {
+ var elemSource = source as XmlElement;
+ if (elemSource != null) {
+ var elem = source.OwnerDocument.CreateElement (elemSource.Prefix, elemSource.LocalName, elemSource.NamespaceURI);
+ foreach (XmlAttribute attr in elemSource.Attributes)
+ elem.Attributes.Append ((XmlAttribute)EvaluateNode (attr));
+ foreach (XmlNode child in elemSource.ChildNodes)
+ elem.AppendChild (EvaluateNode (child));
+ return elem;
+ }
+
+ var attSource = source as XmlAttribute;
+ if (attSource != null) {
+ bool oldResolved = allResolved;
+ var att = source.OwnerDocument.CreateAttribute (attSource.Prefix, attSource.LocalName, attSource.NamespaceURI);
+ att.Value = Evaluate (attSource.Value);
+
+ // Condition attributes don't change the resolution status. Conditions are handled in the property and item objects
+ if (attSource.Name == "Condition")
+ allResolved = oldResolved;
+
+ return att;
+ }
+ var textSource = source as XmlText;
+ if (textSource != null) {
+ return source.OwnerDocument.CreateTextNode (Evaluate (textSource.InnerText));
+ }
+ return source.Clone ();
+ }
+
+ public bool Evaluate (string str, out string result)
+ {
+ allResolved = true;
+ result = Evaluate (str);
+ return allResolved;
+ }
+
+ string Evaluate (string str)
+ {
+ int i = str.IndexOf ("$(");
+ if (i == -1)
+ return str;
+
+ int last = 0;
+
+ StringBuilder sb = new StringBuilder ();
+ do {
+ sb.Append (str, last, i - last);
+ i += 2;
+ int j = str.IndexOf (")", i);
+ if (j == -1) {
+ allResolved = false;
+ return "";
+ }
+
+ string prop = str.Substring (i, j - i);
+ string val;
+ if (!properties.TryGetValue (prop, out val)) {
+ allResolved = false;
+ return "";
+ }
+
+ sb.Append (val);
+ last = j + 1;
+ i = str.IndexOf ("$(", last);
+ }
+ while (i != -1);
+
+ sb.Append (str, last, str.Length - last);
+ return sb.ToString ();
+ }
+
+ #region IExpressionContext implementation
+
+ public string EvaluateString (string value)
+ {
+ if (value.StartsWith ("$(") && value.EndsWith (")"))
+ return GetPropertyValue (value.Substring (2, value.Length - 3));
+ else
+ return value;
+ }
+
+ public string FullFileName {
+ get {
+ return project.FileName;
+ }
+ }
+
+ #endregion
}
}
Commit: bdc7acfb5b61849ddd5b1d5cb94e63924548c782
Author: Lluis Sanchez <[email protected]> (slluis)
Date: 2013-10-01 11:30:57 GMT
URL: https://github.com/mono/monodevelop/commit/bdc7acfb5b61849ddd5b1d5cb94e63924548c782
Add property evaluation tests
Changed paths:
M main/tests/UnitTests/MonoDevelop.Projects/MSBuildTests.cs
Added paths:
A main/tests/test-projects/property-evaluation-test/property-evaluation-test.csproj
A main/tests/test-projects/property-evaluation-test/property-evaluation-test.sln
Modified: main/tests/UnitTests/MonoDevelop.Projects/MSBuildTests.cs
===================================================================
@@ -364,5 +364,23 @@ public void RoundtripPropertyWithXmlCharacters ()
Assert.AreEqual (value, conf.OutputAssembly);
}
+
+ [Test]
+ public void EvaluateProperties ()
+ {
+ string solFile = Util.GetSampleProject ("property-evaluation-test", "property-evaluation-test.sln");
+ Solution sol = Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile) as Solution;
+ var p = (DotNetProject) sol.GetAllProjects ().First ();
+ Assert.AreEqual ("Program1_test1.cs", p.Files[0].FilePath.FileName, "Basic replacement");
+ Assert.AreEqual ("Program2_test1_test2.cs", p.Files[1].FilePath.FileName, "Property referencing same property");
+ Assert.AreEqual ("Program3_$(DebugType).cs", p.Files[2].FilePath.FileName, "Property inside group with non-evaluable condition");
+ Assert.AreEqual ("Program4_yes_value.cs", p.Files[3].FilePath.FileName, "Evaluation of group condition");
+ Assert.AreEqual ("Program5_yes_value.cs", p.Files[4].FilePath.FileName, "Evaluation of property condition");
+ Assert.AreEqual ("Program6_$(FFF).cs", p.Files[5].FilePath.FileName, "Evaluation of property with non-evaluable condition");
+ Assert.AreEqual ("Program7_test1.cs", p.Files[6].FilePath.FileName, "Item conditions are ignored");
+ Assert.AreEqual ("Program8_test1.cs", p.Files[7].FilePath.FileName, "Item group conditions are ignored");
+ Assert.AreEqual ("Program9_$(GGG).cs", p.Files[8].FilePath.FileName, "Non-evaluable property group clears properties");
+ Assert.AreEqual ("Program10_$(AAA", p.Files[9].FilePath.FileName, "Invalid property reference");
+ }
}
}
Added: main/tests/test-projects/property-evaluation-test/property-evaluation-test.csproj
===================================================================
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+ <ProductVersion>10.0.0</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{8A067BDA-C60B-4B3E-85EC-743CF521ADD4}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <RootNamespace>propertyevaluationtest</RootNamespace>
+ <AssemblyName>property-evaluation-test</AssemblyName>
+ <AAA>test1</AAA>
+ <BBB>test2</BBB>
+ <BBB>$(AAA)_$(BBB)</BBB>
+ <CCC>yes</CCC>
+ <EEE>unknown</EEE>
+ <EEE Condition=" '$(CCC)' == 'yes' ">yes_value</EEE>
+ <FFF>unknown</FFF>
+ <FFF Condition=" '$(FOO)' == 'yes' ">yes_value</FFF>
+ <GGG>yes</GGG>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(CCC)' == 'yes' ">
+ <DDD>yes_value</DDD>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(CCC)' == 'no' ">
+ <DDD>no_value</DDD>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug</OutputPath>
+ <DefineConstants>DEBUG;</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <Externalconsole>true</Externalconsole>
+ <PlatformTarget>x86</PlatformTarget>
+ <GGG>yes</GGG>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+ <DebugType>full</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <Externalconsole>true</Externalconsole>
+ <PlatformTarget>x86</PlatformTarget>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Program1_$(AAA).cs" />
+ <Compile Include="Program2_$(BBB).cs" />
+ <Compile Include="Program3_$(DebugType).cs" />
+ <Compile Include="Program4_$(DDD).cs" />
+ <Compile Include="Program5_$(EEE).cs" />
+ <Compile Include="Program6_$(FFF).cs" />
+ <Compile Include="Program7_$(AAA).cs" Condition=" '$(Foo)' == 'Bar' " />
+ </ItemGroup>
+ <ItemGroup Condition=" '$(Foo)' == 'Bar' ">
+ <Compile Include="Program8_$(AAA).cs" />
+ <Compile Include="Program9_$(GGG).cs" />
+ <Compile Include="Program10_$(AAA" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+</Project>
\ No newline at end of file
Added: main/tests/test-projects/property-evaluation-test/property-evaluation-test.sln
===================================================================
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "property-evaluation-test", "property-evaluation-test.csproj", "{8A067BDA-C60B-4B3E-85EC-743CF521ADD4}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x86 = Debug|x86
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {8A067BDA-C60B-4B3E-85EC-743CF521ADD4}.Debug|x86.ActiveCfg = Debug|x86
+ {8A067BDA-C60B-4B3E-85EC-743CF521ADD4}.Debug|x86.Build.0 = Debug|x86
+ {8A067BDA-C60B-4B3E-85EC-743CF521ADD4}.Release|x86.ActiveCfg = Release|x86
+ {8A067BDA-C60B-4B3E-85EC-743CF521ADD4}.Release|x86.Build.0 = Release|x86
+ EndGlobalSection
+ GlobalSection(MonoDevelopProperties) = preSolution
+ StartupItem = property-evaluation-test.csproj
+ EndGlobalSection
+EndGlobal
Commit: 3050950574f5b4d9426839703980b2ca5a827a61
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-01 13:03:49 GMT
URL: https://github.com/mono/monodevelop/commit/3050950574f5b4d9426839703980b2ca5a827a61
[CSharpBinding] Implemented protocol member code generation.
Changed paths:
M main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ExportCodeGenerator.cs
M main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerationService.cs
Modified: main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ExportCodeGenerator.cs
===================================================================
@@ -32,6 +32,7 @@
using System.Linq;
using ICSharpCode.NRefactory.CSharp.Refactoring;
using MonoDevelop.CSharp.Refactoring.CodeActions;
+using MonoDevelop.CSharp.Refactoring;
namespace MonoDevelop.CodeGeneration
{
@@ -78,29 +79,27 @@ public ExportMethods (CodeGenerationOptions options) : base (options)
{
}
+
protected override IEnumerable<object> GetValidMembers ()
{
var type = Options.EnclosingType;
if (type == null || Options.EnclosingMember != null)
yield break;
foreach (var t in type.DirectBaseTypes) {
- foreach (var attrs in t.GetDefinition ().GetAttributes ()) {
- if (attrs.AttributeType.Name != "ProtocolAttribute" || attrs.AttributeType.Namespace != "MonoTouch.Foundation")
- continue;
- foreach (var na in attrs.NamedArguments) {
- if (na.Key.Name != "Name")
- continue;
- string name = na.Value.ConstantValue as string;
- if (name == null)
- break;
- var protocolType = Options.Document.Compilation.FindType (new FullTypeName (new TopLevelTypeName (t.Namespace, name)));
- if (protocolType == null)
- break;
- foreach (var member in protocolType.GetMembers ()) {
- if (member.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation"))
- yield return member;
- }
- }
+ string name;
+ if (!CSharpCodeGenerationService.HasProtocolAttribute (t, out name))
+ continue;
+ var protocolType = Options.Document.Compilation.FindType (new FullTypeName (new TopLevelTypeName (t.Namespace, name)));
+ if (protocolType == null)
+ break;
+ foreach (var member in protocolType.GetMethods (null, GetMemberOptions.IgnoreInheritedMembers)) {
+ if (member.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation"))
+ yield return member;
+ }
+ foreach (var member in protocolType.GetProperties (null, GetMemberOptions.IgnoreInheritedMembers)) {
+ if (member.CanGet && member.Getter.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation") ||
+ member.CanSet && member.Setter.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation"))
+ yield return member;
}
}
}
@@ -116,26 +115,54 @@ protected override IEnumerable<string> GenerateCode (List<object> includedMember
foreach (IMember member in includedMembers) {
var method = builder.ConvertEntity (member) as MethodDeclaration;
- method.Body = new BlockStatement () {
- new ThrowStatement (new ObjectCreateExpression (ctx.CreateShortType ("System", "NotImplementedException")))
- };
- var astType = ctx.CreateShortType ("MonoTouch.Foundation", "ExportAttribute");
- if (astType is SimpleType) {
- astType = new SimpleType ("Export");
- } else {
- astType = new MemberType (new MemberType (new SimpleType ("MonoTouch"), "Foundation"), "Export");
+ if (method != null) {
+ method.Body = new BlockStatement () {
+ new ThrowStatement (new ObjectCreateExpression (ctx.CreateShortType ("System", "NotImplementedException")))
+ };
+ method.Modifiers &= ~Modifiers.Virtual;
+ method.Modifiers &= ~Modifiers.Abstract;
+
+ method.Attributes.Add (new AttributeSection {
+ Attributes = { CSharpCodeGenerationService.GenerateExportAttribute (ctx, member) }
+ });
+ yield return method.ToString ();
+ continue;
}
+ var property = builder.ConvertEntity (member) as PropertyDeclaration;
+ if (property != null) {
+ var p = (IProperty)member;
+
+ var astType = ctx.CreateShortType ("MonoTouch.Foundation", "ExportAttribute");
+ if (astType is SimpleType) {
+ astType = new SimpleType ("Export");
+ } else {
+ astType = new MemberType (new MemberType (new SimpleType ("MonoTouch"), "Foundation"), "Export");
+ }
- var attr = new ICSharpCode.NRefactory.CSharp.Attribute {
- Type = astType,
- };
- method.Modifiers &= ~Modifiers.Virtual;
- var exportAttribute = member.GetAttribute (new FullTypeName (new TopLevelTypeName ("MonoTouch.Foundation", "ExportAttribute")));
- attr.Arguments.Add (new PrimitiveExpression (exportAttribute.PositionalArguments.First ().ConstantValue));
- method.Attributes.Add (new AttributeSection {
- Attributes = { attr }
- });
- yield return method.ToString ();
+ property.Modifiers &= ~Modifiers.Virtual;
+ property.Modifiers &= ~Modifiers.Abstract;
+
+ if (p.CanGet) {
+ property.Getter.Body = new BlockStatement () {
+ new ThrowStatement (new ObjectCreateExpression (ctx.CreateShortType ("System", "NotImplementedException")))
+ };
+
+ property.Getter.Attributes.Add (new AttributeSection {
+ Attributes = { CSharpCodeGenerationService.GenerateExportAttribute (ctx, p.Getter) }
+ });
+ }
+ if (p.CanSet) {
+ property.Setter.Body = new BlockStatement () {
+ new ThrowStatement (new ObjectCreateExpression (ctx.CreateShortType ("System", "NotImplementedException")))
+ };
+
+ property.Setter.Attributes.Add (new AttributeSection {
+ Attributes = { CSharpCodeGenerationService.GenerateExportAttribute (ctx, p.Setter) }
+ });
+ }
+ yield return property.ToString ();
+ continue;
+ }
}
}
}
Modified: main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerationService.cs
===================================================================
@@ -28,14 +28,111 @@
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.NRefactory.CSharp.Refactoring;
using System.Linq;
+using Atk;
+using Gdk;
namespace MonoDevelop.CSharp.Refactoring
{
public class CSharpCodeGenerationService : DefaultCodeGenerationService
{
+ public static bool HasProtocolAttribute (IType type, out string name)
+ {
+ foreach (var attrs in type.GetDefinition ().GetAttributes ()) {
+ if (attrs.AttributeType.Name == "ProtocolAttribute" && attrs.AttributeType.Namespace == "MonoTouch.Foundation") {
+ foreach (var na in attrs.NamedArguments) {
+ if (na.Key.Name != "Name")
+ continue;
+ name = na.Value.ConstantValue as string;
+ if (name != null)
+ return true;
+ }
+ }
+ }
+ name = null;
+ return false;
+ }
+
+ public static ICSharpCode.NRefactory.CSharp.Attribute GenerateExportAttribute (RefactoringContext ctx, IMember member)
+ {
+ if (member == null)
+ return null;
+ var astType = ctx.CreateShortType ("MonoTouch.Foundation", "ExportAttribute");
+ if (astType is SimpleType) {
+ astType = new SimpleType ("Export");
+ } else {
+ astType = new MemberType (new MemberType (new SimpleType ("MonoTouch"), "Foundation"), "Export");
+ }
+
+ var attr = new ICSharpCode.NRefactory.CSharp.Attribute {
+ Type = astType,
+ };
+ var exportAttribute = member.GetAttribute (new FullTypeName (new TopLevelTypeName ("MonoTouch.Foundation", "ExportAttribute")));
+ if (exportAttribute == null || exportAttribute.PositionalArguments.Count == 0)
+ return null;
+ attr.Arguments.Add (new PrimitiveExpression (exportAttribute.PositionalArguments.First ().ConstantValue));
+ return attr;
+
+ }
+
+ IMember GetProtocolMember (RefactoringContext ctx, IType protocolType, IMember member)
+ {
+ foreach (var m in protocolType.GetMembers (m => m.SymbolKind == member.SymbolKind && m.Name == member.Name)) {
+ if (!SignatureComparer.Ordinal.Equals (m, member))
+ return null;
+ var prop = m as IProperty;
+ if (prop != null) {
+ if (prop.CanGet && GenerateExportAttribute (ctx, prop.Getter) != null ||
+ prop.CanSet && GenerateExportAttribute (ctx, prop.Setter) != null)
+ return m;
+ } else {
+ if (GenerateExportAttribute (ctx, m) != null)
+ return m;
+ }
+ }
+ return null;
+ }
+
public override EntityDeclaration GenerateMemberImplementation (RefactoringContext context, IMember member, bool explicitImplementation)
{
var result = base.GenerateMemberImplementation (context, member, explicitImplementation);
+ string name;
+ if (HasProtocolAttribute (member.DeclaringType, out name)) {
+ var protocolType = context.Compilation.FindType (new FullTypeName (new TopLevelTypeName (member.DeclaringType.Namespace, name)));
+ if (protocolType != null) {
+ var property = result as PropertyDeclaration;
+ var protocolMember = GetProtocolMember (context, protocolType, member);
+ if (protocolMember != null) {
+ if (property != null) {
+ var ppm = (IProperty)protocolMember;
+ if (ppm.CanGet) {
+ var attr = CSharpCodeGenerationService.GenerateExportAttribute (context, ppm.Getter);
+ if (attr != null) {
+ property.Getter.Attributes.Add (new AttributeSection {
+ Attributes = { attr }
+ });
+ }
+ }
+
+ if (ppm.CanSet) {
+ var attr = CSharpCodeGenerationService.GenerateExportAttribute (context, ppm.Setter);
+ if (attr != null) {
+ property.Getter.Attributes.Add (new AttributeSection {
+ Attributes = { attr }
+ });
+ }
+ }
+ } else {
+ var attribute = CSharpCodeGenerationService.GenerateExportAttribute (context, protocolMember);
+ if (attribute != null) {
+ result.Attributes.Add (new AttributeSection {
+ Attributes = { attribute }
+ });
+ }
+ }
+ }
+ }
+ }
+
if (CSharpCodeGenerator.IsMonoTouchModelMember (member)) {
var m = result as MethodDeclaration;
if (m != null) {
Commit: 7cfdcc40383d764caad2c96817983c258abc31e4
Author: Lluis Sanchez <[email protected]> (slluis)
Date: 2013-10-01 14:34:27 GMT
URL: https://github.com/mono/monodevelop/commit/7cfdcc40383d764caad2c96817983c258abc31e4
Merge pull request #348 from LogosBible/master
Use SolutionConfigurationSelector when building a specific project in a solution.
Changed paths:
M main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildTool.cs
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildTool.cs
===================================================================
@@ -128,14 +128,26 @@ public int Run (string[] arguments)
if (config == null && configTarget != null)
config = configTarget.DefaultConfigurationId;
- ConfigurationSelector configuration;
- if (item is SolutionEntityItem)
- configuration = new ItemConfigurationSelector (config);
- else
- configuration = new SolutionConfigurationSelector (config);
-
monitor = new ConsoleProgressMonitor ();
- BuildResult res = item.RunTarget (monitor, command, configuration);
+ BuildResult res = null;
+ if (item is SolutionEntityItem && ((SolutionEntityItem)item).ParentSolution == null) {
+ ConfigurationSelector configuration = new ItemConfigurationSelector (config);
+ res = item.RunTarget (monitor, command, configuration);
+ } else {
+ ConfigurationSelector configuration = new SolutionConfigurationSelector (config);
+ SolutionEntityItem solutionEntityItem = item as SolutionEntityItem;
+ if (solutionEntityItem != null) {
+ if (command == ProjectService.BuildTarget)
+ res = solutionEntityItem.Build (monitor, configuration, true);
+ else if (command == ProjectService.CleanTarget)
+ solutionEntityItem.Clean (monitor, configuration);
+ else
+ res = item.RunTarget (monitor, command, configuration);
+ } else {
+ res = item.RunTarget (monitor, command, configuration);
+ }
+ }
+
if (targetRuntime != null)
{
Commit: 0aaf90dee1f706ebb78f2f13da818738dbb19550
Author: Therzok <[email protected]> (Therzok)
Date: 2013-10-01 15:30:21 GMT
URL: https://github.com/mono/monodevelop/commit/0aaf90dee1f706ebb78f2f13da818738dbb19550
[Git] Added support for adding a tag, pushing all tags and deleting a tag.
Changed paths:
M main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git.csproj
M main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditBranchDialog.cs
M main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitConfigurationDialog.cs
M main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs
M main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitUtil.cs
M main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/MonoDevelop.VersionControl.Git.GitConfigurationDialog.cs
M main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/gui.stetic
Added paths:
A main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitSelectRevisionDialog.cs
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git.csproj
===================================================================
@@ -85,6 +85,7 @@
<Compile Include="MonoDevelop.VersionControl.Git\UserGitConfigDialog.cs" />
<Compile Include="gtk-gui\MonoDevelop.VersionControl.Git.UserGitConfigDialog.cs" />
<Compile Include="MonoDevelop.VersionControl.Git\MyersDiff.cs" />
+ <Compile Include="MonoDevelop.VersionControl.Git\GitSelectRevisionDialog.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\core\Mono.Texteditor\Mono.TextEditor.csproj">
@@ -123,6 +124,11 @@
<Project>{849AE05D-0058-4A8C-A0E8-77DC6BB12E52}</Project>
<Name>Sharpen.Unix</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\..\..\external\xwt\Xwt\Xwt.csproj">
+ <Project>{92494904-35FA-4DC9-BDE9-3A3E87AC49D3}</Project>
+ <Name>Xwt</Name>
+ <Private>False</Private>
+ </ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="MonoDevelop.VersionControl.Git.addin.xml">
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditBranchDialog.cs
===================================================================
@@ -106,7 +106,7 @@ void UpdateStatus ()
labelError.Markup = "<span color='red'>" + GettextCatalog.GetString ("A branch with this name already exists") + "</span>";
labelError.Show ();
buttonOk.Sensitive = false;
- } else if (!IsValidBranchName (entryName.Text)) {
+ } else if (!GitUtil.IsValidBranchName (entryName.Text)) {
labelError.Markup = "<span color='red'>" + GettextCatalog.GetString (@"A branch name can not:
Start with '.' or end with '/' or '.lock'
Contain a ' ', '..', '~', '^', ':', '\', '?', '['") + "</span>";
@@ -116,19 +116,6 @@ void UpdateStatus ()
labelError.Hide ();
}
- static bool IsValidBranchName (string name)
- {
- // List from: https://github.com/git/git/blob/master/refs.c#L21
- if (name.StartsWith (".", System.StringComparison.Ordinal) ||
- name.EndsWith ("/", System.StringComparison.Ordinal) ||
- name.EndsWith (".lock", System.StringComparison.Ordinal))
- return false;
-
- if (name.Contains (" ") || name.Contains ("~") || name.Contains ("..") || name.Contains ("^") || name.Contains (":") || name.Contains ("\\") || name.Contains ("?") || name.Contains ("["))
- return false;
- return true;
- }
-
protected virtual void OnCheckTrackToggled (object sender, System.EventArgs e)
{
UpdateStatus ();
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitConfigurationDialog.cs
===================================================================
@@ -36,6 +36,7 @@ public partial class GitConfigurationDialog : Dialog
{
readonly GitRepository repo;
readonly ListStore storeBranches;
+ readonly ListStore storeTags;
readonly TreeStore storeRemotes;
public GitConfigurationDialog (GitRepository repo)
@@ -61,11 +62,20 @@ public GitConfigurationDialog (GitRepository repo)
treeRemotes.AppendColumn ("Remote Source / Branch", new CellRendererText (), "markup", 1);
treeRemotes.AppendColumn ("Url", new CellRendererText (), "text", 2);
+
+ // Tags list
+ storeTags = new ListStore (typeof(string));
+ listTags.Model = storeTags;
+ listTags.HeadersVisible = true;
+
+ listTags.AppendColumn (GettextCatalog.GetString ("Tag"), new CellRendererText (), "text", 0);
+
// Fill data
FillBranches ();
FillRemotes ();
+ FillTags ();
}
void FillBranches ()
@@ -100,6 +110,17 @@ void FillRemotes ()
}
state.Load ();
}
+
+ void FillTags ()
+ {
+ TreeViewState state = new TreeViewState (listTags, 1);
+ state.Save ();
+ storeTags.Clear ();
+ foreach (string tag in repo.GetTags ()) {
+ storeTags.AppendValues (tag);
+ }
+ state.Load ();
+ }
protected virtual void OnButtonAddBranchClicked (object sender, EventArgs e)
{
@@ -260,6 +281,37 @@ protected virtual void OnButtonTrackRemoteClicked (object sender, EventArgs e)
dlg.Destroy ();
}
}
+
+ protected void OnButtonNewTagClicked (object sender, EventArgs e)
+ {
+ // Create dialog with revisions of current branch.
+ // Select revision to tag at.
+ // Create tag.
+
+ using (var dlg = new GitSelectRevisionDialog (repo)) {
+ if (dlg.Run () != Xwt.Command.Ok)
+ return;
+
+ repo.AddTag (dlg.TagName, dlg.SelectedRevision, dlg.TagMessage);
+ FillTags ();
+ }
+ }
+
+ protected void OnButtonRemoveTagClicked (object sender, EventArgs e)
+ {
+ TreeIter it;
+ if (!listTags.Selection.GetSelected (out it))
+ return;
+
+ string tagName = (string) storeTags.GetValue (it, 0);
+ repo.RemoveTag (tagName);
+ FillTags ();
+ }
+
+ protected virtual void OnButtonPushTagClicked (object sender, EventArgs e)
+ {
+ repo.PushAllTags ();
+ }
}
}
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs
===================================================================
@@ -1418,6 +1418,28 @@ public IEnumerable<string> GetTags ()
}
}
+ public void AddTag (string name, Revision rev, string message)
+ {
+ var addTag = new NGit.Api.Git (RootRepository).Tag ();
+ var gitRev = (GitRevision)rev;
+
+ addTag.SetName (name).SetMessage (message).SetObjectId (gitRev.Commit);
+ addTag.SetObjectId (gitRev.Commit).SetTagger (new PersonIdent (RootRepository));
+ addTag.Call ();
+ }
+
+ public void RemoveTag (string name)
+ {
+ var deleteTag = new NGit.Api.Git (RootRepository).TagDelete ();
+ deleteTag.SetTags (name).Call ();
+ }
+
+ public void PushAllTags ()
+ {
+ var pushTags = new NGit.Api.Git (RootRepository).Push ();
+ pushTags.SetPushTags ().Call ();
+ }
+
public IEnumerable<string> GetRemoteBranches (string remoteName)
{
var list = new NGit.Api.Git (RootRepository).BranchList ().SetListMode (ListBranchCommand.ListMode.REMOTE);
Added: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitSelectRevisionDialog.cs
===================================================================
@@ -0,0 +1,152 @@
+//
+// GitSelectRevisionDialog.cs
+//
+// Author:
+// Therzok <[email protected]>
+//
+// Copyright (c) 2013 Therzok
+//
+// 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 System.Text;
+using MonoDevelop.VersionControl.Views;
+
+namespace MonoDevelop.VersionControl.Git
+{
+ class GitSelectRevisionDialog : Xwt.Dialog
+ {
+ readonly Xwt.TextEntry tagNameEntry;
+ readonly Xwt.TextEntry tagMessageEntry;
+
+ readonly Xwt.ListView revisionList;
+
+ readonly Xwt.ListStore revisionStore;
+ readonly Xwt.DataField<string> messageField;
+ readonly Xwt.ListViewColumn messageColumn;
+ readonly Xwt.DataField<string> dateField;
+ readonly Xwt.ListViewColumn dateColumn;
+ readonly Xwt.DataField<string> authorField;
+ readonly Xwt.ListViewColumn authorColumn;
+ readonly Xwt.DataField<string> shaField;
+ readonly Xwt.ListViewColumn shaColumn;
+ readonly Xwt.DataField<Revision> revisionField;
+ readonly Xwt.DialogButton buttonOk;
+
+ public GitSelectRevisionDialog (GitRepository repo)
+ {
+ Title = GettextCatalog.GetString ("Select a revision");
+
+ Xwt.VBox vbox = new Xwt.VBox ();
+ vbox.MinWidth = 350;
+ vbox.Spacing = 6;
+ vbox.Margin = 12;
+
+ vbox.PackStart(new Xwt.Label (GettextCatalog.GetString ("Tag Name")));
+
+ tagNameEntry = new Xwt.TextEntry ();
+ tagNameEntry.Changed += delegate {
+ CheckSensitive ();
+ };
+ vbox.PackStart (tagNameEntry);
+
+ vbox.PackStart (new Xwt.Label (GettextCatalog.GetString ("Tag Message")));
+
+ tagMessageEntry = new Xwt.TextEntry ();
+ vbox.PackStart (tagMessageEntry);
+
+ revisionList = new Xwt.ListView ();
+ messageField = new Xwt.DataField<string> ();
+ dateField = new Xwt.DataField<string> ();
+ authorField = new Xwt.DataField<string> ();
+ shaField = new Xwt.DataField<string> ();
+ revisionField = new Xwt.DataField<Revision> ();
+
+ revisionStore = new Xwt.ListStore (messageField, dateField, authorField, shaField, revisionField);
+ revisionList.DataSource = revisionStore;
+
+ messageColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Message"), new Xwt.TextCellView (messageField));
+ revisionList.Columns.Add (messageColumn);
+ dateColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Date"), new Xwt.TextCellView (dateField));
+ revisionList.Columns.Add (dateColumn);
+ authorColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Author"), new Xwt.TextCellView (authorField));
+ revisionList.Columns.Add (authorColumn);
+ shaColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Revision"), new Xwt.TextCellView (shaField));
+ revisionList.Columns.Add (shaColumn);
+
+ var history = repo.GetHistory (repo.RootPath, null);
+ for (int i = 0; i < history.Length; ++i) {
+ var rev = history [i];
+
+ revisionStore.AddRow ();
+ // Temporary fix until we have ellipsize.
+ revisionStore.SetValue (i, messageField, rev.ShortMessage.Length < 40 ? rev.ShortMessage : rev.ShortMessage.Substring (0, 39));
+ revisionStore.SetValue (i, dateField, ParseDate (rev.Time));
+ revisionStore.SetValue (i, authorField, rev.Author);
+ revisionStore.SetValue (i, shaField, ((GitRevision)rev).ShortName);
+ revisionStore.SetValue (i, revisionField, rev);
+ }
+
+ revisionList.SelectionChanged += delegate {
+ CheckSensitive ();
+ };
+
+ vbox.PackStart (revisionList, true, true);
+
+ Content = vbox;
+
+ buttonOk = new Xwt.DialogButton (Xwt.Command.Ok) {
+ Sensitive = false
+ };
+ Buttons.Add (buttonOk);
+ Buttons.Add (new Xwt.DialogButton (Xwt.Command.Cancel));
+ }
+
+ void CheckSensitive ()
+ {
+ if (!String.IsNullOrWhiteSpace (tagNameEntry.Text) && GitUtil.IsValidBranchName (tagNameEntry.Text) &&
+ revisionList.SelectedRow != -1) {
+ buttonOk.Sensitive = true;
+ return;
+ }
+ buttonOk.Sensitive = false;
+ }
+
+ static string ParseDate (DateTime date)
+ {
+ StringBuilder sb = new StringBuilder (date.ToShortDateString ());
+ sb.AppendFormat (" {0}", date.ToString ("HH:MM"));
+
+ return sb.ToString ();
+ }
+
+ internal string TagName {
+ get { return tagNameEntry.Text; }
+ }
+
+ internal string TagMessage {
+ get { return tagMessageEntry.Text; }
+ }
+
+ internal Revision SelectedRevision {
+ get { return revisionStore.GetValue (revisionList.SelectedRow, revisionField); }
+ }
+ }
+}
+
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitUtil.cs
===================================================================
@@ -37,6 +37,7 @@
using NGit.Transport;
using NGit.Diff;
using NGit.Internal;
+using System;
namespace MonoDevelop.VersionControl.Git
{
@@ -372,6 +373,20 @@ internal static bool IsGitRepository (this FilePath path)
var newPath = path.Combine (".git");
return Directory.Exists (newPath) && Directory.Exists (newPath.Combine ("objects")) && Directory.Exists (newPath.Combine ("refs"));
}
+
+ public static bool IsValidBranchName (string name)
+ {
+ // List from: https://github.com/git/git/blob/master/refs.c#L21
+ if (name.StartsWith (".", StringComparison.Ordinal) ||
+ name.EndsWith ("/", StringComparison.Ordinal) ||
+ name.EndsWith (".lock", StringComparison.Ordinal))
+ return false;
+
+ if (name.Contains (" ") || name.Contains ("~") || name.Contains ("..") || name.Contains ("^") ||
+ name.Contains (":") || name.Contains ("\\") || name.Contains ("?") || name.Contains ("["))
+ return false;
+ return true;
+ }
}
}
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/MonoDevelop.VersionControl.Git.GitConfigurationDialog.cs
===================================================================
@@ -15,6 +15,15 @@ public partial class GitConfigurationDialog
private global::Gtk.Button buttonRemoveBranch;
private global::Gtk.Button buttonSetDefaultBranch;
private global::Gtk.Label label1;
+ private global::Gtk.VBox vbox6;
+ private global::Gtk.HBox hbox3;
+ private global::Gtk.ScrolledWindow GtkScrolledWindow2;
+ private global::Gtk.TreeView listTags;
+ private global::Gtk.VBox vbox7;
+ private global::Gtk.Button buttonAddTag;
+ private global::Gtk.Button buttonPushTag;
+ private global::Gtk.Button buttonRemoveTag;
+ private global::Gtk.Label label5;
private global::Gtk.VBox vbox4;
private global::Gtk.HBox hbox2;
private global::Gtk.ScrolledWindow GtkScrolledWindow1;
@@ -27,7 +36,7 @@ public partial class GitConfigurationDialog
private global::Gtk.Button buttonTrackRemote;
private global::Gtk.Label label2;
private global::Gtk.Button buttonOk;
-
+
protected virtual void Build ()
{
global::Stetic.Gui.Initialize (this);
@@ -133,6 +142,83 @@ protected virtual void Build ()
this.notebook1.SetTabLabel (this.vbox2, this.label1);
this.label1.ShowAll ();
// Container child notebook1.Gtk.Notebook+NotebookChild
+ this.vbox6 = new global::Gtk.VBox ();
+ this.vbox6.Name = "vbox6";
+ this.vbox6.Spacing = 6;
+ this.vbox6.BorderWidth = ((uint)(9));
+ // Container child vbox6.Gtk.Box+BoxChild
+ this.hbox3 = new global::Gtk.HBox ();
+ this.hbox3.Name = "hbox3";
+ this.hbox3.Spacing = 6;
+ // Container child hbox3.Gtk.Box+BoxChild
+ this.GtkScrolledWindow2 = new global::Gtk.ScrolledWindow ();
+ this.GtkScrolledWindow2.Name = "GtkScrolledWindow2";
+ this.GtkScrolledWindow2.ShadowType = ((global::Gtk.ShadowType)(1));
+ // Container child GtkScrolledWindow2.Gtk.Container+ContainerChild
+ this.listTags = new global::Gtk.TreeView ();
+ this.listTags.CanFocus = true;
+ this.listTags.Name = "listTags";
+ this.GtkScrolledWindow2.Add (this.listTags);
+ this.hbox3.Add (this.GtkScrolledWindow2);
+ global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.GtkScrolledWindow2]));
+ w12.Position = 0;
+ // Container child hbox3.Gtk.Box+BoxChild
+ this.vbox7 = new global::Gtk.VBox ();
+ this.vbox7.Name = "vbox7";
+ this.vbox7.Spacing = 6;
+ // Container child vbox7.Gtk.Box+BoxChild
+ this.buttonAddTag = new global::Gtk.Button ();
+ this.buttonAddTag.CanFocus = true;
+ this.buttonAddTag.Name = "buttonAddTag";
+ this.buttonAddTag.UseStock = true;
+ this.buttonAddTag.UseUnderline = true;
+ this.buttonAddTag.Label = "gtk-new";
+ this.vbox7.Add (this.buttonAddTag);
+ global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox7 [this.buttonAddTag]));
+ w13.Position = 0;
+ w13.Expand = false;
+ w13.Fill = false;
+ // Container child vbox7.Gtk.Box+BoxChild
+ this.buttonPushTag = new global::Gtk.Button ();
+ this.buttonPushTag.CanFocus = true;
+ this.buttonPushTag.Name = "buttonPushTag";
+ this.buttonPushTag.UseUnderline = true;
+ this.buttonPushTag.Label = global::Mono.Unix.Catalog.GetString ("_Push");
+ this.vbox7.Add (this.buttonPushTag);
+ global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox7 [this.buttonPushTag]));
+ w14.Position = 1;
+ w14.Expand = false;
+ w14.Fill = false;
+ // Container child vbox7.Gtk.Box+BoxChild
+ this.buttonRemoveTag = new global::Gtk.Button ();
+ this.buttonRemoveTag.CanFocus = true;
+ this.buttonRemoveTag.Name = "buttonRemoveTag";
+ this.buttonRemoveTag.UseStock = true;
+ this.buttonRemoveTag.UseUnderline = true;
+ this.buttonRemoveTag.Label = "gtk-delete";
+ this.vbox7.Add (this.buttonRemoveTag);
+ global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox7 [this.buttonRemoveTag]));
+ w15.Position = 2;
+ w15.Expand = false;
+ w15.Fill = false;
+ this.hbox3.Add (this.vbox7);
+ global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.vbox7]));
+ w16.Position = 1;
+ w16.Expand = false;
+ w16.Fill = false;
+ this.vbox6.Add (this.hbox3);
+ global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.hbox3]));
+ w17.Position = 0;
+ this.notebook1.Add (this.vbox6);
+ global::Gtk.Notebook.NotebookChild w18 = ((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.vbox6]));
+ w18.Position = 1;
+ // Notebook tab
+ this.label5 = new global::Gtk.Label ();
+ this.label5.Name = "label5";
+ this.label5.LabelProp = global::Mono.Unix.Catalog.GetString ("Tags");
+ this.notebook1.SetTabLabel (this.vbox6, this.label5);
+ this.label5.ShowAll ();
+ // Container child notebook1.Gtk.Notebook+NotebookChild
this.vbox4 = new global::Gtk.VBox ();
this.vbox4.Name = "vbox4";
this.vbox4.Spacing = 6;
@@ -151,8 +237,8 @@ protected virtual void Build ()
this.treeRemotes.Name = "treeRemotes";
this.GtkScrolledWindow1.Add (this.treeRemotes);
this.hbox2.Add (this.GtkScrolledWindow1);
- global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.GtkScrolledWindow1]));
- w12.Position = 0;
+ global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.GtkScrolledWindow1]));
+ w20.Position = 0;
// Container child hbox2.Gtk.Box+BoxChild
this.vbox5 = new global::Gtk.VBox ();
this.vbox5.Name = "vbox5";
@@ -165,10 +251,10 @@ protected virtual void Build ()
this.buttonAddRemote.UseUnderline = true;
this.buttonAddRemote.Label = "gtk-add";
this.vbox5.Add (this.buttonAddRemote);
- global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.buttonAddRemote]));
- w13.Position = 0;
- w13.Expand = false;
- w13.Fill = false;
+ global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.buttonAddRemote]));
+ w21.Position = 0;
+ w21.Expand = false;
+ w21.Fill = false;
// Container child vbox5.Gtk.Box+BoxChild
this.buttonEditRemote = new global::Gtk.Button ();
this.buttonEditRemote.CanFocus = true;
@@ -177,10 +263,10 @@ protected virtual void Build ()
this.buttonEditRemote.UseUnderline = true;
this.buttonEditRemote.Label = "gtk-edit";
this.vbox5.Add (this.buttonEditRemote);
- global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.buttonEditRemote]));
- w14.Position = 1;
- w14.Expand = false;
- w14.Fill = false;
+ global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.buttonEditRemote]));
+ w22.Position = 1;
+ w22.Expand = false;
+ w22.Fill = false;
// Container child vbox5.Gtk.Box+BoxChild
this.buttonRemoveRemote = new global::Gtk.Button ();
this.buttonRemoveRemote.CanFocus = true;
@@ -189,18 +275,18 @@ protected virtual void Build ()
this.buttonRemoveRemote.UseUnderline = true;
this.buttonRemoveRemote.Label = "gtk-remove";
this.vbox5.Add (this.buttonRemoveRemote);
- global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.buttonRemoveRemote]));
- w15.Position = 2;
- w15.Expand = false;
- w15.Fill = false;
+ global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.buttonRemoveRemote]));
+ w23.Position = 2;
+ w23.Expand = false;
+ w23.Fill = false;
// Container child vbox5.Gtk.Box+BoxChild
this.hseparator2 = new global::Gtk.HSeparator ();
this.hseparator2.Name = "hseparator2";
this.vbox5.Add (this.hseparator2);
- global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hseparator2]));
- w16.Position = 3;
- w16.Expand = false;
- w16.Fill = false;
+ global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hseparator2]));
+ w24.Position = 3;
+ w24.Expand = false;
+ w24.Fill = false;
// Container child vbox5.Gtk.Box+BoxChild
this.buttonTrackRemote = new global::Gtk.Button ();
this.buttonTrackRemote.CanFocus = true;
@@ -208,21 +294,21 @@ protected virtual void Build ()
this.buttonTrackRemote.UseUnderline = true;
this.buttonTrackRemote.Label = global::Mono.Unix.Catalog.GetString ("Track in Local Branch");
this.vbox5.Add (this.buttonTrackRemote);
- global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.buttonTrackRemote]));
- w17.Position = 4;
- w17.Expand = false;
- w17.Fill = false;
+ global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.buttonTrackRemote]));
+ w25.Position = 4;
+ w25.Expand = false;
+ w25.Fill = false;
this.hbox2.Add (this.vbox5);
- global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.vbox5]));
- w18.Position = 1;
- w18.Expand = false;
- w18.Fill = false;
+ global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.vbox5]));
+ w26.Position = 1;
+ w26.Expand = false;
+ w26.Fill = false;
this.vbox4.Add (this.hbox2);
- global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.hbox2]));
- w19.Position = 0;
+ global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.hbox2]));
+ w27.Position = 0;
this.notebook1.Add (this.vbox4);
- global::Gtk.Notebook.NotebookChild w20 = ((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.vbox4]));
- w20.Position = 1;
+ global::Gtk.Notebook.NotebookChild w28 = ((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.vbox4]));
+ w28.Position = 2;
// Notebook tab
this.label2 = new global::Gtk.Label ();
this.label2.Name = "label2";
@@ -230,14 +316,14 @@ protected virtual void Build ()
this.notebook1.SetTabLabel (this.vbox4, this.label2);
this.label2.ShowAll ();
w1.Add (this.notebook1);
- global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(w1 [this.notebook1]));
- w21.Position = 0;
+ global::Gtk.Box.BoxChild w29 = ((global::Gtk.Box.BoxChild)(w1 [this.notebook1]));
+ w29.Position = 0;
// Internal child MonoDevelop.VersionControl.Git.GitConfigurationDialog.ActionArea
- global::Gtk.HButtonBox w22 = this.ActionArea;
- w22.Name = "dialog1_ActionArea";
- w22.Spacing = 10;
- w22.BorderWidth = ((uint)(5));
- w22.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
+ global::Gtk.HButtonBox w30 = this.ActionArea;
+ w30.Name = "dialog1_ActionArea";
+ w30.Spacing = 10;
+ w30.BorderWidth = ((uint)(5));
+ w30.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
this.buttonOk = new global::Gtk.Button ();
this.buttonOk.CanDefault = true;
@@ -247,9 +333,9 @@ protected virtual void Build ()
this.buttonOk.UseUnderline = true;
this.buttonOk.Label = "gtk-close";
this.AddActionWidget (this.buttonOk, -7);
- global::Gtk.ButtonBox.ButtonBoxChild w23 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w22 [this.buttonOk]));
- w23.Expand = false;
- w23.Fill = false;
+ global::Gtk.ButtonBox.ButtonBoxChild w31 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w30 [this.buttonOk]));
+ w31.Expand = false;
+ w31.Fill = false;
if ((this.Child != null)) {
this.Child.ShowAll ();
}
@@ -260,6 +346,9 @@ protected virtual void Build ()
this.buttonEditBranch.Clicked += new global::System.EventHandler (this.OnButtonEditBranchClicked);
this.buttonRemoveBranch.Clicked += new global::System.EventHandler (this.OnButtonRemoveBranchClicked);
this.buttonSetDefaultBranch.Clicked += new global::System.EventHandler (this.OnButtonSetDefaultBranchClicked);
+ this.buttonAddTag.Clicked += new global::System.EventHandler (this.OnButtonNewTagClicked);
+ this.buttonPushTag.Clicked += new global::System.EventHandler (this.OnButtonPushTagClicked);
+ this.buttonRemoveTag.Clicked += new global::System.EventHandler (this.OnButtonRemoveTagClicked);
this.buttonAddRemote.Clicked += new global::System.EventHandler (this.OnButtonAddRemoteClicked);
this.buttonEditRemote.Clicked += new global::System.EventHandler (this.OnButtonEditRemoteClicked);
this.buttonRemoveRemote.Clicked += new global::System.EventHandler (this.OnButtonRemoveRemoteClicked);
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/gui.stetic
===================================================================
@@ -571,6 +571,112 @@
</packing>
</child>
<child>
+ <widget class="Gtk.VBox" id="vbox6">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <property name="BorderWidth">9</property>
+ <child>
+ <widget class="Gtk.HBox" id="hbox3">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow2">
+ <property name="MemberName" />
+ <property name="ShadowType">In</property>
+ <child>
+ <widget class="Gtk.TreeView" id="listTags">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="ShowScrollbars">True</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.VBox" id="vbox7">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Button" id="buttonAddTag">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="UseStock">True</property>
+ <property name="Type">StockItem</property>
+ <property name="StockId">gtk-new</property>
+ <signal name="Clicked" handler="OnButtonNewTagClicked" />
+ <property name="label">gtk-new</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="buttonPushTag">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Type">TextOnly</property>
+ <property name="Label" translatable="yes">_Push All Tags</property>
+ <property name="UseUnderline">True</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="buttonRemoveTag">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="UseStock">True</property>
+ <property name="Type">StockItem</property>
+ <property name="StockId">gtk-delete</property>
+ <property name="label">gtk-delete</property>
+ </widget>
+ <packing>
+ <property name="Position">2</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="label5">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">Tags</property>
+ </widget>
+ <packing>
+ <property name="type">tab</property>
+ </packing>
+ </child>
+ <child>
<widget class="Gtk.VBox" id="vbox4">
<property name="MemberName" />
<property name="Spacing">6</property>
@@ -694,7 +800,7 @@
</child>
</widget>
<packing>
- <property name="Position">1</property>
+ <property name="Position">2</property>
</packing>
</child>
<child>
Commit: 96bb5bd501f8604979a3f58ac25a189de7ac61a6
Author: Therzok <[email protected]> (Therzok)
Date: 2013-10-01 15:30:22 GMT
URL: https://github.com/mono/monodevelop/commit/96bb5bd501f8604979a3f58ac25a189de7ac61a6
[Git] Made select revision message ellipsized.
Changed paths:
M main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitSelectRevisionDialog.cs
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitSelectRevisionDialog.cs
===================================================================
@@ -81,8 +81,11 @@ public GitSelectRevisionDialog (GitRepository repo)
revisionStore = new Xwt.ListStore (messageField, dateField, authorField, shaField, revisionField);
revisionList.DataSource = revisionStore;
- messageColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Message"), new Xwt.TextCellView (messageField));
+ var message = new Xwt.TextCellView (messageField);
+ message.Ellipsize = Xwt.EllipsizeMode.End;
+ messageColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Message"), message);
revisionList.Columns.Add (messageColumn);
+
dateColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Date"), new Xwt.TextCellView (dateField));
revisionList.Columns.Add (dateColumn);
authorColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Author"), new Xwt.TextCellView (authorField));
Commit: dd787dbda2edc6706981da8158ecab392b6281ec
Author: Therzok <[email protected]> (Therzok)
Date: 2013-10-01 15:30:22 GMT
URL: https://github.com/mono/monodevelop/commit/dd787dbda2edc6706981da8158ecab392b6281ec
[Git] Refactor tag list a bit.
Changed paths:
M main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitSelectRevisionDialog.cs
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitSelectRevisionDialog.cs
===================================================================
@@ -54,9 +54,6 @@ public GitSelectRevisionDialog (GitRepository repo)
Title = GettextCatalog.GetString ("Select a revision");
Xwt.VBox vbox = new Xwt.VBox ();
- vbox.MinWidth = 350;
- vbox.Spacing = 6;
- vbox.Margin = 12;
vbox.PackStart(new Xwt.Label (GettextCatalog.GetString ("Tag Name")));
@@ -81,11 +78,8 @@ public GitSelectRevisionDialog (GitRepository repo)
revisionStore = new Xwt.ListStore (messageField, dateField, authorField, shaField, revisionField);
revisionList.DataSource = revisionStore;
- var message = new Xwt.TextCellView (messageField);
- message.Ellipsize = Xwt.EllipsizeMode.End;
- messageColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Message"), message);
+ messageColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Message"), new Xwt.TextCellView (messageField) { Ellipsize = Xwt.EllipsizeMode.End });
revisionList.Columns.Add (messageColumn);
-
dateColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Date"), new Xwt.TextCellView (dateField));
revisionList.Columns.Add (dateColumn);
authorColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Author"), new Xwt.TextCellView (authorField));
@@ -94,12 +88,13 @@ public GitSelectRevisionDialog (GitRepository repo)
revisionList.Columns.Add (shaColumn);
var history = repo.GetHistory (repo.RootPath, null);
- for (int i = 0; i < history.Length; ++i) {
+ var min = Math.Min (history.Length, 150);
+ for (int i = 0; i < min; ++i) {
var rev = history [i];
+ // Convert to foreach and use i = AddRow ();
revisionStore.AddRow ();
- // Temporary fix until we have ellipsize.
- revisionStore.SetValue (i, messageField, rev.ShortMessage.Length < 40 ? rev.ShortMessage : rev.ShortMessage.Substring (0, 39));
+ revisionStore.SetValue (i, messageField, rev.ShortMessage);
revisionStore.SetValue (i, dateField, ParseDate (rev.Time));
revisionStore.SetValue (i, authorField, rev.Author);
revisionStore.SetValue (i, shaField, ((GitRevision)rev).ShortName);
Commit: 177a6d176cc1c37593e7e64aaebaa7399a0304d1
Author: Therzok <[email protected]> (Therzok)
Date: 2013-10-01 15:54:19 GMT
URL: https://github.com/mono/monodevelop/commit/177a6d176cc1c37593e7e64aaebaa7399a0304d1
[Git] Tag list added minimum size.
Changed paths:
M main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditBranchDialog.cs
M main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitSelectRevisionDialog.cs
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditBranchDialog.cs
===================================================================
@@ -45,10 +45,10 @@ public EditBranchDialog (GitRepository repo, Branch branch, bool isNew)
comboStore = new ListStore (typeof(string), typeof(Gdk.Pixbuf), typeof (string));
comboSources.Model = comboStore;
- CellRendererPixbuf crp = new CellRendererPixbuf ();
+ var crp = new CellRendererPixbuf ();
comboSources.PackStart (crp, false);
comboSources.AddAttribute (crp, "pixbuf", 1);
- CellRendererText crt = new CellRendererText ();
+ var crt = new CellRendererText ();
comboSources.PackStart (crt, true);
comboSources.AddAttribute (crt, "text", 2);
@@ -57,8 +57,7 @@ public EditBranchDialog (GitRepository repo, Branch branch, bool isNew)
oldName = branch.Name;
currentTracking = branch.Tracking;
entryName.Text = branch.Name;
- if (currentTracking != null)
- checkTrack.Active = true;
+ checkTrack.Active = currentTracking != null;
}
foreach (Branch b in repo.GetBranches ()) {
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitSelectRevisionDialog.cs
===================================================================
@@ -26,7 +26,6 @@
using System;
using MonoDevelop.Core;
using System.Text;
-using MonoDevelop.VersionControl.Views;
namespace MonoDevelop.VersionControl.Git
{
@@ -53,7 +52,9 @@ public GitSelectRevisionDialog (GitRepository repo)
{
Title = GettextCatalog.GetString ("Select a revision");
- Xwt.VBox vbox = new Xwt.VBox ();
+ var vbox = new Xwt.VBox ();
+ vbox.MinHeight = 400;
+ vbox.MinWidth = 600;
vbox.PackStart(new Xwt.Label (GettextCatalog.GetString ("Tag Name")));
@@ -128,7 +129,7 @@ void CheckSensitive ()
static string ParseDate (DateTime date)
{
- StringBuilder sb = new StringBuilder (date.ToShortDateString ());
+ var sb = new StringBuilder (date.ToShortDateString ());
sb.AppendFormat (" {0}", date.ToString ("HH:MM"));
return sb.ToString ();
Commit: ffc2790e2a32bdeb6b0e6aa9f0a12769fc9306f2
Author: Ungureanu Marius <[email protected]> (Therzok)
Date: 2013-10-01 15:55:25 GMT
URL: https://github.com/mono/monodevelop/commit/ffc2790e2a32bdeb6b0e6aa9f0a12769fc9306f2
Merge pull request #395 from mono/tagList
[Git] Added support for adding a tag, pushing all tags and deleting a tag.
Changed paths:
M main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git.csproj
M main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditBranchDialog.cs
M main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitConfigurationDialog.cs
M main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs
M main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitUtil.cs
M main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/MonoDevelop.VersionControl.Git.GitConfigurationDialog.cs
M main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/gui.stetic
Added paths:
A main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitSelectRevisionDialog.cs
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git.csproj
===================================================================
@@ -85,6 +85,7 @@
<Compile Include="MonoDevelop.VersionControl.Git\UserGitConfigDialog.cs" />
<Compile Include="gtk-gui\MonoDevelop.VersionControl.Git.UserGitConfigDialog.cs" />
<Compile Include="MonoDevelop.VersionControl.Git\MyersDiff.cs" />
+ <Compile Include="MonoDevelop.VersionControl.Git\GitSelectRevisionDialog.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\core\Mono.Texteditor\Mono.TextEditor.csproj">
@@ -123,6 +124,11 @@
<Project>{849AE05D-0058-4A8C-A0E8-77DC6BB12E52}</Project>
<Name>Sharpen.Unix</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\..\..\external\xwt\Xwt\Xwt.csproj">
+ <Project>{92494904-35FA-4DC9-BDE9-3A3E87AC49D3}</Project>
+ <Name>Xwt</Name>
+ <Private>False</Private>
+ </ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="MonoDevelop.VersionControl.Git.addin.xml">
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditBranchDialog.cs
===================================================================
@@ -45,10 +45,10 @@ public EditBranchDialog (GitRepository repo, Branch branch, bool isNew)
comboStore = new ListStore (typeof(string), typeof(Gdk.Pixbuf), typeof (string));
comboSources.Model = comboStore;
- CellRendererPixbuf crp = new CellRendererPixbuf ();
+ var crp = new CellRendererPixbuf ();
comboSources.PackStart (crp, false);
comboSources.AddAttribute (crp, "pixbuf", 1);
- CellRendererText crt = new CellRendererText ();
+ var crt = new CellRendererText ();
comboSources.PackStart (crt, true);
comboSources.AddAttribute (crt, "text", 2);
@@ -57,8 +57,7 @@ public EditBranchDialog (GitRepository repo, Branch branch, bool isNew)
oldName = branch.Name;
currentTracking = branch.Tracking;
entryName.Text = branch.Name;
- if (currentTracking != null)
- checkTrack.Active = true;
+ checkTrack.Active = currentTracking != null;
}
foreach (Branch b in repo.GetBranches ()) {
@@ -106,7 +105,7 @@ void UpdateStatus ()
labelError.Markup = "<span color='red'>" + GettextCatalog.GetString ("A branch with this name already exists") + "</span>";
labelError.Show ();
buttonOk.Sensitive = false;
- } else if (!IsValidBranchName (entryName.Text)) {
+ } else if (!GitUtil.IsValidBranchName (entryName.Text)) {
labelError.Markup = "<span color='red'>" + GettextCatalog.GetString (@"A branch name can not:
Start with '.' or end with '/' or '.lock'
Contain a ' ', '..', '~', '^', ':', '\', '?', '['") + "</span>";
@@ -116,19 +115,6 @@ void UpdateStatus ()
labelError.Hide ();
}
- static bool IsValidBranchName (string name)
- {
- // List from: https://github.com/git/git/blob/master/refs.c#L21
- if (name.StartsWith (".", System.StringComparison.Ordinal) ||
- name.EndsWith ("/", System.StringComparison.Ordinal) ||
- name.EndsWith (".lock", System.StringComparison.Ordinal))
- return false;
-
- if (name.Contains (" ") || name.Contains ("~") || name.Contains ("..") || name.Contains ("^") || name.Contains (":") || name.Contains ("\\") || name.Contains ("?") || name.Contains ("["))
- return false;
- return true;
- }
-
protected virtual void OnCheckTrackToggled (object sender, System.EventArgs e)
{
UpdateStatus ();
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitConfigurationDialog.cs
===================================================================
@@ -36,6 +36,7 @@ public partial class GitConfigurationDialog : Dialog
{
readonly GitRepository repo;
readonly ListStore storeBranches;
+ readonly ListStore storeTags;
readonly TreeStore storeRemotes;
public GitConfigurationDialog (GitRepository repo)
@@ -61,11 +62,20 @@ public GitConfigurationDialog (GitRepository repo)
treeRemotes.AppendColumn ("Remote Source / Branch", new CellRendererText (), "markup", 1);
treeRemotes.AppendColumn ("Url", new CellRendererText (), "text", 2);
+
+ // Tags list
+ storeTags = new ListStore (typeof(string));
+ listTags.Model = storeTags;
+ listTags.HeadersVisible = true;
+
+ listTags.AppendColumn (GettextCatalog.GetString ("Tag"), new CellRendererText (), "text", 0);
+
// Fill data
FillBranches ();
FillRemotes ();
+ FillTags ();
}
void FillBranches ()
@@ -100,6 +110,17 @@ void FillRemotes ()
}
state.Load ();
}
+
+ void FillTags ()
+ {
+ TreeViewState state = new TreeViewState (listTags, 1);
+ state.Save ();
+ storeTags.Clear ();
+ foreach (string tag in repo.GetTags ()) {
+ storeTags.AppendValues (tag);
+ }
+ state.Load ();
+ }
protected virtual void OnButtonAddBranchClicked (object sender, EventArgs e)
{
@@ -260,6 +281,37 @@ protected virtual void OnButtonTrackRemoteClicked (object sender, EventArgs e)
dlg.Destroy ();
}
}
+
+ protected void OnButtonNewTagClicked (object sender, EventArgs e)
+ {
+ // Create dialog with revisions of current branch.
+ // Select revision to tag at.
+ // Create tag.
+
+ using (var dlg = new GitSelectRevisionDialog (repo)) {
+ if (dlg.Run () != Xwt.Command.Ok)
+ return;
+
+ repo.AddTag (dlg.TagName, dlg.SelectedRevision, dlg.TagMessage);
+ FillTags ();
+ }
+ }
+
+ protected void OnButtonRemoveTagClicked (object sender, EventArgs e)
+ {
+ TreeIter it;
+ if (!listTags.Selection.GetSelected (out it))
+ return;
+
+ string tagName = (string) storeTags.GetValue (it, 0);
+ repo.RemoveTag (tagName);
+ FillTags ();
+ }
+
+ protected virtual void OnButtonPushTagClicked (object sender, EventArgs e)
+ {
+ repo.PushAllTags ();
+ }
}
}
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs
===================================================================
@@ -1418,6 +1418,28 @@ public IEnumerable<string> GetTags ()
}
}
+ public void AddTag (string name, Revision rev, string message)
+ {
+ var addTag = new NGit.Api.Git (RootRepository).Tag ();
+ var gitRev = (GitRevision)rev;
+
+ addTag.SetName (name).SetMessage (message).SetObjectId (gitRev.Commit);
+ addTag.SetObjectId (gitRev.Commit).SetTagger (new PersonIdent (RootRepository));
+ addTag.Call ();
+ }
+
+ public void RemoveTag (string name)
+ {
+ var deleteTag = new NGit.Api.Git (RootRepository).TagDelete ();
+ deleteTag.SetTags (name).Call ();
+ }
+
+ public void PushAllTags ()
+ {
+ var pushTags = new NGit.Api.Git (RootRepository).Push ();
+ pushTags.SetPushTags ().Call ();
+ }
+
public IEnumerable<string> GetRemoteBranches (string remoteName)
{
var list = new NGit.Api.Git (RootRepository).BranchList ().SetListMode (ListBranchCommand.ListMode.REMOTE);
Added: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitSelectRevisionDialog.cs
===================================================================
@@ -0,0 +1,151 @@
+//
+// GitSelectRevisionDialog.cs
+//
+// Author:
+// Therzok <[email protected]>
+//
+// Copyright (c) 2013 Therzok
+//
+// 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 System.Text;
+
+namespace MonoDevelop.VersionControl.Git
+{
+ class GitSelectRevisionDialog : Xwt.Dialog
+ {
+ readonly Xwt.TextEntry tagNameEntry;
+ readonly Xwt.TextEntry tagMessageEntry;
+
+ readonly Xwt.ListView revisionList;
+
+ readonly Xwt.ListStore revisionStore;
+ readonly Xwt.DataField<string> messageField;
+ readonly Xwt.ListViewColumn messageColumn;
+ readonly Xwt.DataField<string> dateField;
+ readonly Xwt.ListViewColumn dateColumn;
+ readonly Xwt.DataField<string> authorField;
+ readonly Xwt.ListViewColumn authorColumn;
+ readonly Xwt.DataField<string> shaField;
+ readonly Xwt.ListViewColumn shaColumn;
+ readonly Xwt.DataField<Revision> revisionField;
+ readonly Xwt.DialogButton buttonOk;
+
+ public GitSelectRevisionDialog (GitRepository repo)
+ {
+ Title = GettextCatalog.GetString ("Select a revision");
+
+ var vbox = new Xwt.VBox ();
+ vbox.MinHeight = 400;
+ vbox.MinWidth = 600;
+
+ vbox.PackStart(new Xwt.Label (GettextCatalog.GetString ("Tag Name")));
+
+ tagNameEntry = new Xwt.TextEntry ();
+ tagNameEntry.Changed += delegate {
+ CheckSensitive ();
+ };
+ vbox.PackStart (tagNameEntry);
+
+ vbox.PackStart (new Xwt.Label (GettextCatalog.GetString ("Tag Message")));
+
+ tagMessageEntry = new Xwt.TextEntry ();
+ vbox.PackStart (tagMessageEntry);
+
+ revisionList = new Xwt.ListView ();
+ messageField = new Xwt.DataField<string> ();
+ dateField = new Xwt.DataField<string> ();
+ authorField = new Xwt.DataField<string> ();
+ shaField = new Xwt.DataField<string> ();
+ revisionField = new Xwt.DataField<Revision> ();
+
+ revisionStore = new Xwt.ListStore (messageField, dateField, authorField, shaField, revisionField);
+ revisionList.DataSource = revisionStore;
+
+ messageColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Message"), new Xwt.TextCellView (messageField) { Ellipsize = Xwt.EllipsizeMode.End });
+ revisionList.Columns.Add (messageColumn);
+ dateColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Date"), new Xwt.TextCellView (dateField));
+ revisionList.Columns.Add (dateColumn);
+ authorColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Author"), new Xwt.TextCellView (authorField));
+ revisionList.Columns.Add (authorColumn);
+ shaColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Revision"), new Xwt.TextCellView (shaField));
+ revisionList.Columns.Add (shaColumn);
+
+ var history = repo.GetHistory (repo.RootPath, null);
+ var min = Math.Min (history.Length, 150);
+ for (int i = 0; i < min; ++i) {
+ var rev = history [i];
+
+ // Convert to foreach and use i = AddRow ();
+ revisionStore.AddRow ();
+ revisionStore.SetValue (i, messageField, rev.ShortMessage);
+ revisionStore.SetValue (i, dateField, ParseDate (rev.Time));
+ revisionStore.SetValue (i, authorField, rev.Author);
+ revisionStore.SetValue (i, shaField, ((GitRevision)rev).ShortName);
+ revisionStore.SetValue (i, revisionField, rev);
+ }
+
+ revisionList.SelectionChanged += delegate {
+ CheckSensitive ();
+ };
+
+ vbox.PackStart (revisionList, true, true);
+
+ Content = vbox;
+
+ buttonOk = new Xwt.DialogButton (Xwt.Command.Ok) {
+ Sensitive = false
+ };
+ Buttons.Add (buttonOk);
+ Buttons.Add (new Xwt.DialogButton (Xwt.Command.Cancel));
+ }
+
+ void CheckSensitive ()
+ {
+ if (!String.IsNullOrWhiteSpace (tagNameEntry.Text) && GitUtil.IsValidBranchName (tagNameEntry.Text) &&
+ revisionList.SelectedRow != -1) {
+ buttonOk.Sensitive = true;
+ return;
+ }
+ buttonOk.Sensitive = false;
+ }
+
+ static string ParseDate (DateTime date)
+ {
+ var sb = new StringBuilder (date.ToShortDateString ());
+ sb.AppendFormat (" {0}", date.ToString ("HH:MM"));
+
+ return sb.ToString ();
+ }
+
+ internal string TagName {
+ get { return tagNameEntry.Text; }
+ }
+
+ internal string TagMessage {
+ get { return tagMessageEntry.Text; }
+ }
+
+ internal Revision SelectedRevision {
+ get { return revisionStore.GetValue (revisionList.SelectedRow, revisionField); }
+ }
+ }
+}
+
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitUtil.cs
===================================================================
@@ -37,6 +37,7 @@
using NGit.Transport;
using NGit.Diff;
using NGit.Internal;
+using System;
namespace MonoDevelop.VersionControl.Git
{
@@ -372,6 +373,20 @@ internal static bool IsGitRepository (this FilePath path)
var newPath = path.Combine (".git");
return Directory.Exists (newPath) && Directory.Exists (newPath.Combine ("objects")) && Directory.Exists (newPath.Combine ("refs"));
}
+
+ public static bool IsValidBranchName (string name)
+ {
+ // List from: https://github.com/git/git/blob/master/refs.c#L21
+ if (name.StartsWith (".", StringComparison.Ordinal) ||
+ name.EndsWith ("/", StringComparison.Ordinal) ||
+ name.EndsWith (".lock", StringComparison.Ordinal))
+ return false;
+
+ if (name.Contains (" ") || name.Contains ("~") || name.Contains ("..") || name.Contains ("^") ||
+ name.Contains (":") || name.Contains ("\\") || name.Contains ("?") || name.Contains ("["))
+ return false;
+ return true;
+ }
}
}
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/MonoDevelop.VersionControl.Git.GitConfigurationDialog.cs
===================================================================
@@ -15,6 +15,15 @@ public partial class GitConfigurationDialog
private global::Gtk.Button buttonRemoveBranch;
private global::Gtk.Button buttonSetDefaultBranch;
private global::Gtk.Label label1;
+ private global::Gtk.VBox vbox6;
+ private global::Gtk.HBox hbox3;
+ private global::Gtk.ScrolledWindow GtkScrolledWindow2;
+ private global::Gtk.TreeView listTags;
+ private global::Gtk.VBox vbox7;
+ private global::Gtk.Button buttonAddTag;
+ private global::Gtk.Button buttonPushTag;
+ private global::Gtk.Button buttonRemoveTag;
+ private global::Gtk.Label label5;
private global::Gtk.VBox vbox4;
private global::Gtk.HBox hbox2;
private global::Gtk.ScrolledWindow GtkScrolledWindow1;
@@ -27,7 +36,7 @@ public partial class GitConfigurationDialog
private global::Gtk.Button buttonTrackRemote;
private global::Gtk.Label label2;
private global::Gtk.Button buttonOk;
-
+
protected virtual void Build ()
{
global::Stetic.Gui.Initialize (this);
@@ -133,6 +142,83 @@ protected virtual void Build ()
this.notebook1.SetTabLabel (this.vbox2, this.label1);
this.label1.ShowAll ();
// Container child notebook1.Gtk.Notebook+NotebookChild
+ this.vbox6 = new global::Gtk.VBox ();
+ this.vbox6.Name = "vbox6";
+ this.vbox6.Spacing = 6;
+ this.vbox6.BorderWidth = ((uint)(9));
+ // Container child vbox6.Gtk.Box+BoxChild
+ this.hbox3 = new global::Gtk.HBox ();
+ this.hbox3.Name = "hbox3";
+ this.hbox3.Spacing = 6;
+ // Container child hbox3.Gtk.Box+BoxChild
+ this.GtkScrolledWindow2 = new global::Gtk.ScrolledWindow ();
+ this.GtkScrolledWindow2.Name = "GtkScrolledWindow2";
+ this.GtkScrolledWindow2.ShadowType = ((global::Gtk.ShadowType)(1));
+ // Container child GtkScrolledWindow2.Gtk.Container+ContainerChild
+ this.listTags = new global::Gtk.TreeView ();
+ this.listTags.CanFocus = true;
+ this.listTags.Name = "listTags";
+ this.GtkScrolledWindow2.Add (this.listTags);
+ this.hbox3.Add (this.GtkScrolledWindow2);
+ global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.GtkScrolledWindow2]));
+ w12.Position = 0;
+ // Container child hbox3.Gtk.Box+BoxChild
+ this.vbox7 = new global::Gtk.VBox ();
+ this.vbox7.Name = "vbox7";
+ this.vbox7.Spacing = 6;
+ // Container child vbox7.Gtk.Box+BoxChild
+ this.buttonAddTag = new global::Gtk.Button ();
+ this.buttonAddTag.CanFocus = true;
+ this.buttonAddTag.Name = "buttonAddTag";
+ this.buttonAddTag.UseStock = true;
+ this.buttonAddTag.UseUnderline = true;
+ this.buttonAddTag.Label = "gtk-new";
+ this.vbox7.Add (this.buttonAddTag);
+ global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox7 [this.buttonAddTag]));
+ w13.Position = 0;
+ w13.Expand = false;
+ w13.Fill = false;
+ // Container child vbox7.Gtk.Box+BoxChild
+ this.buttonPushTag = new global::Gtk.Button ();
+ this.buttonPushTag.CanFocus = true;
+ this.buttonPushTag.Name = "buttonPushTag";
+ this.buttonPushTag.UseUnderline = true;
+ this.buttonPushTag.Label = global::Mono.Unix.Catalog.GetString ("_Push");
+ this.vbox7.Add (this.buttonPushTag);
+ global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox7 [this.buttonPushTag]));
+ w14.Position = 1;
+ w14.Expand = false;
+ w14.Fill = false;
+ // Container child vbox7.Gtk.Box+BoxChild
+ this.buttonRemoveTag = new global::Gtk.Button ();
+ this.buttonRemoveTag.CanFocus = true;
+ this.buttonRemoveTag.Name = "buttonRemoveTag";
+ this.buttonRemoveTag.UseStock = true;
+ this.buttonRemoveTag.UseUnderline = true;
+ this.buttonRemoveTag.Label = "gtk-delete";
+ this.vbox7.Add (this.buttonRemoveTag);
+ global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox7 [this.buttonRemoveTag]));
+ w15.Position = 2;
+ w15.Expand = false;
+ w15.Fill = false;
+ this.hbox3.Add (this.vbox7);
+ global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.vbox7]));
+ w16.Position = 1;
+ w16.Expand = false;
+ w16.Fill = false;
+ this.vbox6.Add (this.hbox3);
+ global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.hbox3]));
+ w17.Position = 0;
+ this.notebook1.Add (this.vbox6);
+ global::Gtk.Notebook.NotebookChild w18 = ((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.vbox6]));
+ w18.Position = 1;
+ // Notebook tab
+ this.label5 = new global::Gtk.Label ();
+ this.label5.Name = "label5";
+ this.label5.LabelProp = global::Mono.Unix.Catalog.GetString ("Tags");
+ this.notebook1.SetTabLabel (this.vbox6, this.label5);
+ this.label5.ShowAll ();
+ // Container child notebook1.Gtk.Notebook+NotebookChild
this.vbox4 = new global::Gtk.VBox ();
this.vbox4.Name = "vbox4";
this.vbox4.Spacing = 6;
@@ -151,8 +237,8 @@ protected virtual void Build ()
this.treeRemotes.Name = "treeRemotes";
this.GtkScrolledWindow1.Add (this.treeRemotes);
this.hbox2.Add (this.GtkScrolledWindow1);
- global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.GtkScrolledWindow1]));
- w12.Position = 0;
+ global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.GtkScrolledWindow1]));
+ w20.Position = 0;
// Container child hbox2.Gtk.Box+BoxChild
this.vbox5 = new global::Gtk.VBox ();
this.vbox5.Name = "vbox5";
@@ -165,10 +251,10 @@ protected virtual void Build ()
this.buttonAddRemote.UseUnderline = true;
this.buttonAddRemote.Label = "gtk-add";
this.vbox5.Add (this.buttonAddRemote);
- global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.buttonAddRemote]));
- w13.Position = 0;
- w13.Expand = false;
- w13.Fill = false;
+ global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.buttonAddRemote]));
+ w21.Position = 0;
+ w21.Expand = false;
+ w21.Fill = false;
// Container child vbox5.Gtk.Box+BoxChild
this.buttonEditRemote = new global::Gtk.Button ();
this.buttonEditRemote.CanFocus = true;
@@ -177,10 +263,10 @@ protected virtual void Build ()
this.buttonEditRemote.UseUnderline = true;
this.buttonEditRemote.Label = "gtk-edit";
this.vbox5.Add (this.buttonEditRemote);
- global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.buttonEditRemote]));
- w14.Position = 1;
- w14.Expand = false;
- w14.Fill = false;
+ global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.buttonEditRemote]));
+ w22.Position = 1;
+ w22.Expand = false;
+ w22.Fill = false;
// Container child vbox5.Gtk.Box+BoxChild
this.buttonRemoveRemote = new global::Gtk.Button ();
this.buttonRemoveRemote.CanFocus = true;
@@ -189,18 +275,18 @@ protected virtual void Build ()
this.buttonRemoveRemote.UseUnderline = true;
this.buttonRemoveRemote.Label = "gtk-remove";
this.vbox5.Add (this.buttonRemoveRemote);
- global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.buttonRemoveRemote]));
- w15.Position = 2;
- w15.Expand = false;
- w15.Fill = false;
+ global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.buttonRemoveRemote]));
+ w23.Position = 2;
+ w23.Expand = false;
+ w23.Fill = false;
// Container child vbox5.Gtk.Box+BoxChild
this.hseparator2 = new global::Gtk.HSeparator ();
this.hseparator2.Name = "hseparator2";
this.vbox5.Add (this.hseparator2);
- global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hseparator2]));
- w16.Position = 3;
- w16.Expand = false;
- w16.Fill = false;
+ global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hseparator2]));
+ w24.Position = 3;
+ w24.Expand = false;
+ w24.Fill = false;
// Container child vbox5.Gtk.Box+BoxChild
this.buttonTrackRemote = new global::Gtk.Button ();
this.buttonTrackRemote.CanFocus = true;
@@ -208,21 +294,21 @@ protected virtual void Build ()
this.buttonTrackRemote.UseUnderline = true;
this.buttonTrackRemote.Label = global::Mono.Unix.Catalog.GetString ("Track in Local Branch");
this.vbox5.Add (this.buttonTrackRemote);
- global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.buttonTrackRemote]));
- w17.Position = 4;
- w17.Expand = false;
- w17.Fill = false;
+ global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.buttonTrackRemote]));
+ w25.Position = 4;
+ w25.Expand = false;
+ w25.Fill = false;
this.hbox2.Add (this.vbox5);
- global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.vbox5]));
- w18.Position = 1;
- w18.Expand = false;
- w18.Fill = false;
+ global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.vbox5]));
+ w26.Position = 1;
+ w26.Expand = false;
+ w26.Fill = false;
this.vbox4.Add (this.hbox2);
- global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.hbox2]));
- w19.Position = 0;
+ global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.hbox2]));
+ w27.Position = 0;
this.notebook1.Add (this.vbox4);
- global::Gtk.Notebook.NotebookChild w20 = ((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.vbox4]));
- w20.Position = 1;
+ global::Gtk.Notebook.NotebookChild w28 = ((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.vbox4]));
+ w28.Position = 2;
// Notebook tab
this.label2 = new global::Gtk.Label ();
this.label2.Name = "label2";
@@ -230,14 +316,14 @@ protected virtual void Build ()
this.notebook1.SetTabLabel (this.vbox4, this.label2);
this.label2.ShowAll ();
w1.Add (this.notebook1);
- global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(w1 [this.notebook1]));
- w21.Position = 0;
+ global::Gtk.Box.BoxChild w29 = ((global::Gtk.Box.BoxChild)(w1 [this.notebook1]));
+ w29.Position = 0;
// Internal child MonoDevelop.VersionControl.Git.GitConfigurationDialog.ActionArea
- global::Gtk.HButtonBox w22 = this.ActionArea;
- w22.Name = "dialog1_ActionArea";
- w22.Spacing = 10;
- w22.BorderWidth = ((uint)(5));
- w22.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
+ global::Gtk.HButtonBox w30 = this.ActionArea;
+ w30.Name = "dialog1_ActionArea";
+ w30.Spacing = 10;
+ w30.BorderWidth = ((uint)(5));
+ w30.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
this.buttonOk = new global::Gtk.Button ();
this.buttonOk.CanDefault = true;
@@ -247,9 +333,9 @@ protected virtual void Build ()
this.buttonOk.UseUnderline = true;
this.buttonOk.Label = "gtk-close";
this.AddActionWidget (this.buttonOk, -7);
- global::Gtk.ButtonBox.ButtonBoxChild w23 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w22 [this.buttonOk]));
- w23.Expand = false;
- w23.Fill = false;
+ global::Gtk.ButtonBox.ButtonBoxChild w31 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w30 [this.buttonOk]));
+ w31.Expand = false;
+ w31.Fill = false;
if ((this.Child != null)) {
this.Child.ShowAll ();
}
@@ -260,6 +346,9 @@ protected virtual void Build ()
this.buttonEditBranch.Clicked += new global::System.EventHandler (this.OnButtonEditBranchClicked);
this.buttonRemoveBranch.Clicked += new global::System.EventHandler (this.OnButtonRemoveBranchClicked);
this.buttonSetDefaultBranch.Clicked += new global::System.EventHandler (this.OnButtonSetDefaultBranchClicked);
+ this.buttonAddTag.Clicked += new global::System.EventHandler (this.OnButtonNewTagClicked);
+ this.buttonPushTag.Clicked += new global::System.EventHandler (this.OnButtonPushTagClicked);
+ this.buttonRemoveTag.Clicked += new global::System.EventHandler (this.OnButtonRemoveTagClicked);
this.buttonAddRemote.Clicked += new global::System.EventHandler (this.OnButtonAddRemoteClicked);
this.buttonEditRemote.Clicked += new global::System.EventHandler (this.OnButtonEditRemoteClicked);
this.buttonRemoveRemote.Clicked += new global::System.EventHandler (this.OnButtonRemoveRemoteClicked);
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/gui.stetic
===================================================================
@@ -571,6 +571,112 @@
</packing>
</child>
<child>
+ <widget class="Gtk.VBox" id="vbox6">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <property name="BorderWidth">9</property>
+ <child>
+ <widget class="Gtk.HBox" id="hbox3">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow2">
+ <property name="MemberName" />
+ <property name="ShadowType">In</property>
+ <child>
+ <widget class="Gtk.TreeView" id="listTags">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="ShowScrollbars">True</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.VBox" id="vbox7">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Button" id="buttonAddTag">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="UseStock">True</property>
+ <property name="Type">StockItem</property>
+ <property name="StockId">gtk-new</property>
+ <signal name="Clicked" handler="OnButtonNewTagClicked" />
+ <property name="label">gtk-new</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="buttonPushTag">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Type">TextOnly</property>
+ <property name="Label" translatable="yes">_Push All Tags</property>
+ <property name="UseUnderline">True</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="buttonRemoveTag">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="UseStock">True</property>
+ <property name="Type">StockItem</property>
+ <property name="StockId">gtk-delete</property>
+ <property name="label">gtk-delete</property>
+ </widget>
+ <packing>
+ <property name="Position">2</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="label5">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">Tags</property>
+ </widget>
+ <packing>
+ <property name="type">tab</property>
+ </packing>
+ </child>
+ <child>
<widget class="Gtk.VBox" id="vbox4">
<property name="MemberName" />
<property name="Spacing">6</property>
@@ -694,7 +800,7 @@
</child>
</widget>
<packing>
- <property name="Position">1</property>
+ <property name="Position">2</property>
</packing>
</child>
<child>
Commit: ea27189b326262cd12fb0b677e02c9b8f8d9c458
Author: Lluis Sanchez <[email protected]> (slluis)
Date: 2013-10-01 16:07:17 GMT
URL: https://github.com/mono/monodevelop/commit/ea27189b326262cd12fb0b677e02c9b8f8d9c458
[Core] Fix project loading issue
Fixes bug which caused MonoDevelop to refuse to load a project that
has its project type guid specified inside the project file's element.
Based on a patch by Shay Rojansky.
Changed paths:
M main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs
M main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectService.cs
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs
===================================================================
@@ -320,7 +320,7 @@ public SolutionEntityItem Load (IProgressMonitor monitor, string fileName, MSBui
try {
timer.Trace ("Create item instance");
ProjectExtensionUtil.BeginLoadOperation ();
- Item = CreateSolutionItem (monitor, p, fileName, language, projectTypeGuids, itemType, itemClass);
+ Item = CreateSolutionItem (monitor, p, fileName, language, itemType, itemClass);
Item.SetItemHandler (this);
MSBuildProjectService.SetId (Item, itemGuid);
@@ -354,13 +354,13 @@ internal bool UseMSBuildEngineForItem (SolutionItem item)
internal bool RequireMSBuildEngine { get; set; }
// All of the last 4 parameters are optional, but at least one must be provided.
- SolutionItem CreateSolutionItem (IProgressMonitor monitor, MSBuildProject p, string fileName, string language, string typeGuids,
+ SolutionItem CreateSolutionItem (IProgressMonitor monitor, MSBuildProject p, string fileName, string language,
string itemType, Type itemClass)
{
SolutionItem item = null;
- if (!string.IsNullOrEmpty (typeGuids)) {
- DotNetProjectSubtypeNode st = MSBuildProjectService.GetDotNetProjectSubtype (typeGuids);
+ if (subtypeGuids.Any ()) {
+ DotNetProjectSubtypeNode st = MSBuildProjectService.GetDotNetProjectSubtype (subtypeGuids);
if (st != null) {
UseMSBuildEngineByDefault = st.UseXBuild;
RequireMSBuildEngine = st.RequireXBuild;
@@ -389,7 +389,7 @@ internal bool UseMSBuildEngineForItem (SolutionItem item)
item = st.CreateInstance (language);
st.UpdateImports ((SolutionEntityItem)item, targetImports);
} else
- throw new UnknownSolutionItemTypeException (typeGuids);
+ throw new UnknownSolutionItemTypeException (string.Join (";", subtypeGuids));
}
if (item == null && itemClass != null)
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectService.cs
===================================================================
@@ -192,25 +192,29 @@ public static void CheckHandlerUsesMSBuildEngine (SolutionItem item, out bool us
internal static DotNetProjectSubtypeNode GetDotNetProjectSubtype (string typeGuids)
{
- if (!string.IsNullOrEmpty (typeGuids)) {
- Type ptype = null;
- DotNetProjectSubtypeNode foundNode = null;
- foreach (string guid in typeGuids.Split (';')) {
- string tguid = guid.Trim ();
- foreach (DotNetProjectSubtypeNode st in GetItemSubtypeNodes ()) {
- if (st.SupportsType (tguid)) {
- if (ptype == null || ptype.IsAssignableFrom (st.Type)) {
- ptype = st.Type;
- foundNode = st;
- }
+ if (!string.IsNullOrEmpty (typeGuids))
+ return GetDotNetProjectSubtype (typeGuids.Split (';').Select (t => t.Trim ()));
+ else
+ return null;
+ }
+
+ internal static DotNetProjectSubtypeNode GetDotNetProjectSubtype (IEnumerable<string> typeGuids)
+ {
+ Type ptype = null;
+ DotNetProjectSubtypeNode foundNode = null;
+ foreach (string guid in typeGuids) {
+ foreach (DotNetProjectSubtypeNode st in GetItemSubtypeNodes ()) {
+ if (st.SupportsType (guid)) {
+ if (ptype == null || ptype.IsAssignableFrom (st.Type)) {
+ ptype = st.Type;
+ foundNode = st;
}
}
}
- return foundNode;
}
- return null;
+ return foundNode;
}
-
+
static IEnumerable<ItemTypeNode> GetItemTypeNodes ()
{
foreach (ExtensionNode node in AddinManager.GetExtensionNodes (ItemTypesExtensionPath)) {
Commit: e083e731811a11ac6e1f13de5a2c28b807ee1671
Author: Lluis Sanchez <[email protected]> (slluis)
Date: 2013-10-01 16:07:17 GMT
URL: https://github.com/mono/monodevelop/commit/e083e731811a11ac6e1f13de5a2c28b807ee1671
[Core] Specify project type guid in a test project
This tests that project loading works when only the project
type guid is specified in the ProjectTypeGuid element.
Changed paths:
M main/tests/test-projects/property-evaluation-test/property-evaluation-test.csproj
Modified: main/tests/test-projects/property-evaluation-test/property-evaluation-test.csproj
===================================================================
@@ -6,6 +6,7 @@
<ProductVersion>10.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{8A067BDA-C60B-4B3E-85EC-743CF521ADD4}</ProjectGuid>
+ <ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>propertyevaluationtest</RootNamespace>
<AssemblyName>property-evaluation-test</AssemblyName>
Commit: e518a95ad828c0f4c94ea72180ae4a240f3c8911
Author: Lluis Sanchez <[email protected]> (slluis)
Date: 2013-10-01 16:41:03 GMT
URL: https://github.com/mono/monodevelop/commit/e518a95ad828c0f4c94ea72180ae4a240f3c8911
[Core] Consider env vars when evaluating msbuild properties
Changed paths:
M main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProject.cs
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProject.cs
===================================================================
@@ -875,7 +875,7 @@ public string GetPropertyValue (string name)
if (properties.TryGetValue (name, out val))
return val;
else
- return "";
+ return Environment.GetEnvironmentVariable (name);
}
public void SetPropertyValue (string name, string value)
@@ -952,8 +952,8 @@ string Evaluate (string str)
}
string prop = str.Substring (i, j - i);
- string val;
- if (!properties.TryGetValue (prop, out val)) {
+ string val = GetPropertyValue (prop);
+ if (val == null) {
allResolved = false;
return "";
}
@@ -973,7 +973,7 @@ string Evaluate (string str)
public string EvaluateString (string value)
{
if (value.StartsWith ("$(") && value.EndsWith (")"))
- return GetPropertyValue (value.Substring (2, value.Length - 3));
+ return GetPropertyValue (value.Substring (2, value.Length - 3)) ?? value;
else
return value;
}
Commit: 30363bf03782280fddc5e4cc247701253e887d12
Author: Lluis Sanchez <[email protected]> (slluis)
Date: 2013-10-01 16:42:03 GMT
URL: https://github.com/mono/monodevelop/commit/30363bf03782280fddc5e4cc247701253e887d12
[Core tests] Test evaluation of msbuild properties backed by env vars
Changed paths:
M main/tests/UnitTests/MonoDevelop.Projects/MSBuildTests.cs
M main/tests/test-projects/property-evaluation-test/property-evaluation-test.csproj
Modified: main/tests/UnitTests/MonoDevelop.Projects/MSBuildTests.cs
===================================================================
@@ -368,6 +368,10 @@ public void RoundtripPropertyWithXmlCharacters ()
[Test]
public void EvaluateProperties ()
{
+ string dir = Path.GetDirectoryName (typeof(Project).Assembly.Location);
+ Environment.SetEnvironmentVariable ("HHH", "EnvTest");
+ Environment.SetEnvironmentVariable ("SOME_PLACE", dir);
+
string solFile = Util.GetSampleProject ("property-evaluation-test", "property-evaluation-test.sln");
Solution sol = Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile) as Solution;
var p = (DotNetProject) sol.GetAllProjects ().First ();
@@ -381,6 +385,11 @@ public void EvaluateProperties ()
Assert.AreEqual ("Program8_test1.cs", p.Files[7].FilePath.FileName, "Item group conditions are ignored");
Assert.AreEqual ("Program9_$(GGG).cs", p.Files[8].FilePath.FileName, "Non-evaluable property group clears properties");
Assert.AreEqual ("Program10_$(AAA", p.Files[9].FilePath.FileName, "Invalid property reference");
+ Assert.AreEqual ("Program11_EnvTest.cs", p.Files[10].FilePath.FileName, "Environment variable");
+
+ var testRef = Path.Combine (dir, "MonoDevelop.Core.dll");
+ var asms = p.GetReferencedAssemblies (sol.Configurations [0].Selector).ToArray ();
+ Assert.IsTrue (asms.Contains (testRef));
}
}
}
Modified: main/tests/test-projects/property-evaluation-test/property-evaluation-test.csproj
===================================================================
@@ -49,6 +49,9 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
+ <Reference Include="TestReference">
+ <HintPath>$(SOME_PLACE)\MonoDevelop.Core.dll</HintPath>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Program1_$(AAA).cs" />
@@ -63,6 +66,7 @@
<Compile Include="Program8_$(AAA).cs" />
<Compile Include="Program9_$(GGG).cs" />
<Compile Include="Program10_$(AAA" />
+ <Compile Include="Program11_$(HHH).cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
Commit: 4570d0e926be90cc30a62e55bdcf8f0c19ad0709
Author: Lluis Sanchez <[email protected]> (slluis)
Date: 2013-10-01 17:17:08 GMT
URL: https://github.com/mono/monodevelop/commit/4570d0e926be90cc30a62e55bdcf8f0c19ad0709
[Core] Properly roundtrip project items that contain property references
Changed paths:
M main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProject.cs
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProject.cs
===================================================================
@@ -771,6 +771,11 @@ public bool HasMetadata (string name)
public void SetMetadata (string name, string value, bool isXml = false)
{
+ // Don't overwrite the metadata value if the new value is the same as the old
+ // This will keep the old metadata string, which can contain property references
+ if (GetMetadata (name, isXml) == value)
+ return;
+
XmlElement elem = Element [name, MSBuildProject.Schema];
if (elem == null) {
elem = AddChildElement (name);
Commit: ede292e1e3fdabf57efb1e0d2228e0dba6aed41f
Author: Michael Hutchinson <[email protected]> (mhutch)
Date: 2013-10-01 23:43:42 GMT
URL: https://github.com/mono/monodevelop/commit/ede292e1e3fdabf57efb1e0d2228e0dba6aed41f
Bump xwt, md-addins
Changed paths:
M main/external/xwt
M version-checks
Modified: main/external/xwt
===================================================================
@@ -1 +1 @@
-Subproject commit c51569338b1e2243c385de3380c0aeb5a4ec1342
+Subproject commit 349382e4160990bf1dc50270bb60df6880ce764c
Modified: version-checks
===================================================================
@@ -17,7 +17,7 @@ DEP[0]=md-addins
DEP_NAME[0]=MDADDINS
DEP_PATH[0]=${top_srcdir}/../md-addins
DEP_MODULE[0][email protected]:xamarin/md-addins.git
-DEP_NEEDED_VERSION[0]=411e4733197adf45cb3b1e91d0ee73ebf4ecbf5c
+DEP_NEEDED_VERSION[0]=497389b98f67fa9c098cee63a44ce1bd6387b2d4
DEP_BRANCH_AND_REMOTE[0]="master origin/master"
# heap-shot
Commit: fa0992c9fe34cdc65c5675d72fadfba6a315610e
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-02 06:33:28 GMT
URL: https://github.com/mono/monodevelop/commit/fa0992c9fe34cdc65c5675d72fadfba6a315610e
Fixed 'Bug 15109 - Incorrect "Readonly field cannot be used as assignment target" error'
Changed paths:
M main/external/nrefactory
Modified: main/external/nrefactory
===================================================================
@@ -1 +1 @@
-Subproject commit 760ede6a95b64838423fc3cf77bcc187ff7a186e
+Subproject commit a5b252f92f5a378f00b786d1481bacddb87d7251
Commit: 2a3e07d02e03380b91a1e6b7cdd4198bc9a4ca47
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-02 06:36:54 GMT
URL: https://github.com/mono/monodevelop/commit/2a3e07d02e03380b91a1e6b7cdd4198bc9a4ca47
Fixed 'Bug 15110 - Exception has been thrown by the target of an
invocation. ---> System.NullReferenceException: Object reference not
set to an instance of an object'.
Changed paths:
M main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringScript.cs
Modified: main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringScript.cs
===================================================================
@@ -352,14 +352,19 @@ public override void CreateNewType (AstNode newType, NewTypeContext ntctx = NewT
insertLocation = content.Length;
content = content.Substring (0, insertLocation) + newType.ToString (FormattingOptions) + content.Substring (insertLocation);
- var policy = context.Project.Policies.Get<CSharpFormattingPolicy> ();
- var textPolicy = context.Project.Policies.Get<TextStylePolicy> ();
-
- content = MonoDevelop.CSharp.Formatting.CSharpFormatter.FormatText (policy, textPolicy, MonoDevelop.CSharp.Formatting.CSharpFormatter.MimeType, content, 0, content.Length);
+ var project = context.Project;
+ if (project != null) {
+ var policy = project.Policies.Get<CSharpFormattingPolicy> ();
+ var textPolicy = project.Policies.Get<TextStylePolicy> ();
+ content = MonoDevelop.CSharp.Formatting.CSharpFormatter.FormatText (policy, textPolicy, MonoDevelop.CSharp.Formatting.CSharpFormatter.MimeType, content, 0, content.Length);
+ }
File.WriteAllText (correctFileName, content);
- context.Project.AddFile (correctFileName);
- IdeApp.ProjectOperations.Save (context.Project);
+
+ if (project != null) {
+ project.AddFile (correctFileName);
+ IdeApp.ProjectOperations.Save (project);
+ }
IdeApp.Workbench.OpenDocument (correctFileName);
}
Commit: 9de287da921e27e051ec3093aa7d52760926c66b
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-02 06:59:25 GMT
URL: https://github.com/mono/monodevelop/commit/9de287da921e27e051ec3093aa7d52760926c66b
Fixed bug 'Bug 15099 - Wrong always true context'
Changed paths:
M main/external/nrefactory
Modified: main/external/nrefactory
===================================================================
@@ -1 +1 @@
-Subproject commit a5b252f92f5a378f00b786d1481bacddb87d7251
+Subproject commit d3056e3d644ec3e58c65178b914d180cb2bca0db
Commit: 490047e1bd5f5050c40b1ee125ca95a4f9f63d2e
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-02 07:21:23 GMT
URL: https://github.com/mono/monodevelop/commit/490047e1bd5f5050c40b1ee125ca95a4f9f63d2e
[Ide] Handled possible exception in setcreationtime.
Changed paths:
M main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs
Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs
===================================================================
@@ -2117,7 +2117,7 @@ IAssembly IAssemblyReference.Resolve (ITypeResolveContext context)
readonly string cache;
IUnresolvedAssembly assembly;
- object asmLocker = new object ();
+ readonly object asmLocker = new object ();
internal void EnsureAssemblyLoaded ()
{
lock (asmLocker) {
@@ -2176,8 +2176,13 @@ IUnresolvedAssembly LoadAssembly ()
if (cache != null) {
var writeTime = File.GetLastWriteTimeUtc (fileName);
SerializeObject (assemblyPath, result);
- if (File.Exists (assemblyPath))
- File.SetCreationTimeUtc (assemblyPath, writeTime);
+ if (File.Exists (assemblyPath)) {
+ try {
+ File.SetCreationTimeUtc (assemblyPath, writeTime);
+ } catch (Exception e) {
+ LoggingService.LogError ("Can't set creation time for: " + assemblyPath, e);
+ }
+ }
}
return result;
}
Commit: 3dc8caca7a8ed78766d703ff302e6be0eba1ea0d
Author: Alan McGovern <[email protected]> (alanmcgovern)
Committer: Lluis Sanchez <[email protected]> (slluis)
Date: 2013-10-02 08:14:00 GMT
URL: https://github.com/mono/monodevelop/commit/3dc8caca7a8ed78766d703ff302e6be0eba1ea0d
Revert "GREEN BUILDS AGAIN"
This reverts commit f3d049e3005951244c9031b18b4f263d1e60e6e9.
Changed paths:
M main/tests/UnitTests/MonoDevelop.Projects/LocalCopyTests.cs
M main/tests/UnitTests/MonoDevelop.Projects/MSBuildTests.cs
M main/tests/UnitTests/MonoDevelop.Projects/ProjectTests.cs
Modified: main/tests/UnitTests/MonoDevelop.Projects/LocalCopyTests.cs
===================================================================
@@ -40,7 +40,6 @@ namespace MonoDevelop.Projects
public class LocalCopyTests : TestBase
{
[Test]
- [Ignore ("We don't install the msbuild assemblies in the right place for this tests")]
public void CheckLocalCopy ()
{
string solFile = Util.GetSampleProject ("vs-local-copy", "VSLocalCopyTest.sln");
Modified: main/tests/UnitTests/MonoDevelop.Projects/MSBuildTests.cs
===================================================================
@@ -42,7 +42,6 @@ namespace MonoDevelop.Projects
public class MSBuildTests: TestBase
{
[Test()]
- [Ignore ("We don't install the msbuild assemblies in the right place for this tests")]
public void LoadSaveBuildConsoleProject()
{
string solFile = Util.GetSampleProject ("console-project", "ConsoleProject.sln");
Modified: main/tests/UnitTests/MonoDevelop.Projects/ProjectTests.cs
===================================================================
@@ -62,7 +62,6 @@ public void ProjectFilePaths ()
}
[Test()]
- [Ignore ("We don't install the msbuild assemblies in the right place for this tests")]
public void Resources ()
{
string solFile = Util.GetSampleProject ("resources-tester", "ResourcesTester.sln");
Commit: 1dcf39729378362fee330cecd7bfcc2ec6f706c3
Author: Lluis Sanchez <[email protected]> (slluis)
Date: 2013-10-02 09:14:17 GMT
URL: https://github.com/mono/monodevelop/commit/1dcf39729378362fee330cecd7bfcc2ec6f706c3
Fix a couple of previously ignored tests
Changed paths:
M main/tests/UnitTests/MonoDevelop.Projects/LocalCopyTests.cs
M main/tests/UnitTests/MonoDevelop.Projects/ProjectTests.cs
Modified: main/tests/UnitTests/MonoDevelop.Projects/LocalCopyTests.cs
===================================================================
@@ -181,7 +181,16 @@ static void AssertCleanBuild (Solution sol, string configuration)
BuildResult cr = sol.Build (Util.GetMonitor (), configuration);
Assert.IsNotNull (cr);
Assert.AreEqual (0, cr.ErrorCount);
- Assert.AreEqual (0, cr.WarningCount);
+
+ // Warning check disabled due to bug #15121
+ // Assert.AreEqual (0, cr.WarningCount);
+ }
+
+ [Test]
+ [Ignore ("Check for build warnings disabled due to a bug in xbuild (BXC 15121)")]
+ public void CheckLocalCopyBuildWarnings ()
+ {
+ // See commented assert in AssertCleanBuild
}
}
}
Modified: main/tests/UnitTests/MonoDevelop.Projects/ProjectTests.cs
===================================================================
@@ -78,7 +78,9 @@ public void Resources ()
sol.Clean (Util.GetMonitor (), "Debug");
Assert.IsFalse (File.Exists (spath), "Satellite assembly not removed");
- Assert.IsFalse (Directory.Exists (Path.GetDirectoryName (spath)), "Satellite assembly directory not removed");
+
+ // msbuild doesn't delete this directory
+ // Assert.IsFalse (Directory.Exists (Path.GetDirectoryName (spath)), "Satellite assembly directory not removed");
}
public static void CheckResourcesSolution (Solution sol)
Commit: 1aa57270962ecfb88c0f84bda6349ca09df6046f
Author: Therzok <[email protected]> (Therzok)
Date: 2013-10-02 10:38:44 GMT
URL: https://github.com/mono/monodevelop/commit/1aa57270962ecfb88c0f84bda6349ca09df6046f
[Version Control] Get rid of exception on solution loading.
Changed paths:
M main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UrlBasedRepository.cs
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UrlBasedRepository.cs
===================================================================
@@ -40,11 +40,7 @@ void ICustomDataItem.Deserialize (ITypeSerializer handler, DataCollection data)
void CreateUri ()
{
- try {
- uri = new Uri (url);
- } catch {
- uri = null;
- }
+ uri = url != null ? new Uri (url) : null;
}
public override void CopyConfigurationFrom (Repository other)
Commit: d54151b1e1162b2c481de40375c13f9af1217026
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-02 10:41:03 GMT
URL: https://github.com/mono/monodevelop/commit/d54151b1e1162b2c481de40375c13f9af1217026
[UnitTests] Fixed tests.
Changed paths:
M main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/ResolveCommandHandler.cs
M main/src/core/MonoDevelop.Ide/AssemblyInfo.cs
M main/tests/UnitTests/MonoDevelop.Ide.FindInFiles/MemberCollectorTests.cs
Modified: main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/ResolveCommandHandler.cs
===================================================================
@@ -375,20 +375,18 @@ static IEnumerable<PossibleNamespace> GetPossibleNamespaces (Document doc, AstNo
}
var allTypes = compilation == doc.Compilation ? compilation.GetAllTypeDefinitions () : compilation.MainAssembly.GetAllTypeDefinitions ();
if (resolveResult is UnknownIdentifierResolveResult) {
- if (node is AstType) {
- var uiResult = resolveResult as UnknownIdentifierResolveResult;
- string possibleAttributeName = isInsideAttributeType ? uiResult.Identifier + "Attribute" : uiResult.Identifier;
- foreach (var typeDefinition in allTypes) {
- if ((typeDefinition.Name == possibleAttributeName || typeDefinition.Name == uiResult.Identifier) && typeDefinition.TypeParameterCount == tc &&
- lookup.IsAccessible (typeDefinition, false)) {
- if (typeDefinition.DeclaringTypeDefinition != null) {
- var builder = new TypeSystemAstBuilder (new CSharpResolver (doc.Compilation));
- foundIdentifier = true;
- yield return new PossibleNamespace (builder.ConvertType (typeDefinition.DeclaringTypeDefinition).ToString (), false, requiredReference);
- } else {
- foundIdentifier = true;
- yield return new PossibleNamespace (typeDefinition.Namespace, true, requiredReference);
- }
+ var uiResult = resolveResult as UnknownIdentifierResolveResult;
+ string possibleAttributeName = isInsideAttributeType ? uiResult.Identifier + "Attribute" : uiResult.Identifier;
+ foreach (var typeDefinition in allTypes) {
+ if ((typeDefinition.Name == possibleAttributeName || typeDefinition.Name == uiResult.Identifier) && typeDefinition.TypeParameterCount == tc &&
+ lookup.IsAccessible (typeDefinition, false)) {
+ if (typeDefinition.DeclaringTypeDefinition != null) {
+ var builder = new TypeSystemAstBuilder (new CSharpResolver (doc.Compilation));
+ foundIdentifier = true;
+ yield return new PossibleNamespace (builder.ConvertType (typeDefinition.DeclaringTypeDefinition).ToString (), false, requiredReference);
+ } else {
+ foundIdentifier = true;
+ yield return new PossibleNamespace (typeDefinition.Namespace, true, requiredReference);
}
}
}
Modified: main/src/core/MonoDevelop.Ide/AssemblyInfo.cs
===================================================================
@@ -13,3 +13,4 @@
[assembly: InternalsVisibleTo("MonoDevelop.Debugger")]
[assembly: InternalsVisibleTo("MonoDevelop.DesignerSupport")]
[assembly: InternalsVisibleTo("Ide.Tests")]
+[assembly: InternalsVisibleTo("UnitTests")]
Modified: main/tests/UnitTests/MonoDevelop.Ide.FindInFiles/MemberCollectorTests.cs
===================================================================
@@ -32,6 +32,8 @@
using MonoDevelop.Ide.TypeSystem;
using ICSharpCode.NRefactory.CSharp;
using ICSharpCode.NRefactory.CSharp.TypeSystem;
+using Mono.CSharp.Nullable;
+using GLib;
namespace MonoDevelop.Ide.FindInFiles
{
@@ -40,9 +42,13 @@ public class MemberCollectorTests : UnitTests.TestBase
{
IAssembly GenerateAssembly(Project project, string code)
{
- var wrapper = TypeSystemService.LoadProject (project);
project.Files.Add (new ProjectFile ("test.cs", BuildAction.Compile));
- TypeSystemService.ParseFile (project, "test.cs", "text/x-csharp", code);
+ var wrapper = TypeSystemService.LoadProject (project);
+ TypeSystemService.ParseFile ("test.cs", "text/x-csharp", code, wrapper);
+ wrapper.RequestLoad ();
+ do {
+ System.Threading.Thread.Sleep (10);
+ } while (wrapper.InLoad);
return wrapper.Compilation.MainAssembly;
}
Commit: 35775eed679006d527a7656c108d9377727a8a76
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-02 11:04:06 GMT
URL: https://github.com/mono/monodevelop/commit/35775eed679006d527a7656c108d9377727a8a76
Fixed 'Bug 15123 - Find bar graphical issue'.
Changed paths:
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs
===================================================================
@@ -399,7 +399,7 @@ protected void DrawSearchIndicator (Cairo.Context cr)
{
int diameter = Math.Min (Allocation.Width, (int)IndicatorHeight) - indicatorPadding * 2;
var x1 = Math.Round (Allocation.Width / 2d);
- double y1 = indicatorPadding;
+ double y1 = indicatorPadding + diameter / 2;
if (diameter % 2 == 0) {
x1 += 0.5;
y1 += 0.5;
Commit: 64f5b2d04c0a8a1c81f71aa35e4981f139e190b2
Author: Jeffrey Stedfast <[email protected]> (jstedfast)
Date: 2013-10-02 15:49:59 GMT
URL: https://github.com/mono/monodevelop/commit/64f5b2d04c0a8a1c81f71aa35e4981f139e190b2
bumped debugger-libs
Changed paths:
M main/external/debugger-libs
Modified: main/external/debugger-libs
===================================================================
@@ -1 +1 @@
-Subproject commit a2c1ed51040dc96551c267e14bf4f44c7cd05be6
+Subproject commit 8c6cdc6a77abaf1a6ee75498c62c46474794a2b7
Commit: e641ab7d3f6a94f225b3b4ae82b55a1967ac2dc1
Author: Lluis Sanchez <[email protected]> (slluis)
Date: 2013-10-02 16:55:57 GMT
URL: https://github.com/mono/monodevelop/commit/e641ab7d3f6a94f225b3b4ae82b55a1967ac2dc1
Fix unit test
MSbuild does copy TextFile2.txt and app.config.
Changed paths:
M main/tests/UnitTests/MonoDevelop.Projects/LocalCopyTests.cs
Modified: main/tests/UnitTests/MonoDevelop.Projects/LocalCopyTests.cs
===================================================================
@@ -61,6 +61,8 @@ public void CheckLocalCopy ()
"VSLocalCopyTest.exe",
"VSLocalCopyTest.exe.mdb",
"TextFile1.txt",
+ "TextFile2.txt",
+ "app.config",
"folder/baz.txt",
"foo/bar.txt",
"quux.txt",
@@ -75,6 +77,8 @@ public void CheckLocalCopy ()
"ClassLibrary4.dll",
"VSLocalCopyTest.exe",
"TextFile1.txt",
+ "TextFile2.txt",
+ "app.config",
"folder/baz.txt",
"foo/bar.txt",
"quux.txt",
Commit: b163744f48206beeb7853c03d636c30a6619d988
Author: Jeffrey Stedfast <[email protected]> (jstedfast)
Date: 2013-10-02 18:38:33 GMT
URL: https://github.com/mono/monodevelop/commit/b163744f48206beeb7853c03d636c30a6619d988
bumped version-checks
Changed paths:
M version-checks
Modified: version-checks
===================================================================
@@ -17,7 +17,7 @@ DEP[0]=md-addins
DEP_NAME[0]=MDADDINS
DEP_PATH[0]=${top_srcdir}/../md-addins
DEP_MODULE[0][email protected]:xamarin/md-addins.git
-DEP_NEEDED_VERSION[0]=497389b98f67fa9c098cee63a44ce1bd6387b2d4
+DEP_NEEDED_VERSION[0]=799cede970d5e04ec51711b76ddc35bd338cacb7
DEP_BRANCH_AND_REMOTE[0]="master origin/master"
# heap-shot
Commit: 69c64add6c26c8ba148311a731dae0120d768492
Author: Jeffrey Stedfast <[email protected]> (jstedfast)
Date: 2013-10-03 18:08:13 GMT
URL: https://github.com/mono/monodevelop/commit/69c64add6c26c8ba148311a731dae0120d768492
bumped version-checks for new iOS project templates
Changed paths:
M version-checks
Modified: version-checks
===================================================================
@@ -17,7 +17,7 @@ DEP[0]=md-addins
DEP_NAME[0]=MDADDINS
DEP_PATH[0]=${top_srcdir}/../md-addins
DEP_MODULE[0][email protected]:xamarin/md-addins.git
-DEP_NEEDED_VERSION[0]=799cede970d5e04ec51711b76ddc35bd338cacb7
+DEP_NEEDED_VERSION[0]=59f4149622960f18be872224e0dea5ef91a14ba0
DEP_BRANCH_AND_REMOTE[0]="master origin/master"
# heap-shot
Commit: 66ed1a690fc40bcbe963f48d2fa350c030352944
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-04 05:24:26 GMT
URL: https://github.com/mono/monodevelop/commit/66ed1a690fc40bcbe963f48d2fa350c030352944
Fixed 'Bug 15133 - NRE in NullValueAnalysis'
Changed paths:
M main/external/nrefactory
Modified: main/external/nrefactory
===================================================================
@@ -1 +1 @@
-Subproject commit d3056e3d644ec3e58c65178b914d180cb2bca0db
+Subproject commit fa88481929300a84cc250da95287f42581549660
Commit: 037e68094d0e746b2dad1dea6922a610e329b372
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-04 06:02:11 GMT
URL: https://github.com/mono/monodevelop/commit/037e68094d0e746b2dad1dea6922a610e329b372
Fixed 'Bug 15140 - Placing the cursor over an error/warning bubble
popover should prevent it from closing.'
Changed paths:
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCache.cs
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCache.cs
===================================================================
@@ -30,6 +30,8 @@
using MonoDevelop.Ide.Fonts;
using Mono.TextEditor.Highlighting;
using MonoDevelop.Components;
+using Cairo;
+using MonoDevelop.Ide.Gui.Components;
namespace MonoDevelop.SourceEditor
{
@@ -140,7 +142,7 @@ protected override void OnSizeRequested (ref Gtk.Requisition requisition)
protected override bool OnEnterNotifyEvent (Gdk.EventCrossing evnt)
{
- cache.DestroyPopoverWindow ();
+ cache.CancelLeaveDestroyTimeout ();
return base.OnEnterNotifyEvent (evnt);
}
@@ -235,9 +237,25 @@ void HandleBeginHover (object sender, EventArgs e)
editor.QueueDraw ();
}
+ uint leaveDestroyTimeout;
+
+ void CancelLeaveDestroyTimeout ()
+ {
+ if (leaveDestroyTimeout != 0) {
+ GLib.Source.Remove (leaveDestroyTimeout);
+ leaveDestroyTimeout = 0;
+ }
+ }
+
void HandleLeaveNotifyEvent (object o, Gtk.LeaveNotifyEventArgs args)
{
- DestroyPopoverWindow ();
+ CancelLeaveDestroyTimeout ();
+ leaveDestroyTimeout = GLib.Timeout.Add (100, delegate {
+ DestroyPopoverWindow ();
+ leaveDestroyTimeout = 0;
+ return false;
+ });
+
CancelHoverTimeout ();
if (CurrentSelectedTextMarker == null)
return;
@@ -263,6 +281,7 @@ internal void DestroyPopoverWindow ()
public void Dispose ()
{
+ CancelLeaveDestroyTimeout ();
CancelHoverTimeout ();
DestroyPopoverWindow ();
editor.VAdjustment.ValueChanged -= HandleValueChanged;
@@ -331,4 +350,3 @@ protected virtual void OnChanged (EventArgs e)
public event EventHandler Changed;
}
}
-
Commit: eaf9ccb8f615d19eb3002947fe90c429e479caa8
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-04 06:19:33 GMT
URL: https://github.com/mono/monodevelop/commit/eaf9ccb8f615d19eb3002947fe90c429e479caa8
Fixed 'Bug 15142 - Inline error & warning bubble count indicator
should be bold'
Changed paths:
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.addin.xml
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCache.cs
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.addin.xml
===================================================================
@@ -219,6 +219,7 @@
<Extension path = "/MonoDevelop/Ide/Fonts">
<Font name ="MessageBubbles" _displayName="Message bubbles" default ="_DEFAULT_SANS" defaultMac = "Lucida Grande 10"/>
+ <Font name ="MessageBubbleCounter" _displayName="Message bubbles error count" default ="_DEFAULT_SANS" defaultMac = "Lucida Grande Bold 10"/>
<Font name ="MessageBubbleTooltip" _displayName="Message bubbles tooltip" default ="_DEFAULT_SANS" defaultMac = "Lucida Grande Bold 10"/>
<Font name ="LanguageTooltips" _displayName="Editor tooltips" default ="_DEFAULT_SANS"/>
</Extension>
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCache.cs
===================================================================
@@ -47,6 +47,7 @@ class MessageBubbleCache : IDisposable
internal Pango.FontDescription fontDescription;
internal Pango.FontDescription tooltipFontDescription;
+ internal Pango.FontDescription errorCountFontDescription;
public MessageBubbleTextMarker CurrentSelectedTextMarker;
@@ -64,6 +65,7 @@ public MessageBubbleCache (TextEditor editor)
editor.HAdjustment.ValueChanged += HandleValueChanged;
fontDescription = FontService.GetFontDescription ("MessageBubbles");
tooltipFontDescription = FontService.GetFontDescription ("MessageBubbleTooltip");
+ errorCountFontDescription = FontService.GetFontDescription ("MessageBubbleCounter");
}
void HandleValueChanged (object sender, EventArgs e)
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs
===================================================================
@@ -283,7 +283,7 @@ internal void EnsureLayoutCreated (TextEditor editor)
if (errorCountLayout == null && errors.Count > 1) {
errorCountLayout = new Pango.Layout (editor.PangoContext);
- errorCountLayout.FontDescription = FontService.GetFontDescription ("MessageBubbles");
+ errorCountLayout.FontDescription = cache.errorCountFontDescription;
errorCountLayout.SetText (errors.Count.ToString ());
}
}
Commit: 509a5109bbb8c9a30405aee2c23aeeabc4ab922b
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-04 06:24:53 GMT
URL: https://github.com/mono/monodevelop/commit/509a5109bbb8c9a30405aee2c23aeeabc4ab922b
Fixed 'Bug 15144 - Itemized errors/warnings in error/warning popovers
are 1px too close vertically.'.
Changed paths:
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCache.cs
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCache.cs
===================================================================
@@ -109,7 +109,7 @@ public MessageBubblePopoverWindow (MessageBubbleCache cache, MessageBubbleTextMa
// Layout constants
const int verticalTextBorder = 10;
- const int verticalTextSpace = 6;
+ const int verticalTextSpace = 7;
const int textBorder = 12;
const int iconTextSpacing = 8;
@@ -176,7 +176,7 @@ protected override void OnDrawContent (Gdk.EventExpose evnt, Cairo.Context g)
g.Translate (
textBorder,
- y + verticalTextSpace / 2
+ y + verticalTextSpace / 2 + 1 + Math.Max (0, (h - icon.Height) / 2)
);
Gdk.CairoHelper.SetSourcePixbuf (g, icon, 0, 0);
g.Paint ();
Commit: b5d4ff0ee268ce762d4aec29a320c3ef1b400847
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-04 07:00:47 GMT
URL: https://github.com/mono/monodevelop/commit/b5d4ff0ee268ce762d4aec29a320c3ef1b400847
Fixed 'Bug 15149 - Source analysis should not underline whitespace at
start of line'.
Changed paths:
M main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultMarker.cs
Modified: main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultMarker.cs
===================================================================
@@ -100,12 +100,21 @@ public override void Draw (TextEditor editor, Cairo.Context cr, Pango.Layout lay
double drawTo;
if (markerStart < startOffset && endOffset < markerEnd) {
- drawFrom = startXPos;
drawTo = endXPos;
+ var line = editor.GetLineByOffset (startOffset);
+ int offset = line.GetIndentation (editor.Document).Length;
+ drawFrom = startXPos + (layout.IndexToPos (offset).X / Pango.Scale.PangoScale);
} else {
- int start = startOffset < markerStart ? markerStart : startOffset;
+ int start;
+ if (startOffset < markerStart) {
+ start = markerStart;
+ } else {
+ var line = editor.GetLineByOffset (startOffset);
+ int offset = line.GetIndentation (editor.Document).Length;
+ start = startOffset + offset;
+ }
int end = endOffset < markerEnd ? endOffset : markerEnd;
- int /*lineNr,*/ x_pos;
+ int x_pos;
x_pos = layout.IndexToPos (start - startOffset).X;
drawFrom = startXPos + (int)(x_pos / Pango.Scale.PangoScale);
Commit: 26871acc772acb5215397a87d63fb69788ef1a45
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-04 07:04:02 GMT
URL: https://github.com/mono/monodevelop/commit/26871acc772acb5215397a87d63fb69788ef1a45
Fixed 'Bug 15132 - Error in context action provider Extract anonymous method'
Changed paths:
M main/external/nrefactory
Modified: main/external/nrefactory
===================================================================
@@ -1 +1 @@
-Subproject commit fa88481929300a84cc250da95287f42581549660
+Subproject commit db6790073271e1a078dfd3084bab76951be7a13e
Commit: 50e8653c5ead8ae82449064e3183eb1169abb52c
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-04 07:13:10 GMT
URL: https://github.com/mono/monodevelop/commit/50e8653c5ead8ae82449064e3183eb1169abb52c
Fixed 'Bug 15150 - Exception in text editor chain'.
Changed paths:
M main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs
Modified: main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs
===================================================================
@@ -284,6 +284,8 @@ ICompletionContextProvider CreateContextProvider ()
CSharpTypeResolveContext CreateTypeResolveContext ()
{
var compilation = UnresolvedFileCompilation;
+ if (compilation == null)
+ return null;
var rctx = new CSharpTypeResolveContext (compilation.MainAssembly);
var loc = TextEditorData.Caret.Location;
rctx = rctx.WithUsingScope (CSharpUnresolvedFile.GetUsingScope (loc).Resolve (compilation));
@@ -320,7 +322,8 @@ ICompletionDataList InternalHandleCodeCompletion (CodeCompletionContext completi
var list = new CSharpCompletionDataList ();
list.Resolver = CSharpUnresolvedFile != null ? CSharpUnresolvedFile.GetResolver (UnresolvedFileCompilation, Document.Editor.Caret.Location) : new CSharpResolver (Compilation);
var ctx = CreateTypeResolveContext ();
-
+ if (ctx == null)
+ return null;
var completionDataFactory = new CompletionDataFactory (this, new CSharpResolver (ctx));
var engine = new CSharpCompletionEngine (
data.Document,
@@ -392,12 +395,15 @@ static bool HasAllUsedParameters (IParameterDataProvider provider, List<string>
}
public override int GuessBestMethodOverload (IParameterDataProvider provider, int currentOverload)
{
+ var ctx = CreateTypeResolveContext ();
+ if (ctx == null)
+ return -1;
var engine = new CSharpParameterCompletionEngine (
TextEditorData.Document,
CreateContextProvider (),
this,
Document.GetProjectContext (),
- CreateTypeResolveContext ()
+ ctx
);
List<string> list;
int cparam = engine.GetCurrentParameterIndex (provider.StartOffset, document.Editor.Caret.Offset, out list);
@@ -550,13 +556,17 @@ public override ParameterDataProvider HandleParameterCompletion (CodeCompletionC
// return null;
if (Unit == null || CSharpUnresolvedFile == null)
return null;
+ var ctx = CreateTypeResolveContext ();
+ if (ctx == null)
+ return null;
+
try {
var engine = new CSharpParameterCompletionEngine (
TextEditorData.Document,
CreateContextProvider (),
this,
Document.GetProjectContext (),
- CreateTypeResolveContext ()
+ ctx
);
return engine.GetParameterDataProvider (completionContext.TriggerOffset, completionChar) as ParameterDataProvider;
} catch (Exception e) {
@@ -592,12 +602,18 @@ List<string> GetUsedNamespaces ()
public override bool GetParameterCompletionCommandOffset (out int cpos)
{
+ var ctx = CreateTypeResolveContext ();
+ if (ctx == null) {
+ cpos = -1;
+ return false;
+ }
+
var engine = new CSharpParameterCompletionEngine (
TextEditorData.Document,
CreateContextProvider (),
this,
Document.GetProjectContext (),
- CreateTypeResolveContext ()
+ ctx
);
engine.SetOffset (document.Editor.Caret.Offset);
return engine.GetParameterCompletionCommandOffset (out cpos);
@@ -605,13 +621,17 @@ public override bool GetParameterCompletionCommandOffset (out int cpos)
public override int GetCurrentParameterIndex (int startOffset)
{
+ var ctx = CreateTypeResolveContext ();
+ if (ctx == null)
+ return -1;
+
var engine = new CSharpParameterCompletionEngine (
TextEditorData.Document,
CreateContextProvider (),
this,
Document.GetProjectContext (),
- CreateTypeResolveContext ()
- );
+ ctx
+ );
List<string> list;
return engine.GetCurrentParameterIndex (startOffset, document.Editor.Caret.Offset, out list);
}
Commit: 393b1b07144dc675e3ab3b1c34eec391afa7e5d7
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-04 07:15:54 GMT
URL: https://github.com/mono/monodevelop/commit/393b1b07144dc675e3ab3b1c34eec391afa7e5d7
Fixed 'Bug 15163 - Tools->Options->Name Conventions causes IDE Error
'.
Changed paths:
M main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs
Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs
===================================================================
@@ -769,7 +769,7 @@ public ParsedDocument UpdateParseDocument ()
try {
string currentParseFile = FileName;
var editor = Editor;
- if (editor == null)
+ if (editor == null || string.IsNullOrEmpty (currentParseFile))
return null;
TypeSystemService.AddSkippedFile (currentParseFile);
string currentParseText = editor.Text;
Commit: 4eb97cdbd016550444273f1e2e5a6d7c1fb841b9
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-04 07:21:10 GMT
URL: https://github.com/mono/monodevelop/commit/4eb97cdbd016550444273f1e2e5a6d7c1fb841b9
Fixed 'Bug 15176 - IKVM error repeatedly shown in the console'
Changed paths:
M main/external/nrefactory
Modified: main/external/nrefactory
===================================================================
@@ -1 +1 @@
-Subproject commit db6790073271e1a078dfd3084bab76951be7a13e
+Subproject commit 27e1e4b97b35dd1cd902e05a3dfd2d441fb0ece4
Commit: 2f87e94e9c521e1dacb83f6b0137d105f5212e83
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-04 07:48:52 GMT
URL: https://github.com/mono/monodevelop/commit/2f87e94e9c521e1dacb83f6b0137d105f5212e83
Fixed 'Bug 15171 - Redundant method override does not understand Equals/GetHashCode pair'
Changed paths:
M main/external/nrefactory
Modified: main/external/nrefactory
===================================================================
@@ -1 +1 @@
-Subproject commit 27e1e4b97b35dd1cd902e05a3dfd2d441fb0ece4
+Subproject commit 57731dd4ad94d0b4f5f64dc814c13a3d56349333
Commit: c30a06152b09ae23fc13dfa96012325a61be1fb3
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-04 08:09:54 GMT
URL: https://github.com/mono/monodevelop/commit/c30a06152b09ae23fc13dfa96012325a61be1fb3
Fixed 'Bug 15189 - Incorrect underlining after accented characters '.
Changed paths:
M main/src/core/Mono.Texteditor/Mono.TextEditor/UrlMarker.cs
Modified: main/src/core/Mono.Texteditor/Mono.TextEditor/UrlMarker.cs
===================================================================
@@ -27,6 +27,7 @@
using System;
using Gdk;
using Mono.TextEditor.Highlighting;
+using Gtk;
namespace Mono.TextEditor
{
@@ -121,11 +122,13 @@ public override void Draw (TextEditor editor, Cairo.Context cr, double y, LineMe
} else {
int start = startOffset < markerStart ? markerStart : startOffset;
int end = endOffset < markerEnd ? endOffset : markerEnd;
- int x_pos = layout.IndexToPos (start - startOffset).X;
-
+
+ uint curIndex = 0, byteIndex = 0;
+ int x_pos = layout.IndexToPos ((int)metrics.Layout.TranslateToUTF8Index ((uint)(start - startOffset), ref curIndex, ref byteIndex)).X;
+
@from = startXPos + (int)(x_pos / Pango.Scale.PangoScale);
- x_pos = layout.IndexToPos (end - startOffset).X;
+ x_pos = layout.IndexToPos ((int)metrics.Layout.TranslateToUTF8Index ((uint)(end - startOffset), ref curIndex, ref byteIndex)).X;
to = startXPos + (int)(x_pos / Pango.Scale.PangoScale);
}
Commit: 705741528177066165ea2023ba235e80027b6882
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-04 08:33:14 GMT
URL: https://github.com/mono/monodevelop/commit/705741528177066165ea2023ba235e80027b6882
Fixed 'Bug 15188 - Code is highlighting incorrectly'
Changed paths:
M main/external/nrefactory
Modified: main/external/nrefactory
===================================================================
@@ -1 +1 @@
-Subproject commit 57731dd4ad94d0b4f5f64dc814c13a3d56349333
+Subproject commit f87afbda52fcd81c4a30afa494bed05d1260be44
Commit: 2526c934bd5b798ef18f24eb1e1d3b40cce3ee3d
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-04 08:54:35 GMT
URL: https://github.com/mono/monodevelop/commit/2526c934bd5b798ef18f24eb1e1d3b40cce3ee3d
Fixed 'Bug 15183 - New completion in params suggests array type'
Changed paths:
M main/external/nrefactory
Modified: main/external/nrefactory
===================================================================
@@ -1 +1 @@
-Subproject commit f87afbda52fcd81c4a30afa494bed05d1260be44
+Subproject commit 2c929187326333deafc127201af501ed40a8a01e
Commit: da4b32b427ef5793bd797c9030ba8c7523f0131d
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-04 09:18:15 GMT
URL: https://github.com/mono/monodevelop/commit/da4b32b427ef5793bd797c9030ba8c7523f0131d
Fixed 'Bug 15181 - Generic overloads of importable types are not coalesced'
Changed paths:
M main/external/nrefactory
M main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs
Modified: main/external/nrefactory
===================================================================
@@ -1 +1 @@
-Subproject commit 2c929187326333deafc127201af501ed40a8a01e
+Subproject commit f1c98de0874d430e40a7bbec4a833a25ab30ed03
Modified: main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs
===================================================================
@@ -1096,25 +1096,25 @@ ICompletionData ICompletionDataFactory.CreateFormatItemCompletionData(string for
}
- class ImportSymbolCompletionData : CompletionData
+ class ImportSymbolCompletionData : CompletionData, IEntityCompletionData
{
- IType type;
-// ParsedDocument unit;
- MonoDevelop.Ide.Gui.Document doc;
- bool useFullName;
-// bool addConstructors;
-
+ readonly IType type;
+ readonly bool useFullName;
+ readonly CSharpCompletionTextEditorExtension ext;
public IType Type {
get { return this.type; }
}
- public ImportSymbolCompletionData (MonoDevelop.Ide.Gui.Document doc, bool useFullName, IType type, bool addConstructors)
+ public ImportSymbolCompletionData (CSharpCompletionTextEditorExtension ext, bool useFullName, IType type, bool addConstructors)
{
- this.doc = doc;
+ this.ext = ext;
this.useFullName = useFullName;
this.type = type;
-// this.unit = doc.ParsedDocument;
-// this.addConstructors = addConstructors;
+ }
+
+ public override TooltipInformation CreateTooltipInformation (bool smartWrap)
+ {
+ return MemberCompletionData.CreateTooltipInformation (ext, null, type.GetDefinition (), smartWrap);
}
bool initialized = false;
@@ -1135,6 +1135,7 @@ void Initialize ()
public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier)
{
Initialize ();
+ var doc = ext.document;
using (var undo = doc.Editor.OpenUndoGroup ()) {
string text = insertNamespace ? type.Namespace + "." + type.Name : type.Name;
if (text != GetCurrentWord (window)) {
@@ -1219,12 +1220,46 @@ public override int CompareTo (object obj)
}
return result;
}
+
+ List<CompletionData> overloads;
+
+ public override IEnumerable<ICompletionData> OverloadedData {
+ get {
+ yield return this;
+ if (overloads == null)
+ yield break;
+ foreach (var overload in overloads)
+ yield return overload;
+ }
+ }
+
+ public override bool HasOverloads {
+ get { return overloads != null && overloads.Count > 0; }
+ }
+
+ public override void AddOverload (ICSharpCode.NRefactory.Completion.ICompletionData data)
+ {
+ AddOverload ((ImportSymbolCompletionData)data);
+ }
+
+ void AddOverload (ImportSymbolCompletionData overload)
+ {
+ if (overloads == null)
+ overloads = new List<CompletionData> ();
+ overloads.Add (overload);
+ }
+
+ IEntity IEntityCompletionData.Entity {
+ get {
+ return type.GetDefinition ();
+ }
+ }
}
ICompletionData ICompletionDataFactory.CreateImportCompletionData(IType type, bool useFullName, bool addConstructors)
{
- return new ImportSymbolCompletionData (ext.Document, useFullName, type, addConstructors);
+ return new ImportSymbolCompletionData (ext, useFullName, type, addConstructors);
}
}
Commit: 8d748598f81479ae2e9efa4a5e47f6f9bc9d5013
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-04 12:39:00 GMT
URL: https://github.com/mono/monodevelop/commit/8d748598f81479ae2e9efa4a5e47f6f9bc9d5013
Fixed 'Bug 15178 - Error while trying to deserialize
ICSharpCode.NRefactory.TypeSystem.IProjectContent'.
Changed paths:
M main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs
Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs
===================================================================
@@ -1280,11 +1280,17 @@ static IProjectContent LoadProjectCache (Project project)
var cacheFile = Path.Combine (cacheDir, "completion.cache");
if (!File.Exists (cacheFile))
return null;
- var cache = DeserializeObject<IProjectContent> (cacheFile);
- var monoDevelopProjectContent = cache as MonoDevelopProjectContent;
- if (monoDevelopProjectContent != null)
- monoDevelopProjectContent.Project = project;
- return cache;
+ try {
+ var cache = DeserializeObject<IProjectContent> (cacheFile);
+ var monoDevelopProjectContent = cache as MonoDevelopProjectContent;
+ if (monoDevelopProjectContent != null)
+ monoDevelopProjectContent.Project = project;
+ return cache;
+ } catch (Exception e) {
+ LoggingService.LogWarning ("Error while reading completion cache, regenerating", e);
+ Directory.Delete (cacheDir, true);
+ return null;
+ }
}
#region IAssemblyReference implementation
Commit: 8964d792069a73001510d82b26041aa031559c64
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-04 13:28:23 GMT
URL: https://github.com/mono/monodevelop/commit/8964d792069a73001510d82b26041aa031559c64
Fixed 'Bug 15125 - unable to remove //TODO tasks after removing or
renaming file'.
Changed paths:
M main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs
Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs
===================================================================
@@ -1651,6 +1651,10 @@ static void OnFileRenamed (object sender, ProjectFileRenamedEventArgs args)
content.UpdateContent (c => c.RemoveFiles (fargs.OldName));
content.InformFileRemoved (new ParsedFileEventArgs (file));
+ var tags = content.GetExtensionObject <ProjectCommentTags> ();
+ if (tags != null)
+ tags.RemoveFile (project, fargs.OldName);
+
QueueParseJob (content, new [] { fargs.ProjectFile });
}
}
@@ -2716,12 +2720,15 @@ static void CheckModifiedFiles (Project project, ProjectFile[] projectFiles, Pro
}
modifiedFiles.Add (file);
}
-
+ var tags = content.GetExtensionObject <ProjectCommentTags> ();
+
// check if file needs to be removed from project content
foreach (var file in cnt.Files) {
if (project.GetProjectFile (file.FileName) == null) {
content.UpdateContent (c => c.RemoveFiles (file.FileName));
content.InformFileRemoved (new ParsedFileEventArgs (file));
+ if (tags != null)
+ tags.RemoveFile (project, file.FileName);
}
}
Commit: 7e96e6ebb06ef097f4f3b6fbfd6ef95cfc97f7fa
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-04 15:25:20 GMT
URL: https://github.com/mono/monodevelop/commit/7e96e6ebb06ef097f4f3b6fbfd6ef95cfc97f7fa
[Refactoring] Fixed potential crash in results editor extension.
Changed paths:
M main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultsEditorExtension.cs
Modified: main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultsEditorExtension.cs
===================================================================
@@ -193,7 +193,8 @@ bool IdleHandler ()
if (currentResult.InspectionMark != IssueMarker.None) {
int start = editor.LocationToOffset (currentResult.Region.Begin);
int end = editor.LocationToOffset (currentResult.Region.End);
-
+ if (start >= end)
+ continue;
if (currentResult.InspectionMark == IssueMarker.GrayOut) {
var marker = new GrayOutMarker (currentResult, TextSegment.FromBounds (start, end));
marker.IsVisible = currentResult.Underline;
Commit: d542aac2fdf5e4379a58ac56d050f5646b385c5f
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-04 18:44:36 GMT
URL: https://github.com/mono/monodevelop/commit/d542aac2fdf5e4379a58ac56d050f5646b385c5f
[SourceEditor] Changed message bubble font size.
Changed paths:
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.addin.xml
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.addin.xml
===================================================================
@@ -1,6 +1,6 @@
<ExtensionModel>
- <!-- Extension points -->
+ <!-- Extension points -->
<ExtensionPoint path = "/MonoDevelop/SourceEditor2/ContextMenu/Editor" name = "Editor context menu">
<Description>Context menu for the editor.</Description>;
@@ -218,9 +218,9 @@
</Extension>
<Extension path = "/MonoDevelop/Ide/Fonts">
- <Font name ="MessageBubbles" _displayName="Message bubbles" default ="_DEFAULT_SANS" defaultMac = "Lucida Grande 10"/>
- <Font name ="MessageBubbleCounter" _displayName="Message bubbles error count" default ="_DEFAULT_SANS" defaultMac = "Lucida Grande Bold 10"/>
- <Font name ="MessageBubbleTooltip" _displayName="Message bubbles tooltip" default ="_DEFAULT_SANS" defaultMac = "Lucida Grande Bold 10"/>
+ <Font name ="MessageBubbles" _displayName="Message bubbles" default ="_DEFAULT_SANS" defaultMac = "Lucida Grande 11"/>
+ <Font name ="MessageBubbleCounter" _displayName="Message bubbles error count" default ="_DEFAULT_SANS" defaultMac = "Lucida Grande Bold 11"/>
+ <Font name ="MessageBubbleTooltip" _displayName="Message bubbles tooltip" default ="_DEFAULT_SANS" defaultMac = "Lucida Grande Bold 11"/>
<Font name ="LanguageTooltips" _displayName="Editor tooltips" default ="_DEFAULT_SANS"/>
</Extension>
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs
===================================================================
@@ -447,8 +447,8 @@ public override void DrawAfterEol (TextEditor textEditor, Cairo.Context g, doubl
errorCountLayout.GetPixelSize (out ew, out eh);
g.Translate (
- errorCounterX + (errorCounterWidth - ew) / 2,
- errorCounterY + (errorCounterHeight - eh) / 2
+ errorCounterX + (2 + errorCounterWidth - ew) / 2,
+ errorCounterY + (-1 + errorCounterHeight - eh) / 2
);
g.SetSourceColor (CounterColor.SecondColor);
g.ShowLayout (errorCountLayout);
Commit: b453e031dba9a97bf683164a2e95084d29f15cb0
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-07 05:41:42 GMT
URL: https://github.com/mono/monodevelop/commit/b453e031dba9a97bf683164a2e95084d29f15cb0
[Refactoring] Made framework lookup errors more verbose (will help to
track down 'Bug 15223 - Can't create framework lookup')
Changed paths:
M main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/ResolveCommandHandler.cs
Modified: main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/ResolveCommandHandler.cs
===================================================================
@@ -346,7 +346,7 @@ static IEnumerable<PossibleNamespace> GetPossibleNamespaces (Document doc, AstNo
}
} catch (Exception e) {
if (!TypeSystemService.RecreateFrameworkLookup (netProject))
- LoggingService.LogError ("Error while looking up framework extension methods.", e);
+ LoggingService.LogError (string.Format ("Error while looking up extension method {0}", umResult.MemberName), e);
}
}
bool foundIdentifier = false;
@@ -449,7 +449,7 @@ out inferredTypes
}
} catch (Exception e) {
if (!TypeSystemService.RecreateFrameworkLookup (netProject))
- LoggingService.LogError ("Error while looking up framework types.", e);
+ LoggingService.LogError (string.Format ("Error while looking up identifier {0}", uiResult.Identifier), e);
}
foreach(var kv in lookups)
yield return new PossibleNamespace (kv.Item1.Namespace, true, new MonoDevelop.Projects.ProjectReference (kv.Item2));
@@ -470,7 +470,7 @@ out inferredTypes
}
} catch (Exception e) {
if (!TypeSystemService.RecreateFrameworkLookup (netProject))
- LoggingService.LogError ("Error while looking up framework types.", e);
+ LoggingService.LogError (string.Format ("Error while looking up member resolve result {0}", node), e);
}
foreach(var kv in lookups)
yield return new PossibleNamespace (kv.Item1.Namespace, true, new MonoDevelop.Projects.ProjectReference (kv.Item2));
Commit: 67aba4279f258210f5fb496033075b138537c367
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-07 06:04:49 GMT
URL: https://github.com/mono/monodevelop/commit/67aba4279f258210f5fb496033075b138537c367
Fixed 'Bug 15146 - Inline error & warning ellipsis bubble gaps '
Changed paths:
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs
===================================================================
@@ -379,18 +379,21 @@ public override void DrawAfterEol (TextEditor textEditor, Cairo.Context g, doubl
bool hideText = false;
bubbleIsReduced = customLayout;
var showErrorCount = errorCounterWidth > 0 && errorCountLayout != null;
+ double roundingRadius = editor.LineHeight / 2 - 1;
+
if (customLayout) {
width = editor.Allocation.Width - sx;
string text = layouts[0].Layout.Text;
drawLayout = new Pango.Layout (editor.PangoContext);
drawLayout.FontDescription = cache.fontDescription;
var paintWidth = (width - errorCounterWidth - editor.LineHeight + 4);
- var minWidth = Math.Max (17, errorCounterWidth) + editor.LineHeight;
+ var minWidth = Math.Max (25, errorCounterWidth) * editor.Options.Zoom;
if (paintWidth < minWidth) {
hideText = true;
- drawLayout.SetMarkup ("<span weight='heavy'>···</span>");
- width = minWidth;
showErrorCount = false;
+// drawLayout.SetMarkup ("<span weight='heavy'>···</span>");
+ width = minWidth;
+ roundingRadius = 10 * editor.Options.Zoom;
sx = Math.Min (sx, editor.Allocation.Width - width);
} else {
drawLayout.Ellipsize = Pango.EllipsizeMode.End;
@@ -406,7 +409,7 @@ public override void DrawAfterEol (TextEditor textEditor, Cairo.Context g, doubl
bubbleWidth = width;
var bubbleHeight = editor.LineHeight - 1;
- g.RoundedRectangle (sx, y + 1, width, bubbleHeight, editor.LineHeight / 2 - 1);
+ g.RoundedRectangle (sx, y + 1, width, bubbleHeight, roundingRadius);
g.SetSourceColor (TagColor.Color);
g.Fill ();
@@ -455,8 +458,26 @@ public override void DrawAfterEol (TextEditor textEditor, Cairo.Context g, doubl
g.Restore ();
}
- // Draw label text
- if (!showErrorCount || !hideText) {
+ if (hideText) {
+ // Draw dots
+ double radius = 2 * editor.Options.Zoom;
+ double spacing = 1 * editor.Options.Zoom;
+ double shadowOffset = 1 * editor.Options.Zoom;
+
+ sx += 1 * editor.Options.Zoom + Math.Ceiling((bubbleWidth - 3 * (radius * 2) - 2 * spacing) / 2);
+ for (int i = 0; i < 3; i++) {
+ g.Arc (sx, y + 1 + bubbleHeight / 2 + shadowOffset, radius, 0, Math.PI * 2);
+ g.SetSourceColor (MessageBubbleCache.ShadowColor);
+ g.Fill ();
+
+ g.Arc (sx, y + 1 + bubbleHeight / 2, radius, 0, Math.PI * 2);
+ g.SetSourceColor (TagColor.SecondColor);
+ g.Fill ();
+ sx += radius * 2 + spacing;
+ }
+
+ } else {
+ // Draw label text
g.Save ();
g.Translate (sx + editor.LineHeight / 2, y + (editor.LineHeight - layouts [0].Height) / 2 + 1);
Commit: 8c9f2f175e7882eb5f7c84e83a86df973ad5f053
Author: Lluis Sanchez <[email protected]> (slluis)
Date: 2013-10-07 13:35:10 GMT
URL: https://github.com/mono/monodevelop/commit/8c9f2f175e7882eb5f7c84e83a86df973ad5f053
Bump guiunit
Changed paths:
M main/external/guiunit
Modified: main/external/guiunit
===================================================================
@@ -1 +1 @@
-Subproject commit 1895e4bbff9cef63b3667ac73da3fdf58f79e46f
+Subproject commit aaf2b9650baad6c5c9f06f5f431958803f386135
Commit: a4333995eab854b1166426738c410686bed8218e
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-07 13:46:34 GMT
URL: https://github.com/mono/monodevelop/commit/a4333995eab854b1166426738c410686bed8218e
[CSharpBinding] Changed protocol support.
Changed paths:
M main/src/addins/CSharpBinding/CSharpBinding.addin.xml
M main/src/addins/CSharpBinding/CSharpBinding.csproj
M main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ExportCodeGenerator.cs
M main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerationService.cs
Added paths:
A main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/Issues/MissingRequiredProtocolMemberIssue.cs
Modified: main/src/addins/CSharpBinding/CSharpBinding.addin.xml
===================================================================
@@ -231,7 +231,8 @@
<Class class = "MonoDevelop.CodeGeneration.ReadonlyPropertyGenerator" />
<Class class = "MonoDevelop.CodeGeneration.PropertyGenerator" />
<Class class = "MonoDevelop.CodeGeneration.ImplementInterfaceMembersGenerator" />
- <Class class = "MonoDevelop.CodeGeneration.ExportCodeGenerator" />
+ <Class class = "MonoDevelop.CodeGeneration.RequiredProtocolMemberGenerator" />
+ <Class class = "MonoDevelop.CodeGeneration.OptionalProtocolMemberGenerator" />
<Class class = "MonoDevelop.CodeGeneration.PartialGenerator" />
<Class class = "MonoDevelop.CodeGeneration.OverrideMembersGenerator" />
<Class class = "MonoDevelop.CodeGeneration.ToStringGenerator" />
Modified: main/src/addins/CSharpBinding/CSharpBinding.csproj
===================================================================
@@ -22,8 +22,8 @@
<Execution clr-version="Net_2_0" />
</Execution>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
- <GenerateDocumentation>true</GenerateDocumentation>
<NoWarn>1591;1573</NoWarn>
+ <DocumentationFile>..\..\..\build\AddIns\BackendBindings\MonoDevelop.CSharpBinding.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -37,8 +37,8 @@
</Execution>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<DebugSymbols>true</DebugSymbols>
- <GenerateDocumentation>true</GenerateDocumentation>
<NoWarn>1591;1573</NoWarn>
+ <DocumentationFile>..\..\..\build\AddIns\BackendBindings\MonoDevelop.CSharpBinding.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\core\MonoDevelop.Core\MonoDevelop.Core.csproj">
@@ -324,6 +324,7 @@
<Compile Include="MonoDevelop.CSharp.Refactoring.CodeIssues\Issues\MonoTODOIssue.cs" />
<Compile Include="MonoDevelop.CSharp.Refactoring\CSharpCodeGenerationService.cs" />
<Compile Include="MonoDevelop.CSharp.CodeGeneration\ExportCodeGenerator.cs" />
+ <Compile Include="MonoDevelop.CSharp.Refactoring.CodeIssues\Issues\MissingRequiredProtocolMemberIssue.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Makefile.am" />
Modified: main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ExportCodeGenerator.cs
===================================================================
@@ -33,22 +33,24 @@
using ICSharpCode.NRefactory.CSharp.Refactoring;
using MonoDevelop.CSharp.Refactoring.CodeActions;
using MonoDevelop.CSharp.Refactoring;
+using MonoDevelop.CodeGeneration;
namespace MonoDevelop.CodeGeneration
{
- class ExportCodeGenerator : ICodeGenerator
+ abstract class BaseExportCodeGenerator : ICodeGenerator
{
+ public abstract bool IsValidMember (IMember member);
#region ICodeGenerator implementation
bool ICodeGenerator.IsValid (CodeGenerationOptions options)
{
- return new ExportMethods (options).IsValid ();
+ return new ExportMethods (this, options).IsValid ();
}
IGenerateAction ICodeGenerator.InitalizeSelection (CodeGenerationOptions options, TreeView treeView)
{
- var exportMethods = new ExportMethods (options);
+ var exportMethods = new ExportMethods (this, options);
exportMethods.Initialize (treeView);
return exportMethods;
}
@@ -59,24 +61,81 @@ IGenerateAction ICodeGenerator.InitalizeSelection (CodeGenerationOptions options
}
}
- string ICodeGenerator.Text {
- get {
- return GettextCatalog.GetString ("Implement protocol methods");
+ public abstract string Text {
+ get;
+ }
+
+ public abstract string GenerateDescription {
+ get;
+ }
+
+ #endregion
+
+ public static bool HasProtocolAttribute (IType type, out string name)
+ {
+ foreach (var attrs in type.GetDefinition ().GetAttributes ()) {
+ if (attrs.AttributeType.Name == "ProtocolAttribute" && attrs.AttributeType.Namespace == "MonoTouch.Foundation") {
+ foreach (var na in attrs.NamedArguments) {
+ if (na.Key.Name != "Name")
+ continue;
+ name = na.Value.ConstantValue as string;
+ if (name != null)
+ return true;
+ }
+ }
}
+ name = null;
+ return false;
}
- string ICodeGenerator.GenerateDescription {
- get {
- return GettextCatalog.GetString ("Select methods to implement");
+ public static ICSharpCode.NRefactory.CSharp.Attribute GenerateExportAttribute (RefactoringContext ctx, IMember member)
+ {
+ if (member == null)
+ return null;
+ var astType = ctx.CreateShortType ("MonoTouch.Foundation", "ExportAttribute");
+ if (astType is SimpleType) {
+ astType = new SimpleType ("Export");
+ } else {
+ astType = new MemberType (new MemberType (new SimpleType ("MonoTouch"), "Foundation"), "Export");
}
+
+ var attr = new ICSharpCode.NRefactory.CSharp.Attribute {
+ Type = astType,
+ };
+ var exportAttribute = member.GetAttribute (new FullTypeName (new TopLevelTypeName ("MonoTouch.Foundation", "ExportAttribute")));
+ if (exportAttribute == null || exportAttribute.PositionalArguments.Count == 0)
+ return null;
+ attr.Arguments.Add (new PrimitiveExpression (exportAttribute.PositionalArguments.First ().ConstantValue));
+ return attr;
+
+ }
+
+ IMember GetProtocolMember (RefactoringContext ctx, IType protocolType, IMember member)
+ {
+ foreach (var m in protocolType.GetMembers (m => m.SymbolKind == member.SymbolKind && m.Name == member.Name)) {
+ if (!SignatureComparer.Ordinal.Equals (m, member))
+ return null;
+ var prop = m as IProperty;
+ if (prop != null) {
+ if (prop.CanGet && GenerateExportAttribute (ctx, prop.Getter) != null ||
+ prop.CanSet && GenerateExportAttribute (ctx, prop.Setter) != null)
+ return m;
+ } else {
+ if (GenerateExportAttribute (ctx, m) != null)
+ return m;
+ }
+ }
+ return null;
}
- #endregion
class ExportMethods : AbstractGenerateAction
{
- public ExportMethods (CodeGenerationOptions options) : base (options)
+ readonly BaseExportCodeGenerator cg;
+
+ public ExportMethods (BaseExportCodeGenerator cg, CodeGenerationOptions options) : base (options)
{
+ this.cg = cg;
}
@@ -87,16 +146,24 @@ protected override IEnumerable<object> GetValidMembers ()
yield break;
foreach (var t in type.DirectBaseTypes) {
string name;
- if (!CSharpCodeGenerationService.HasProtocolAttribute (t, out name))
+ if (!HasProtocolAttribute (t, out name))
continue;
var protocolType = Options.Document.Compilation.FindType (new FullTypeName (new TopLevelTypeName (t.Namespace, name)));
if (protocolType == null)
break;
foreach (var member in protocolType.GetMethods (null, GetMemberOptions.IgnoreInheritedMembers)) {
+ if (member.ImplementedInterfaceMembers.Any ())
+ continue;
+ if (!cg.IsValidMember (member))
+ continue;
if (member.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation"))
yield return member;
}
foreach (var member in protocolType.GetProperties (null, GetMemberOptions.IgnoreInheritedMembers)) {
+ if (member.ImplementedInterfaceMembers.Any ())
+ continue;
+ if (!cg.IsValidMember (member))
+ continue;
if (member.CanGet && member.Getter.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation") ||
member.CanSet && member.Setter.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation"))
yield return member;
@@ -123,7 +190,7 @@ protected override IEnumerable<string> GenerateCode (List<object> includedMember
method.Modifiers &= ~Modifiers.Abstract;
method.Attributes.Add (new AttributeSection {
- Attributes = { CSharpCodeGenerationService.GenerateExportAttribute (ctx, member) }
+ Attributes = { GenerateExportAttribute (ctx, member) }
});
yield return method.ToString ();
continue;
@@ -148,7 +215,7 @@ protected override IEnumerable<string> GenerateCode (List<object> includedMember
};
property.Getter.Attributes.Add (new AttributeSection {
- Attributes = { CSharpCodeGenerationService.GenerateExportAttribute (ctx, p.Getter) }
+ Attributes = { GenerateExportAttribute (ctx, p.Getter) }
});
}
if (p.CanSet) {
@@ -157,7 +224,7 @@ protected override IEnumerable<string> GenerateCode (List<object> includedMember
};
property.Setter.Attributes.Add (new AttributeSection {
- Attributes = { CSharpCodeGenerationService.GenerateExportAttribute (ctx, p.Setter) }
+ Attributes = { GenerateExportAttribute (ctx, p.Setter) }
});
}
yield return property.ToString ();
@@ -167,5 +234,46 @@ protected override IEnumerable<string> GenerateCode (List<object> includedMember
}
}
}
+
+ class OptionalProtocolMemberGenerator : BaseExportCodeGenerator
+ {
+ public override string Text {
+ get {
+ return GettextCatalog.GetString ("Implement protocol members");
+ }
+ }
+
+ public override string GenerateDescription {
+ get {
+ return GettextCatalog.GetString ("Select protocol members to implement");
+ }
+ }
+
+ public override bool IsValidMember (IMember member)
+ {
+ return !member.IsAbstract;
+ }
+ }
+
+ class RequiredProtocolMemberGenerator : BaseExportCodeGenerator
+ {
+ public override string Text {
+ get {
+ return GettextCatalog.GetString ("Implement required protocol members");
+ }
+ }
+
+ public override string GenerateDescription {
+ get {
+ return GettextCatalog.GetString ("Select protocol members to implement");
+ }
+ }
+
+ public override bool IsValidMember (IMember member)
+ {
+ return member.IsAbstract;
+ }
+ }
+
}
Added: main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/Issues/MissingRequiredProtocolMemberIssue.cs
===================================================================
@@ -0,0 +1,164 @@
+//
+// MissingRequiredProtocolMemberIssue.cs
+//
+// Author:
+// Mike Krüger <[email protected]>
+//
+// Copyright (c) 2013 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.CSharp.Refactoring.CodeActions;
+using MonoDevelop.CodeIssues;
+using ICSharpCode.NRefactory.CSharp;
+using System.Collections.Generic;
+using ICSharpCode.NRefactory.Semantics;
+using ICSharpCode.NRefactory.CSharp.Resolver;
+using ICSharpCode.NRefactory.TypeSystem;
+using System.Linq;
+using MonoDevelop.CodeGeneration;
+using ICSharpCode.NRefactory.CSharp.Refactoring;
+
+namespace MonoDevelop.CSharp.Refactoring.CodeIssues
+{
+ public class MissingRequiredProtocolMemberIssue : MonoDevelop.CodeIssues.CodeIssueProvider
+ {
+ public override bool HasSubIssues {
+ get {
+ return false;
+ }
+ }
+
+ public MissingRequiredProtocolMemberIssue ()
+ {
+ this.Title = "Missing protocol member issue";
+ this.Description = "Missing protocol member issue";
+ this.Category = IssueCategories.Notifications;
+ this.SetMimeType ("text/x-csharp");
+ this.IsEnabledByDefault = true;
+ this.SetSeverity (ICSharpCode.NRefactory.Refactoring.Severity.Warning);
+ this.SetIsEnabled (true);
+ }
+
+ public override IEnumerable<MonoDevelop.CodeIssues.CodeIssue> GetIssues (object refactoringContext, System.Threading.CancellationToken cancellationToken)
+ {
+ var context = refactoringContext as MDRefactoringContext;
+ if (context == null || context.IsInvalid || context.RootNode == null || context.ParsedDocument.HasErrors)
+ return new MonoDevelop.CodeIssues.CodeIssue[0];
+ var visitor = new MissingRequiredProtocolMemberIssueVisitor (context);
+ context.RootNode.AcceptVisitor (visitor);
+ return visitor.Issues;
+ }
+
+ class MissingRequiredProtocolMemberIssueVisitor : DepthFirstAstVisitor
+ {
+ readonly MDRefactoringContext ctx;
+ public readonly List<MonoDevelop.CodeIssues.CodeIssue> Issues = new List<MonoDevelop.CodeIssues.CodeIssue> ();
+
+ public MissingRequiredProtocolMemberIssueVisitor (MDRefactoringContext ctx)
+ {
+ this.ctx = ctx;
+ }
+
+ bool FindProtocolMember (IType type, IMember member)
+ {
+ foreach (var t in type.GetMembers ()) {
+ if (SignatureComparer.Ordinal.Equals (t, member))
+ return true;
+ }
+ return false;
+ }
+
+ void AddIssue (IType type, AstType bt, IType t)
+ {
+ Issues.Add (
+ new MonoDevelop.CodeIssues.CodeIssue (
+ ICSharpCode.NRefactory.Refactoring.IssueMarker.WavedLine,
+ "Some required protocol members are missing",
+ new DomRegion (bt.StartLocation, bt.EndLocation),
+ "MissingRequiredProtocolMemberIssue",
+ new MonoDevelop.CodeActions.CodeAction[] {
+ new MonoDevelop.CodeActions.DefaultCodeAction (
+ "Implement required protocol members",
+ (ctx, s) => {
+ var service = (ICSharpCode.NRefactory.CSharp.CodeGenerationService)ctx.GetService (typeof (ICSharpCode.NRefactory.CSharp.CodeGenerationService));
+ var implementedNodes = GetAllProtocolMembers (t).Where (member => !FindProtocolMember (type, member)).Select (pm => (AstNode)service.GenerateMemberImplementation (ctx, pm, false)).ToList ();
+ s.InsertWithCursor ("Add missing protocol members", Script.InsertPosition.End, implementedNodes);
+ }
+ )
+ }
+ ));
+ }
+
+ public IEnumerable<IMember> GetAllProtocolMembers (IType t)
+ {
+ string name;
+ if (!BaseExportCodeGenerator.HasProtocolAttribute (t, out name))
+ yield break;
+
+ var protocolType = ctx.Compilation.FindType (new FullTypeName (new TopLevelTypeName (t.Namespace, name)));
+ if (protocolType == null)
+ yield break;
+
+ foreach (var member in protocolType.GetMethods (null, GetMemberOptions.IgnoreInheritedMembers)) {
+ if (member.ImplementedInterfaceMembers.Any ())
+ continue;
+ if (member.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation")) {
+ yield return member;
+ }
+ }
+
+ foreach (var member in protocolType.GetProperties (null, GetMemberOptions.IgnoreInheritedMembers)) {
+ if (member.ImplementedInterfaceMembers.Any ())
+ continue;
+ if (member.CanGet && member.Getter.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation") ||
+ member.CanSet && member.Setter.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation")) {
+ yield return member;
+ }
+ }
+ }
+
+ public override void VisitTypeDeclaration (TypeDeclaration typeDeclaration)
+ {
+ base.VisitTypeDeclaration (typeDeclaration);
+ var type = ctx.Resolve (typeDeclaration).Type;
+
+ foreach (var bt in typeDeclaration.BaseTypes) {
+ var t = ctx.Resolve (bt).Type;
+
+ foreach (var member in GetAllProtocolMembers (t)) {
+ if (!member.IsAbstract)
+ continue;
+ if (!FindProtocolMember (type, member)) {
+ AddIssue (type, bt, t);
+ return;
+ }
+ }
+ }
+ }
+
+ public override void VisitBlockStatement (BlockStatement blockStatement)
+ {
+ // SKIP
+ }
+ }
+ }
+}
+
Modified: main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerationService.cs
===================================================================
@@ -35,104 +35,9 @@ namespace MonoDevelop.CSharp.Refactoring
{
public class CSharpCodeGenerationService : DefaultCodeGenerationService
{
- public static bool HasProtocolAttribute (IType type, out string name)
- {
- foreach (var attrs in type.GetDefinition ().GetAttributes ()) {
- if (attrs.AttributeType.Name == "ProtocolAttribute" && attrs.AttributeType.Namespace == "MonoTouch.Foundation") {
- foreach (var na in attrs.NamedArguments) {
- if (na.Key.Name != "Name")
- continue;
- name = na.Value.ConstantValue as string;
- if (name != null)
- return true;
- }
- }
- }
- name = null;
- return false;
- }
-
- public static ICSharpCode.NRefactory.CSharp.Attribute GenerateExportAttribute (RefactoringContext ctx, IMember member)
- {
- if (member == null)
- return null;
- var astType = ctx.CreateShortType ("MonoTouch.Foundation", "ExportAttribute");
- if (astType is SimpleType) {
- astType = new SimpleType ("Export");
- } else {
- astType = new MemberType (new MemberType (new SimpleType ("MonoTouch"), "Foundation"), "Export");
- }
-
- var attr = new ICSharpCode.NRefactory.CSharp.Attribute {
- Type = astType,
- };
- var exportAttribute = member.GetAttribute (new FullTypeName (new TopLevelTypeName ("MonoTouch.Foundation", "ExportAttribute")));
- if (exportAttribute == null || exportAttribute.PositionalArguments.Count == 0)
- return null;
- attr.Arguments.Add (new PrimitiveExpression (exportAttribute.PositionalArguments.First ().ConstantValue));
- return attr;
-
- }
-
- IMember GetProtocolMember (RefactoringContext ctx, IType protocolType, IMember member)
- {
- foreach (var m in protocolType.GetMembers (m => m.SymbolKind == member.SymbolKind && m.Name == member.Name)) {
- if (!SignatureComparer.Ordinal.Equals (m, member))
- return null;
- var prop = m as IProperty;
- if (prop != null) {
- if (prop.CanGet && GenerateExportAttribute (ctx, prop.Getter) != null ||
- prop.CanSet && GenerateExportAttribute (ctx, prop.Setter) != null)
- return m;
- } else {
- if (GenerateExportAttribute (ctx, m) != null)
- return m;
- }
- }
- return null;
- }
-
public override EntityDeclaration GenerateMemberImplementation (RefactoringContext context, IMember member, bool explicitImplementation)
{
var result = base.GenerateMemberImplementation (context, member, explicitImplementation);
- string name;
- if (HasProtocolAttribute (member.DeclaringType, out name)) {
- var protocolType = context.Compilation.FindType (new FullTypeName (new TopLevelTypeName (member.DeclaringType.Namespace, name)));
- if (protocolType != null) {
- var property = result as PropertyDeclaration;
- var protocolMember = GetProtocolMember (context, protocolType, member);
- if (protocolMember != null) {
- if (property != null) {
- var ppm = (IProperty)protocolMember;
- if (ppm.CanGet) {
- var attr = CSharpCodeGenerationService.GenerateExportAttribute (context, ppm.Getter);
- if (attr != null) {
- property.Getter.Attributes.Add (new AttributeSection {
- Attributes = { attr }
- });
- }
- }
-
- if (ppm.CanSet) {
- var attr = CSharpCodeGenerationService.GenerateExportAttribute (context, ppm.Setter);
- if (attr != null) {
- property.Getter.Attributes.Add (new AttributeSection {
- Attributes = { attr }
- });
- }
- }
- } else {
- var attribute = CSharpCodeGenerationService.GenerateExportAttribute (context, protocolMember);
- if (attribute != null) {
- result.Attributes.Add (new AttributeSection {
- Attributes = { attribute }
- });
- }
- }
- }
- }
- }
-
if (CSharpCodeGenerator.IsMonoTouchModelMember (member)) {
var m = result as MethodDeclaration;
if (m != null) {
@@ -155,4 +60,3 @@ public override EntityDeclaration GenerateMemberImplementation (RefactoringConte
}
}
}
-
Commit: b651c0aa4fe2068c2b5d49f4a2e420b0f05b8ae9
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-07 13:59:10 GMT
URL: https://github.com/mono/monodevelop/commit/b651c0aa4fe2068c2b5d49f4a2e420b0f05b8ae9
[CSharpBinding] Removed missing required protocol member issue.
Changed paths:
M main/src/addins/CSharpBinding/CSharpBinding.csproj
Removed paths:
D main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/Issues/MissingRequiredProtocolMemberIssue.cs
Modified: main/src/addins/CSharpBinding/CSharpBinding.csproj
===================================================================
@@ -324,7 +324,6 @@
<Compile Include="MonoDevelop.CSharp.Refactoring.CodeIssues\Issues\MonoTODOIssue.cs" />
<Compile Include="MonoDevelop.CSharp.Refactoring\CSharpCodeGenerationService.cs" />
<Compile Include="MonoDevelop.CSharp.CodeGeneration\ExportCodeGenerator.cs" />
- <Compile Include="MonoDevelop.CSharp.Refactoring.CodeIssues\Issues\MissingRequiredProtocolMemberIssue.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Makefile.am" />
Removed: main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeIssues/Issues/MissingRequiredProtocolMemberIssue.cs
===================================================================
@@ -1,164 +0,0 @@
-//
-// MissingRequiredProtocolMemberIssue.cs
-//
-// Author:
-// Mike Krüger <[email protected]>
-//
-// Copyright (c) 2013 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.CSharp.Refactoring.CodeActions;
-using MonoDevelop.CodeIssues;
-using ICSharpCode.NRefactory.CSharp;
-using System.Collections.Generic;
-using ICSharpCode.NRefactory.Semantics;
-using ICSharpCode.NRefactory.CSharp.Resolver;
-using ICSharpCode.NRefactory.TypeSystem;
-using System.Linq;
-using MonoDevelop.CodeGeneration;
-using ICSharpCode.NRefactory.CSharp.Refactoring;
-
-namespace MonoDevelop.CSharp.Refactoring.CodeIssues
-{
- public class MissingRequiredProtocolMemberIssue : MonoDevelop.CodeIssues.CodeIssueProvider
- {
- public override bool HasSubIssues {
- get {
- return false;
- }
- }
-
- public MissingRequiredProtocolMemberIssue ()
- {
- this.Title = "Missing protocol member issue";
- this.Description = "Missing protocol member issue";
- this.Category = IssueCategories.Notifications;
- this.SetMimeType ("text/x-csharp");
- this.IsEnabledByDefault = true;
- this.SetSeverity (ICSharpCode.NRefactory.Refactoring.Severity.Warning);
- this.SetIsEnabled (true);
- }
-
- public override IEnumerable<MonoDevelop.CodeIssues.CodeIssue> GetIssues (object refactoringContext, System.Threading.CancellationToken cancellationToken)
- {
- var context = refactoringContext as MDRefactoringContext;
- if (context == null || context.IsInvalid || context.RootNode == null || context.ParsedDocument.HasErrors)
- return new MonoDevelop.CodeIssues.CodeIssue[0];
- var visitor = new MissingRequiredProtocolMemberIssueVisitor (context);
- context.RootNode.AcceptVisitor (visitor);
- return visitor.Issues;
- }
-
- class MissingRequiredProtocolMemberIssueVisitor : DepthFirstAstVisitor
- {
- readonly MDRefactoringContext ctx;
- public readonly List<MonoDevelop.CodeIssues.CodeIssue> Issues = new List<MonoDevelop.CodeIssues.CodeIssue> ();
-
- public MissingRequiredProtocolMemberIssueVisitor (MDRefactoringContext ctx)
- {
- this.ctx = ctx;
- }
-
- bool FindProtocolMember (IType type, IMember member)
- {
- foreach (var t in type.GetMembers ()) {
- if (SignatureComparer.Ordinal.Equals (t, member))
- return true;
- }
- return false;
- }
-
- void AddIssue (IType type, AstType bt, IType t)
- {
- Issues.Add (
- new MonoDevelop.CodeIssues.CodeIssue (
- ICSharpCode.NRefactory.Refactoring.IssueMarker.WavedLine,
- "Some required protocol members are missing",
- new DomRegion (bt.StartLocation, bt.EndLocation),
- "MissingRequiredProtocolMemberIssue",
- new MonoDevelop.CodeActions.CodeAction[] {
- new MonoDevelop.CodeActions.DefaultCodeAction (
- "Implement required protocol members",
- (ctx, s) => {
- var service = (ICSharpCode.NRefactory.CSharp.CodeGenerationService)ctx.GetService (typeof (ICSharpCode.NRefactory.CSharp.CodeGenerationService));
- var implementedNodes = GetAllProtocolMembers (t).Where (member => !FindProtocolMember (type, member)).Select (pm => (AstNode)service.GenerateMemberImplementation (ctx, pm, false)).ToList ();
- s.InsertWithCursor ("Add missing protocol members", Script.InsertPosition.End, implementedNodes);
- }
- )
- }
- ));
- }
-
- public IEnumerable<IMember> GetAllProtocolMembers (IType t)
- {
- string name;
- if (!BaseExportCodeGenerator.HasProtocolAttribute (t, out name))
- yield break;
-
- var protocolType = ctx.Compilation.FindType (new FullTypeName (new TopLevelTypeName (t.Namespace, name)));
- if (protocolType == null)
- yield break;
-
- foreach (var member in protocolType.GetMethods (null, GetMemberOptions.IgnoreInheritedMembers)) {
- if (member.ImplementedInterfaceMembers.Any ())
- continue;
- if (member.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation")) {
- yield return member;
- }
- }
-
- foreach (var member in protocolType.GetProperties (null, GetMemberOptions.IgnoreInheritedMembers)) {
- if (member.ImplementedInterfaceMembers.Any ())
- continue;
- if (member.CanGet && member.Getter.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation") ||
- member.CanSet && member.Setter.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation")) {
- yield return member;
- }
- }
- }
-
- public override void VisitTypeDeclaration (TypeDeclaration typeDeclaration)
- {
- base.VisitTypeDeclaration (typeDeclaration);
- var type = ctx.Resolve (typeDeclaration).Type;
-
- foreach (var bt in typeDeclaration.BaseTypes) {
- var t = ctx.Resolve (bt).Type;
-
- foreach (var member in GetAllProtocolMembers (t)) {
- if (!member.IsAbstract)
- continue;
- if (!FindProtocolMember (type, member)) {
- AddIssue (type, bt, t);
- return;
- }
- }
- }
- }
-
- public override void VisitBlockStatement (BlockStatement blockStatement)
- {
- // SKIP
- }
- }
- }
-}
-
Commit: a857484d60790c9b070e712393e8234f27d3a4eb
Author: Lluis Sanchez <[email protected]> (slluis)
Date: 2013-10-07 14:05:15 GMT
URL: https://github.com/mono/monodevelop/commit/a857484d60790c9b070e712393e8234f27d3a4eb
[NUnit] Improve support for guiunit
When running on guiunit there is no need to parse the resulting xml
file, since all results come through the tcp connection.
Improved TcpTestListener. It now properly reports the status for all
the sections (nodes) of a test suite.
Fixed 15165 - Xamarin Studio cannot run single tests using an external
test runner correctly.
Changed paths:
M main/src/addins/NUnit/Services/NUnitAssemblyTestSuite.cs
M main/src/addins/NUnit/Services/TcpTestListener.cs
Modified: main/src/addins/NUnit/Services/NUnitAssemblyTestSuite.cs
===================================================================
@@ -477,7 +477,7 @@ UnitTestResult RunWithConsoleRunner (ProcessExecutionCommand cmd, UnitTest test,
else if (!string.IsNullOrEmpty (suiteName))
cmd.Arguments += " -run=" + suiteName;
if (automaticUpdates) {
- var tcpListener = new MonoDevelop.NUnit.External.TcpTestListener (localMonitor);
+ var tcpListener = new MonoDevelop.NUnit.External.TcpTestListener (localMonitor, suiteName);
cmd.Arguments += " -port=" + tcpListener.Port;
}
var p = testContext.ExecutionContext.Execute (cmd, cons);
@@ -489,7 +489,13 @@ UnitTestResult RunWithConsoleRunner (ProcessExecutionCommand cmd, UnitTest test,
if (new FileInfo (outFile).Length == 0)
throw new Exception ("Command failed");
-
+
+ if (automaticUpdates) {
+ if (testName != null)
+ return localMonitor.SingleTestResult;
+ return test.GetLastResult ();
+ }
+
XDocument doc = XDocument.Load (outFile);
if (doc.Root != null) {
@@ -511,7 +517,10 @@ UnitTestResult RunWithConsoleRunner (ProcessExecutionCommand cmd, UnitTest test,
}
bool macunitStyle = doc.Root.Element ("environment") != null && doc.Root.Element ("environment").Attribute ("macunit-version") != null;
- return ReportXmlResult (localMonitor, root, "", macunitStyle);
+ var result = ReportXmlResult (localMonitor, root, "", macunitStyle);
+ if (testName != null)
+ result = localMonitor.SingleTestResult;
+ return result;
}
}
throw new Exception ("Test results could not be parsed.");
Modified: main/src/addins/NUnit/Services/TcpTestListener.cs
===================================================================
@@ -34,11 +34,18 @@
using System.Xml.Linq;
using System.Collections.Generic;
using System.Linq;
+using MonoDevelop.Core;
namespace MonoDevelop.NUnit.External
{
class TcpTestListener
{
+ string testSuiteName;
+ string rootTestName;
+
+ List<Tuple<string,UnitTestResult>> suiteStack = new List<Tuple<string, UnitTestResult>> ();
+ IRemoteEventListener listener;
+
TcpListener TcpListener {
get; set;
}
@@ -48,8 +55,12 @@ class TcpTestListener
}
- public TcpTestListener (IRemoteEventListener listener)
+ public TcpTestListener (IRemoteEventListener listener, string suiteName)
{
+ this.testSuiteName = suiteName;
+ this.listener = listener;
+ bool rootSuiteStarted = false;
+
TcpListener = new TcpListener (new IPEndPoint (IPAddress.Loopback, 0));
TcpListener.Start ();
Task.Factory.StartNew (() => {
@@ -61,29 +72,114 @@ public TcpTestListener (IRemoteEventListener listener)
string line = null;
while ((line = reader.ReadLine ()) != null) {
var element = XElement.Parse (line);
+ string testName = element.Attribute ("name").Value;
+ var action = element.Name.LocalName;
+
+ if (testSuiteName.Length == 0 && !rootSuiteStarted) {
+ // Running the whole assembly
+ rootTestName = testName;
+ rootSuiteStarted = true;
+ continue;
+ }
+ if (testSuiteName == testName && !rootSuiteStarted) {
+ // Running a test suite
+ rootTestName = testName;
+ rootSuiteStarted = true;
+ listener.SuiteStarted ("<root>");
+ continue;
+ }
- Gtk.Application.Invoke (delegate {
- var testName = element.Attribute ("name").Value;
- if (element.Name.LocalName == "suite-started") {
- listener.SuiteStarted (testName);
- } else if (element.Name.LocalName == "test-started") {
- listener.TestStarted (testName);
- } else if (element.Name.LocalName == "test-finished") {
- listener.TestFinished (testName, CreateResult (element));
- } else if (element.Name.LocalName == "suite-finished") {
- listener.SuiteFinished (testName, CreateResult (element));
+ if (!rootSuiteStarted)
+ continue;
+
+ switch (action) {
+ case "suite-started":
+ UpdateTestSuiteStatus (testName, false); break;
+ case "test-started":
+ UpdateTestSuiteStatus (testName, true);
+ listener.TestStarted (testName); break;
+ case "test-finished":
+ var res = CreateResult (element);
+ AddTestResult (res);
+ listener.TestFinished (testName, res); break;
+ case "suite-finished":
+ if (testName == rootTestName) {
+ FinishSuites (0);
+ listener.SuiteFinished ("<root>", CreateResult (element));
+ rootSuiteStarted = false;
}
- });
+ break;
+ }
}
}
- } catch {
-
+ } catch (Exception ex) {
+ LoggingService.LogError ("Exception in test listener", ex);
} finally {
TcpListener.Stop ();
}
});
}
+ void UpdateTestSuiteStatus (string name, bool isTest)
+ {
+ if (testSuiteName.Length > 0)
+ name = name.Substring (testSuiteName.Length + 1);
+ string[] parts = name.Split ('.');
+ for (int n = 0; n < parts.Length; n++) {
+ if (n >= suiteStack.Count) {
+ StartSuite (parts[n]);
+ } else if (parts [n] != suiteStack [n].Item1) {
+ FinishSuites (n);
+ StartSuite (parts[n]);
+ }
+ }
+ }
+
+ void FinishSuites (int stackLevel)
+ {
+ if (stackLevel + 1 < suiteStack.Count)
+ FinishSuites (stackLevel + 1);
+
+ if (stackLevel >= suiteStack.Count)
+ return;
+
+ var tname = GetTestSuiteName (stackLevel);
+ var res = suiteStack [stackLevel].Item2;
+
+ suiteStack.RemoveAt (stackLevel);
+
+ listener.SuiteFinished (tname, res);
+ }
+
+ void StartSuite (string name)
+ {
+ suiteStack.Add (new Tuple<string, UnitTestResult> (name, new UnitTestResult ()));
+ name = GetTestSuiteName (suiteStack.Count - 1);
+ listener.SuiteStarted (name);
+ }
+
+ void AddTestResult (UnitTestResult res)
+ {
+ foreach (var r in suiteStack)
+ r.Item2.Add (res);
+ }
+
+ string GetTestSuiteName (int stackLevel)
+ {
+ var info = suiteStack [stackLevel];
+
+ string name;
+ if (stackLevel > 0) {
+ var prefix = string.Join (".", suiteStack.Select (s => s.Item1).Take (stackLevel));
+ name = prefix + "." + info.Item1;
+ } else
+ name = info.Item1;
+
+ if (testSuiteName.Length > 0)
+ name = testSuiteName + "." + name;
+ return name;
+ }
+
UnitTestResult CreateResult (XElement element)
{
var result = (ResultStatus)Enum.Parse (typeof(ResultStatus), element.Attribute ("result").Value);
@@ -92,12 +188,17 @@ UnitTestResult CreateResult (XElement element)
var ignored = int.Parse (element.Attribute ("ignored").Value);
var inconclusive = int.Parse (element.Attribute ("inconclusive").Value);
+ var message = (string)element.Attribute ("message");
+ var stackTrace = (string)element.Attribute ("stack-trace");
+
return new UnitTestResult {
Status = result,
Passed = passed,
Failures = failures,
Ignored = ignored,
- Inconclusive = inconclusive
+ Inconclusive = inconclusive,
+ Message = message,
+ StackTrace = stackTrace
};
}
}
Commit: 227ed70c97dec07e6bcc06ecbb73b5b05b027e53
Author: Lluis Sanchez <[email protected]> (slluis)
Date: 2013-10-07 14:05:15 GMT
URL: https://github.com/mono/monodevelop/commit/227ed70c97dec07e6bcc06ecbb73b5b05b027e53
[NUnit] Fix minor status reporting issue
Changed paths:
M main/src/addins/NUnit/Services/TcpTestListener.cs
Modified: main/src/addins/NUnit/Services/TcpTestListener.cs
===================================================================
@@ -125,7 +125,8 @@ void UpdateTestSuiteStatus (string name, bool isTest)
if (testSuiteName.Length > 0)
name = name.Substring (testSuiteName.Length + 1);
string[] parts = name.Split ('.');
- for (int n = 0; n < parts.Length; n++) {
+ int len = isTest ? parts.Length - 1 : parts.Length;
+ for (int n = 0; n < len; n++) {
if (n >= suiteStack.Count) {
StartSuite (parts[n]);
} else if (parts [n] != suiteStack [n].Item1) {
Commit: e700b33c97a32cfc407e887d8b32edef92b4a751
Author: Lluis Sanchez <[email protected]> (slluis)
Date: 2013-10-07 14:05:15 GMT
URL: https://github.com/mono/monodevelop/commit/e700b33c97a32cfc407e887d8b32edef92b4a751
[NUnit] There is no need to explicitly initialize the results pad
Changed paths:
M main/src/addins/NUnit/Services/NUnitAssemblyTestSuite.cs
M main/src/addins/NUnit/Services/TestContext.cs
Modified: main/src/addins/NUnit/Services/NUnitAssemblyTestSuite.cs
===================================================================
@@ -499,12 +499,6 @@ UnitTestResult RunWithConsoleRunner (ProcessExecutionCommand cmd, UnitTest test,
XDocument doc = XDocument.Load (outFile);
if (doc.Root != null) {
- if (automaticUpdates) {
- DispatchService.GuiDispatch (delegate {
- testContext.ResultsPad.InitializeTestRun (test);
- });
- }
-
var root = doc.Root.Elements ("test-suite").FirstOrDefault ();
if (root != null) {
cons.SetDone ();
Modified: main/src/addins/NUnit/Services/TestContext.cs
===================================================================
@@ -44,7 +44,6 @@ public class TestContext
public TestContext (ITestProgressMonitor monitor, TestResultsPad resultsPad, IExecutionHandler executionContext, DateTime testDate)
{
this.monitor = monitor;
- ResultsPad = resultsPad;
if (executionContext == null)
executionContext = Runtime.ProcessService.DefaultExecutionHandler;
this.executionContext = executionContext;
@@ -68,10 +67,6 @@ public TestContext (ITestProgressMonitor monitor, TestResultsPad resultsPad, IEx
public IExecutionHandler ExecutionContext {
get { return executionContext; }
}
-
- internal TestResultsPad ResultsPad {
- get; private set;
- }
}
}
Commit: f44289407e88e371b6ff37ed303d62039d34784f
Author: Lluis Sanchez <[email protected]> (slluis)
Date: 2013-10-07 14:05:15 GMT
URL: https://github.com/mono/monodevelop/commit/f44289407e88e371b6ff37ed303d62039d34784f
[NUnit] Improve reporting of Ignored status
Changed paths:
M main/src/addins/NUnit/Gui/TestNodeBuilder.cs
Modified: main/src/addins/NUnit/Gui/TestNodeBuilder.cs
===================================================================
@@ -92,6 +92,8 @@ public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, ref
UnitTestResult res = test.GetLastResult ();
if (res == null)
icon = CircleImage.None;
+ else if (res.Status == ResultStatus.Ignored)
+ icon = CircleImage.NotRun;
else if (res.ErrorsAndFailures > 0 && res.Passed > 0)
icon = test.IsHistoricResult ? CircleImage.OldSuccessAndFailure : CircleImage.SuccessAndFailure;
else if (res.IsInconclusive)
@@ -100,7 +102,7 @@ public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, ref
icon = test.IsHistoricResult ? CircleImage.OldFailure : CircleImage.Failure;
else if (res.IsSuccess)
icon = test.IsHistoricResult ? CircleImage.OldSuccess : CircleImage.Success;
- else if (res.IsNotRun)
+ else if (res.IsNotRun || res.Ignored > 0)
icon = CircleImage.NotRun;
else
icon = CircleImage.None;
Commit: 885ee71029cf931866be2172390f5239eeb21baf
Author: lluis <[email protected]> (slluis)
Date: 2013-10-07 16:07:03 GMT
URL: https://github.com/mono/monodevelop/commit/885ee71029cf931866be2172390f5239eeb21baf
Updated references to xwt, md-addins
Changed paths:
M main/external/xwt
M version-checks
Modified: main/external/xwt
===================================================================
@@ -1 +1 @@
-Subproject commit 349382e4160990bf1dc50270bb60df6880ce764c
+Subproject commit 02e7692f58b760fa2920d452683fb8c2d704fca9
Modified: version-checks
===================================================================
@@ -17,7 +17,7 @@ DEP[0]=md-addins
DEP_NAME[0]=MDADDINS
DEP_PATH[0]=${top_srcdir}/../md-addins
DEP_MODULE[0][email protected]:xamarin/md-addins.git
-DEP_NEEDED_VERSION[0]=59f4149622960f18be872224e0dea5ef91a14ba0
+DEP_NEEDED_VERSION[0]=0ec3fc0bf0c9ad0049214019f2c38f90cb2311b8
DEP_BRANCH_AND_REMOTE[0]="master origin/master"
# heap-shot
Commit: adecf653ea5cc189f5d8500711e99b8a14b86bd8
Author: Jérémie Laval <[email protected]> (garuma)
Date: 2013-10-07 16:32:45 GMT
URL: https://github.com/mono/monodevelop/commit/adecf653ea5cc189f5d8500711e99b8a14b86bd8
[build] Bump xwt for compilation fix on Windows
Changed paths:
M main/external/xwt
M version-checks
Modified: main/external/xwt
===================================================================
@@ -1 +1 @@
-Subproject commit 02e7692f58b760fa2920d452683fb8c2d704fca9
+Subproject commit 08c43fbfe872498989c04c4444292bdcd0c3bbd1
Modified: version-checks
===================================================================
@@ -17,7 +17,7 @@ DEP[0]=md-addins
DEP_NAME[0]=MDADDINS
DEP_PATH[0]=${top_srcdir}/../md-addins
DEP_MODULE[0][email protected]:xamarin/md-addins.git
-DEP_NEEDED_VERSION[0]=0ec3fc0bf0c9ad0049214019f2c38f90cb2311b8
+DEP_NEEDED_VERSION[0]=35fdc0a55c20027b578905ab0a7b2902168d3a63
DEP_BRANCH_AND_REMOTE[0]="master origin/master"
# heap-shot
Commit: c63513b958364c5d263dbd73c8f6b1f613aae622
Author: Lluis Sanchez <[email protected]> (slluis)
Date: 2013-10-07 16:53:32 GMT
URL: https://github.com/mono/monodevelop/commit/c63513b958364c5d263dbd73c8f6b1f613aae622
Fix unit tests
Changed paths:
M main/tests/test-projects/vs-local-copy/ClassLibrary1/ClassLibrary1.csproj
M main/tests/test-projects/vs-local-copy/ClassLibrary2/ClassLibrary2.csproj
M main/tests/test-projects/vs-local-copy/ClassLibrary3/ClassLibrary3.csproj
M main/tests/test-projects/vs-local-copy/ClassLibrary4/ClassLibrary4.csproj
M main/tests/test-projects/vs-local-copy/ClassLibrary5/ClassLibrary5.csproj
M main/tests/test-projects/vs-local-copy/VSLocalCopyTest/VSLocalCopyTest.csproj
Modified: main/tests/test-projects/vs-local-copy/ClassLibrary1/ClassLibrary1.csproj
===================================================================
@@ -23,7 +23,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
Modified: main/tests/test-projects/vs-local-copy/ClassLibrary2/ClassLibrary2.csproj
===================================================================
@@ -23,7 +23,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
Modified: main/tests/test-projects/vs-local-copy/ClassLibrary3/ClassLibrary3.csproj
===================================================================
@@ -23,7 +23,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
Modified: main/tests/test-projects/vs-local-copy/ClassLibrary4/ClassLibrary4.csproj
===================================================================
@@ -23,7 +23,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
Modified: main/tests/test-projects/vs-local-copy/ClassLibrary5/ClassLibrary5.csproj
===================================================================
@@ -23,7 +23,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
Modified: main/tests/test-projects/vs-local-copy/VSLocalCopyTest/VSLocalCopyTest.csproj
===================================================================
@@ -23,7 +23,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
Commit: 291e15b0909b6c797c921b4a32dd19a8e4f2a4bc
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-08 06:08:34 GMT
URL: https://github.com/mono/monodevelop/commit/291e15b0909b6c797c921b4a32dd19a8e4f2a4bc
[CSharpBinding] Added protocol members to override completion.
Changed paths:
M main/external/nrefactory
M main/src/addins/CSharpBinding/CSharpBinding.csproj
M main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ExportCodeGenerator.cs
M main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs
Added paths:
A main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/MonoCSharpCompletionEngine.cs
A main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ProtocolCompletionData.cs
Modified: main/external/nrefactory
===================================================================
@@ -1 +1 @@
-Subproject commit f1c98de0874d430e40a7bbec4a833a25ab30ed03
+Subproject commit 9341dfd1ac29b50269259d0f58e5513bf8c6f24b
Modified: main/src/addins/CSharpBinding/CSharpBinding.csproj
===================================================================
@@ -129,6 +129,10 @@
<Project>{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}</Project>
<Name>ICSharpCode.NRefactory.Xml</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory.Tests\ICSharpCode.NRefactory.Tests.csproj">
+ <Project>{63D3B27A-D966-4902-90B3-30290E1692F1}</Project>
+ <Name>ICSharpCode.NRefactory.Tests</Name>
+ </ProjectReference>
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
@@ -324,6 +328,8 @@
<Compile Include="MonoDevelop.CSharp.Refactoring.CodeIssues\Issues\MonoTODOIssue.cs" />
<Compile Include="MonoDevelop.CSharp.Refactoring\CSharpCodeGenerationService.cs" />
<Compile Include="MonoDevelop.CSharp.CodeGeneration\ExportCodeGenerator.cs" />
+ <Compile Include="MonoDevelop.CSharp.Completion\MonoCSharpCompletionEngine.cs" />
+ <Compile Include="MonoDevelop.CSharp.Completion\ProtocolCompletionData.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Makefile.am" />
Modified: main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ExportCodeGenerator.cs
===================================================================
@@ -110,7 +110,7 @@ public static ICSharpCode.NRefactory.CSharp.Attribute GenerateExportAttribute (R
}
- IMember GetProtocolMember (RefactoringContext ctx, IType protocolType, IMember member)
+ IMember GetProtocolMember (MDRefactoringContext ctx, IType protocolType, IMember member)
{
foreach (var m in protocolType.GetMembers (m => m.SymbolKind == member.SymbolKind && m.Name == member.Name)) {
if (!SignatureComparer.Ordinal.Equals (m, member))
@@ -171,6 +171,8 @@ protected override IEnumerable<object> GetValidMembers ()
}
}
+
+
protected override IEnumerable<string> GenerateCode (List<object> includedMembers)
{
var generator = Options.CreateCodeGenerator ();
@@ -181,57 +183,61 @@ protected override IEnumerable<string> GenerateCode (List<object> includedMember
var builder = ctx.CreateTypeSystemAstBuilder ();
foreach (IMember member in includedMembers) {
- var method = builder.ConvertEntity (member) as MethodDeclaration;
- if (method != null) {
- method.Body = new BlockStatement () {
- new ThrowStatement (new ObjectCreateExpression (ctx.CreateShortType ("System", "NotImplementedException")))
- };
- method.Modifiers &= ~Modifiers.Virtual;
- method.Modifiers &= ~Modifiers.Abstract;
-
- method.Attributes.Add (new AttributeSection {
- Attributes = { GenerateExportAttribute (ctx, member) }
- });
- yield return method.ToString ();
- continue;
+ yield return GenerateMemberCode (ctx, builder, member);
+ }
+ }
+ }
+
+ internal static string GenerateMemberCode (MDRefactoringContext ctx, TypeSystemAstBuilder builder, IMember member)
+ {
+ var method = builder.ConvertEntity (member) as MethodDeclaration;
+ if (method != null) {
+ method.Body = new BlockStatement () {
+ new ThrowStatement (new ObjectCreateExpression (ctx.CreateShortType ("System", "NotImplementedException")))
+ };
+ method.Modifiers &= ~Modifiers.Virtual;
+ method.Modifiers &= ~Modifiers.Abstract;
+ method.Attributes.Add (new AttributeSection {
+ Attributes = {
+ GenerateExportAttribute (ctx, member)
}
- var property = builder.ConvertEntity (member) as PropertyDeclaration;
- if (property != null) {
- var p = (IProperty)member;
-
- var astType = ctx.CreateShortType ("MonoTouch.Foundation", "ExportAttribute");
- if (astType is SimpleType) {
- astType = new SimpleType ("Export");
- } else {
- astType = new MemberType (new MemberType (new SimpleType ("MonoTouch"), "Foundation"), "Export");
- }
-
- property.Modifiers &= ~Modifiers.Virtual;
- property.Modifiers &= ~Modifiers.Abstract;
-
- if (p.CanGet) {
- property.Getter.Body = new BlockStatement () {
- new ThrowStatement (new ObjectCreateExpression (ctx.CreateShortType ("System", "NotImplementedException")))
- };
-
- property.Getter.Attributes.Add (new AttributeSection {
- Attributes = { GenerateExportAttribute (ctx, p.Getter) }
- });
- }
- if (p.CanSet) {
- property.Setter.Body = new BlockStatement () {
- new ThrowStatement (new ObjectCreateExpression (ctx.CreateShortType ("System", "NotImplementedException")))
- };
-
- property.Setter.Attributes.Add (new AttributeSection {
- Attributes = { GenerateExportAttribute (ctx, p.Setter) }
- });
- }
- yield return property.ToString ();
- continue;
+ });
+ return method.ToString ();
+ }
+ var property = builder.ConvertEntity (member) as PropertyDeclaration;
+ if (property == null)
+ return null;
+ var p = (IProperty)member;
+ var astType = ctx.CreateShortType ("MonoTouch.Foundation", "ExportAttribute");
+ if (astType is SimpleType) {
+ astType = new SimpleType ("Export");
+ }
+ else {
+ astType = new MemberType (new MemberType (new SimpleType ("MonoTouch"), "Foundation"), "Export");
+ }
+ property.Modifiers &= ~Modifiers.Virtual;
+ property.Modifiers &= ~Modifiers.Abstract;
+ if (p.CanGet) {
+ property.Getter.Body = new BlockStatement () {
+ new ThrowStatement (new ObjectCreateExpression (ctx.CreateShortType ("System", "NotImplementedException")))
+ };
+ property.Getter.Attributes.Add (new AttributeSection {
+ Attributes = {
+ GenerateExportAttribute (ctx, p.Getter)
}
- }
+ });
+ }
+ if (p.CanSet) {
+ property.Setter.Body = new BlockStatement () {
+ new ThrowStatement (new ObjectCreateExpression (ctx.CreateShortType ("System", "NotImplementedException")))
+ };
+ property.Setter.Attributes.Add (new AttributeSection {
+ Attributes = {
+ GenerateExportAttribute (ctx, p.Setter)
+ }
+ });
}
+ return property.ToString ();
}
}
Modified: main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs
===================================================================
@@ -325,7 +325,8 @@ ICompletionDataList InternalHandleCodeCompletion (CodeCompletionContext completi
if (ctx == null)
return null;
var completionDataFactory = new CompletionDataFactory (this, new CSharpResolver (ctx));
- var engine = new CSharpCompletionEngine (
+ var engine = new MonoCSharpCompletionEngine (
+ this,
data.Document,
CreateContextProvider (),
completionDataFactory,
Added: main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/MonoCSharpCompletionEngine.cs
===================================================================
@@ -0,0 +1,83 @@
+//
+// MonoCSharpCompletionEngine.cs
+//
+// Author:
+// Mike Krüger <[email protected]>
+//
+// Copyright (c) 2013 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 ICSharpCode.NRefactory.CSharp.Completion;
+using System.Collections.Generic;
+using MonoDevelop.CodeGeneration;
+using ICSharpCode.NRefactory.TypeSystem;
+using System.Linq;
+
+namespace MonoDevelop.CSharp.Completion
+{
+ class MonoCSharpCompletionEngine : CSharpCompletionEngine
+ {
+ CSharpCompletionTextEditorExtension ext;
+
+ public MonoCSharpCompletionEngine (CSharpCompletionTextEditorExtension ext, ICSharpCode.NRefactory.Editor.IDocument document, ICompletionContextProvider completionContextProvider, ICompletionDataFactory factory, ICSharpCode.NRefactory.TypeSystem.IProjectContent content, ICSharpCode.NRefactory.CSharp.TypeSystem.CSharpTypeResolveContext ctx) : base (document, completionContextProvider, factory, content, ctx)
+ {
+ this.ext = ext;
+ }
+
+ protected override void AddVirtuals (List<IMember> alreadyInserted, CompletionDataWrapper col, string modifiers, IType curType, int declarationBegin)
+ {
+ base.AddVirtuals (alreadyInserted, col, modifiers, curType, declarationBegin);
+ foreach (var member in GetProtocolMembers (curType)) {
+ if (alreadyInserted.Contains (member))
+ continue;
+ alreadyInserted.Add (member);
+ var data = new ProtocolCompletionData (ext, declarationBegin, this.currentType, member);
+ col.Add (data);
+ }
+ }
+
+ IEnumerable<IMember> GetProtocolMembers (IType curType)
+ {
+ foreach (var t in curType.DirectBaseTypes) {
+ string name;
+ if (!BaseExportCodeGenerator.HasProtocolAttribute (t, out name))
+ continue;
+ var protocolType = Compilation.FindType (new FullTypeName (new TopLevelTypeName (t.Namespace, name)));
+ if (protocolType == null)
+ break;
+ foreach (var member in protocolType.GetMethods (null, GetMemberOptions.IgnoreInheritedMembers)) {
+ if (member.ImplementedInterfaceMembers.Any () || member.IsAbstract || !member.IsVirtual)
+ continue;
+ if (member.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation")) {
+ yield return member;
+ }
+ }
+ foreach (var member in protocolType.GetProperties (null, GetMemberOptions.IgnoreInheritedMembers)) {
+ if (member.ImplementedInterfaceMembers.Any () || member.IsAbstract || !member.IsVirtual)
+ continue;
+ if (member.CanGet && member.Getter.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation") ||
+ member.CanSet && member.Setter.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation"))
+ yield return member;
+ }
+ }
+ }
+ }
+}
+
Added: main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ProtocolCompletionData.cs
===================================================================
@@ -0,0 +1,101 @@
+//
+// ProtocolCompletionData.cs
+//
+// Author:
+// Mike Krüger <[email protected]>
+//
+// Copyright (c) 2013 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 ICSharpCode.NRefactory.TypeSystem;
+using MonoDevelop.Ide.CodeCompletion;
+using MonoDevelop.Ide.TypeSystem;
+using System.Linq;
+using MonoDevelop.CodeGeneration;
+using MonoDevelop.CSharp.Refactoring.CodeActions;
+
+namespace MonoDevelop.CSharp.Completion
+{
+ public class ProtocolCompletionData : CompletionData
+ {
+ CSharpCompletionTextEditorExtension ext;
+ IMember member;
+ static Ambience ambience = new CSharpAmbience ();
+ int declarationBegin;
+ IUnresolvedTypeDefinition type;
+
+ public bool GenerateBody { get; set; }
+
+ public override TooltipInformation CreateTooltipInformation (bool smartWrap)
+ {
+ return MemberCompletionData.CreateTooltipInformation (ext, null, member, smartWrap);
+ }
+
+ public ProtocolCompletionData (CSharpCompletionTextEditorExtension ext, int declarationBegin, IUnresolvedTypeDefinition type, IMember member) : base (null)
+ {
+ this.ext = ext;
+ this.type = type;
+ this.member = member;
+
+ this.declarationBegin = declarationBegin;
+ this.GenerateBody = true;
+ this.Icon = member.GetStockIcon ();
+ this.DisplayText = ambience.GetString (member, OutputFlags.IncludeParameters | OutputFlags.IncludeParameterName | OutputFlags.IncludeGenerics | OutputFlags.HideExtensionsParameter| OutputFlags.IncludeAccessor);
+ this.CompletionText = member.SymbolKind == SymbolKind.Indexer ? "this" : member.Name;
+ }
+
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier)
+ {
+ var editor = ext.TextEditorData;
+ var generator = CodeGenerator.CreateGenerator (ext.Document);
+ bool isExplicit = false;
+ if (member.DeclaringTypeDefinition.Kind == TypeKind.Interface) {
+ foreach (var m in type.Members) {
+ if (m.Name == member.Name && !m.ReturnType.Equals (member.ReturnType)) {
+ isExplicit = true;
+ break;
+ }
+ }
+ }
+ var resolvedType = type.Resolve (ext.Project).GetDefinition ();
+ if (ext.Project != null)
+ generator.PolicyParent = ext.Project.Policies;
+ var ctx = MDRefactoringContext.Create (ext.Document, ext.Document.Editor.Caret.Location);
+ if (ctx == null)
+ return;
+ var builder = ctx.CreateTypeSystemAstBuilder ();
+
+ string sb = BaseExportCodeGenerator.GenerateMemberCode (ctx, builder, member);
+ sb = sb.TrimEnd ();
+
+ // var lastRegion = result.BodyRegions.LastOrDefault ();
+ //targetCaretPosition = declarationBegin + sb.Length;
+
+ editor.Replace (declarationBegin, editor.Caret.Offset - declarationBegin, sb);
+ /* if (selectionEndPosition > 0) {
+ editor.Caret.Offset = selectionEndPosition;
+ editor.SetSelection (targetCaretPosition, selectionEndPosition);
+ } else {
+ editor.Caret.Offset = targetCaretPosition;
+ }*/
+ }
+ }
+}
+
Commit: 64c238e72e7e7e0eb4c36308d45bc2e9061013a6
Author: Lluis Sanchez <[email protected]> (slluis)
Date: 2013-10-08 07:20:48 GMT
URL: https://github.com/mono/monodevelop/commit/64c238e72e7e7e0eb4c36308d45bc2e9061013a6
[Core] Dispose the msbuild builders when shutting down MD
Changed paths:
M main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectService.cs
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectService.cs
===================================================================
@@ -84,6 +84,10 @@ static MSBuildProjectService ()
PropertyService.PropertyChanged += HandlePropertyChanged;
DefaultMSBuildVerbosity = PropertyService.Get ("MonoDevelop.Ide.MSBuildVerbosity", MSBuildVerbosity.Normal);
+
+ Runtime.ShuttingDown += delegate {
+ CleanProjectBuilders ();
+ };
}
static void HandlePropertyChanged (object sender, PropertyChangedEventArgs e)
Commit: 770903378793d81a4e6f80ddcbf634ab105aa54b
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-08 07:22:35 GMT
URL: https://github.com/mono/monodevelop/commit/770903378793d81a4e6f80ddcbf634ab105aa54b
[CSharpBinding] Polished up protocol completion data.
Changed paths:
M main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ExportCodeGenerator.cs
M main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/MonoCSharpCompletionEngine.cs
M main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ProtocolCompletionData.cs
M main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringContext.cs
Modified: main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ExportCodeGenerator.cs
===================================================================
@@ -202,7 +202,7 @@ internal static string GenerateMemberCode (MDRefactoringContext ctx, TypeSystemA
GenerateExportAttribute (ctx, member)
}
});
- return method.ToString ();
+ return method.ToString (ctx.FormattingOptions);
}
var property = builder.ConvertEntity (member) as PropertyDeclaration;
if (property == null)
@@ -237,7 +237,7 @@ internal static string GenerateMemberCode (MDRefactoringContext ctx, TypeSystemA
}
});
}
- return property.ToString ();
+ return property.ToString (ctx.FormattingOptions);
}
}
Modified: main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/MonoCSharpCompletionEngine.cs
===================================================================
@@ -29,16 +29,33 @@
using MonoDevelop.CodeGeneration;
using ICSharpCode.NRefactory.TypeSystem;
using System.Linq;
+using MonoDevelop.CSharp.Refactoring.CodeActions;
+using ICSharpCode.NRefactory.Editor;
namespace MonoDevelop.CSharp.Completion
{
class MonoCSharpCompletionEngine : CSharpCompletionEngine
{
- CSharpCompletionTextEditorExtension ext;
+ readonly CSharpCompletionTextEditorExtension ext;
+ readonly MDRefactoringContext mdRefactoringCtx;
+
+ public CSharpCompletionTextEditorExtension Ext {
+ get {
+ return ext;
+ }
+ }
+
+ public MDRefactoringContext MDRefactoringCtx {
+ get {
+ return mdRefactoringCtx;
+ }
+ }
public MonoCSharpCompletionEngine (CSharpCompletionTextEditorExtension ext, ICSharpCode.NRefactory.Editor.IDocument document, ICompletionContextProvider completionContextProvider, ICompletionDataFactory factory, ICSharpCode.NRefactory.TypeSystem.IProjectContent content, ICSharpCode.NRefactory.CSharp.TypeSystem.CSharpTypeResolveContext ctx) : base (document, completionContextProvider, factory, content, ctx)
{
this.ext = ext;
+ this.mdRefactoringCtx = MDRefactoringContext.Create (ext.Document, ext.Document.Editor.Caret.Location);
+
}
protected override void AddVirtuals (List<IMember> alreadyInserted, CompletionDataWrapper col, string modifiers, IType curType, int declarationBegin)
@@ -48,7 +65,7 @@ protected override void AddVirtuals (List<IMember> alreadyInserted, CompletionDa
if (alreadyInserted.Contains (member))
continue;
alreadyInserted.Add (member);
- var data = new ProtocolCompletionData (ext, declarationBegin, this.currentType, member);
+ var data = new ProtocolCompletionData (this, declarationBegin, member);
col.Add (data);
}
}
Modified: main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ProtocolCompletionData.cs
===================================================================
@@ -27,31 +27,27 @@
using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.CodeCompletion;
using MonoDevelop.Ide.TypeSystem;
-using System.Linq;
using MonoDevelop.CodeGeneration;
-using MonoDevelop.CSharp.Refactoring.CodeActions;
namespace MonoDevelop.CSharp.Completion
{
- public class ProtocolCompletionData : CompletionData
+ class ProtocolCompletionData : CompletionData
{
- CSharpCompletionTextEditorExtension ext;
- IMember member;
- static Ambience ambience = new CSharpAmbience ();
- int declarationBegin;
- IUnresolvedTypeDefinition type;
+ readonly MonoCSharpCompletionEngine engine;
+ readonly IMember member;
+ readonly static Ambience ambience = new CSharpAmbience ();
+ readonly int declarationBegin;
public bool GenerateBody { get; set; }
public override TooltipInformation CreateTooltipInformation (bool smartWrap)
{
- return MemberCompletionData.CreateTooltipInformation (ext, null, member, smartWrap);
+ return MemberCompletionData.CreateTooltipInformation (engine.Ext, null, member, smartWrap);
}
- public ProtocolCompletionData (CSharpCompletionTextEditorExtension ext, int declarationBegin, IUnresolvedTypeDefinition type, IMember member) : base (null)
+ public ProtocolCompletionData (MonoCSharpCompletionEngine engine, int declarationBegin, IMember member) : base (null)
{
- this.ext = ext;
- this.type = type;
+ this.engine = engine;
this.member = member;
this.declarationBegin = declarationBegin;
@@ -63,38 +59,29 @@ public ProtocolCompletionData (CSharpCompletionTextEditorExtension ext, int decl
public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier)
{
+ var ext = engine.Ext;
var editor = ext.TextEditorData;
var generator = CodeGenerator.CreateGenerator (ext.Document);
- bool isExplicit = false;
- if (member.DeclaringTypeDefinition.Kind == TypeKind.Interface) {
- foreach (var m in type.Members) {
- if (m.Name == member.Name && !m.ReturnType.Equals (member.ReturnType)) {
- isExplicit = true;
- break;
- }
- }
- }
- var resolvedType = type.Resolve (ext.Project).GetDefinition ();
if (ext.Project != null)
generator.PolicyParent = ext.Project.Policies;
- var ctx = MDRefactoringContext.Create (ext.Document, ext.Document.Editor.Caret.Location);
- if (ctx == null)
- return;
- var builder = ctx.CreateTypeSystemAstBuilder ();
+ var builder = engine.MDRefactoringCtx.CreateTypeSystemAstBuilder ();
- string sb = BaseExportCodeGenerator.GenerateMemberCode (ctx, builder, member);
+ string sb = BaseExportCodeGenerator.GenerateMemberCode (engine.MDRefactoringCtx, builder, member);
sb = sb.TrimEnd ();
- // var lastRegion = result.BodyRegions.LastOrDefault ();
- //targetCaretPosition = declarationBegin + sb.Length;
+ string indent = editor.GetIndentationString (editor.Caret.Location);
+ sb = sb.Replace (editor.EolMarker, editor.EolMarker + indent);
+
+ int targetCaretPosition = sb.LastIndexOf ("throw", StringComparison.Ordinal);
+ int selectionEndPosition = sb.LastIndexOf (";", StringComparison.Ordinal);
editor.Replace (declarationBegin, editor.Caret.Offset - declarationBegin, sb);
- /* if (selectionEndPosition > 0) {
+ if (selectionEndPosition > 0) {
+ targetCaretPosition += declarationBegin;
+ selectionEndPosition += declarationBegin;
editor.Caret.Offset = selectionEndPosition;
editor.SetSelection (targetCaretPosition, selectionEndPosition);
- } else {
- editor.Caret.Offset = targetCaretPosition;
- }*/
+ }
}
}
}
Modified: main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringContext.cs
===================================================================
@@ -173,6 +173,12 @@ internal void SetLocation (TextLocation loc)
readonly CSharpFormattingOptions formattingOptions;
+ public CSharpFormattingOptions FormattingOptions {
+ get {
+ return formattingOptions;
+ }
+ }
+
public Script StartScript ()
{
return new MDRefactoringScript (this, formattingOptions);
Commit: eef2fab5c447b940972167e520d13a2e9ce4788e
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-08 09:21:14 GMT
URL: https://github.com/mono/monodevelop/commit/eef2fab5c447b940972167e520d13a2e9ce4788e
[SourceEditor] Worked on new message bar design (from Bug 15248 - CRNL
vs NL policy setting warning is too obtrusive).
Changed paths:
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs
M main/src/core/MonoDevelop.Ide/MonoDevelop.Components/InfoBar.cs
Added paths:
A main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/OverlayMessageWindow.cs
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj
===================================================================
@@ -27,9 +27,9 @@
</CustomCommands>
<AssemblyName>MonoDevelop.SourceEditor2</AssemblyName>
<ConsolePause>False</ConsolePause>
- <GenerateDocumentation>true</GenerateDocumentation>
<DefineConstants>DEBUG</DefineConstants>
<NoWarn>1591;1573</NoWarn>
+ <DocumentationFile>..\..\..\build\AddIns\DisplayBindings\SourceEditor\MonoDevelop.SourceEditor2.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -43,8 +43,8 @@
<Execution clr-version="Net_2_0" />
</Execution>
<DebugSymbols>true</DebugSymbols>
- <GenerateDocumentation>true</GenerateDocumentation>
<NoWarn>1591;1573</NoWarn>
+ <DocumentationFile>..\..\..\build\AddIns\DisplayBindings\SourceEditor\MonoDevelop.SourceEditor.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\core\MonoDevelop.Core\MonoDevelop.Core.csproj">
@@ -185,6 +185,7 @@
<Compile Include="gtk-gui\MonoDevelop.SourceEditor.OptionPanels.CompletionAppearancePanel.cs" />
<Compile Include="AddinInfo.cs" />
<Compile Include="MonoDevelop.SourceEditor.OptionPanels\CompletionCharactersPanel.cs" />
+ <Compile Include="MonoDevelop.SourceEditor\OverlayMessageWindow.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="gtk-gui\gui.stetic">
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs
===================================================================
@@ -374,7 +374,6 @@ public override void DrawAfterEol (TextEditor textEditor, Cairo.Context g, doubl
var sx = metrics.TextRenderEndPosition;
var width = LayoutWidth + errorCounterWidth + editor.LineHeight;
var drawLayout = layouts[0].Layout;
- int ex = 0 , ey = 0;
bool customLayout = true; //sx + width > editor.Allocation.Width;
bool hideText = false;
bubbleIsReduced = customLayout;
@@ -440,7 +439,7 @@ public override void DrawAfterEol (TextEditor textEditor, Cairo.Context g, doubl
using (var lg = new Cairo.LinearGradient (errorCounterX, errorCounterY, errorCounterX, errorCounterY + errorCounterHeight)) {
lg.AddColorStop (0, CounterColor.Color);
lg.AddColorStop (1, CounterColor.Color.AddLight (-0.1));
- g.Pattern = lg;
+ g.SetSource (lg);
g.Fill ();
}
Added: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/OverlayMessageWindow.cs
===================================================================
@@ -0,0 +1,94 @@
+//
+// OverlayMessageWindow.cs
+//
+// Author:
+// Mike Krüger <[email protected]>
+//
+// Copyright (c) 2013 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 Mono.TextEditor;
+using Gtk;
+using MonoDevelop.Components;
+using Gdk;
+
+namespace MonoDevelop.SourceEditor
+{
+ public class OverlayMessageWindow : Gtk.EventBox
+ {
+ ExtensibleTextEditor textEditor;
+
+ public OverlayMessageWindow ()
+ {
+ AppPaintable = true;
+ }
+
+ public void ShowOverlay (ExtensibleTextEditor textEditor)
+ {
+ this.textEditor = textEditor;
+ this.ShowAll ();
+ textEditor.AddTopLevelWidget (this, 0, 0);
+ textEditor.SizeAllocated += HandleSizeAllocated;
+ var child = (TextEditor.EditorContainerChild)textEditor [this];
+ child.FixedPosition = true;
+ }
+
+ protected override void OnDestroyed ()
+ {
+ base.OnDestroyed ();
+ if (textEditor != null) {
+ textEditor.SizeAllocated -= HandleSizeAllocated;
+ textEditor = null;
+ }
+ }
+
+ protected override void OnSizeAllocated (Gdk.Rectangle allocation)
+ {
+ base.OnSizeAllocated (allocation);
+ Resize (allocation);
+ }
+
+ void HandleSizeAllocated (object o, Gtk.SizeAllocatedArgs args)
+ {
+ Resize (Allocation);
+ }
+
+ void Resize (Gdk.Rectangle alloc)
+ {
+ textEditor.MoveTopLevelWidget (this, (textEditor.Allocation.Width - alloc.Width) / 2, textEditor.Allocation.Height - alloc.Height - 8);
+ }
+
+ protected override bool OnExposeEvent (Gdk.EventExpose evnt)
+ {
+ using (var cr = CairoHelper.Create (evnt.Window)) {
+ cr.Rectangle (0, 0, Allocation.Width, Allocation.Height);
+ cr.SetSourceColor (textEditor.ColorStyle.TooltipText.Background);
+ cr.FillPreserve ();
+
+ cr.SetSourceColor (textEditor.ColorStyle.TooltipBorder.Color);
+ cr.Stroke();
+ }
+
+ return base.OnExposeEvent (evnt);
+ }
+
+ }
+}
+
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs
===================================================================
@@ -46,6 +46,7 @@
using MonoDevelop.SourceEditor.QuickTasks;
using ICSharpCode.NRefactory.Semantics;
using ICSharpCode.NRefactory.Refactoring;
+using ICSharpCode.NRefactory;
namespace MonoDevelop.SourceEditor
{
@@ -918,12 +919,74 @@ internal void ConvertLineEndings ()
view.LoadSettings ();
}
+ static string GetEolString (string detectedEol)
+ {
+ switch (detectedEol) {
+ case "\n":
+ return "Unix";
+ case "\r\n":
+ return "Windows";
+ case "\r":
+ return "Mac";
+ }
+ return "Unknown";
+ }
+
+
void ShowIncorretEolMarkers (string fileName, bool multiple)
{
RemoveMessageBar ();
-
- if (messageBar == null) {
- messageBar = new MonoDevelop.Components.InfoBar (MessageType.Warning);
+
+ Console.WriteLine ("SHOW EOL MARKER !!!!!");
+
+ var window = new OverlayMessageWindow ();
+
+ var hbox = new HBox ();
+ hbox.Spacing = 8;
+
+ hbox.PackStart (ImageService.GetImage ("gtk-dialog-warning", IconSize.Menu));
+ hbox.PackStart (new Label (string.Format ("This file has line endings ({0}) which differ from the policy settings ({1}).", GetEolString(DetectedEolMarker), GetEolString(textEditor.Options.DefaultEolMarker))), true, true, 0);
+ var okButton = new Button (Gtk.Stock.Ok);
+ hbox.PackEnd (okButton);
+
+
+ var combo = new ComboBox(new [] {
+ string.Format ("Convert this file to {0} line endings", GetEolString(textEditor.Options.DefaultEolMarker)),
+ string.Format ("Keep {0} line endings", GetEolString(DetectedEolMarker)),
+ string.Format ("Convert all files to {0} line endings", GetEolString(textEditor.Options.DefaultEolMarker)),
+ string.Format ("Keep {0} line endings in all files", GetEolString(DetectedEolMarker))
+ });
+ combo.Active = 0;
+ hbox.PackEnd (combo);
+ var container = new HBox ();
+ container.PackStart (hbox, true, true, 8);
+ window.Child = container;
+ window.ShowOverlay (this.TextEditor);
+
+ okButton.Clicked += delegate {
+ switch (combo.Active) {
+ case 0:
+ ConvertLineEndings ();
+ view.WorkbenchWindow.ShowNotification = false;
+ view.Save (fileName, view.SourceEncoding);
+ break;
+ case 1:
+ UseIncorrectMarkers = true;
+ view.WorkbenchWindow.ShowNotification = false;
+ break;
+ case 2:
+ FileRegistry.ConvertLineEndingsInAllFiles ();
+ break;
+ case 3:
+ FileRegistry.IgnoreLineEndingsInAllFiles ();
+ break;
+ }
+ window.Destroy ();
+ };
+
+ /*
+ if (messageBar == null) {
+ messageBar = new InfoBar (MessageType.Warning);
string detectedEol = DetectedEolMarker.Replace ("\n", "NL").Replace ("\r", "CR");
string defaultEol = textEditor.Options.DefaultEolMarker.Replace ("\n", "NL").Replace ("\r", "CR");
messageBar.SetMessageLabel (GettextCatalog.GetString (
@@ -973,13 +1036,7 @@ void ShowIncorretEolMarkers (string fileName, bool multiple)
vbox.ReorderChild (messageBar, 0);
messageBar.ShowAll ();
- messageBar.QueueDraw ();
-// view.WorkbenchWindow.ShowNotification = true;
-//
-// // Ensure that one file with incorret EOL markers is shown.
-// var currentView = IdeApp.Workbench.ActiveDocument.PrimaryView.GetContent<SourceEditorView> ();
-// if (currentView == null || !currentView.IsDirty || !currentView.SourceEditorWidget.HasIncorrectEolMarker || currentView.SourceEditorWidget.UseIncorrectMarkers)
-// view.WorkbenchWindow.SelectWindow ();
+ messageBar.QueueDraw ();*/
}
#endregion
public void ShowAutoSaveWarning (string fileName)
Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Components/InfoBar.cs
===================================================================
@@ -140,10 +140,10 @@ public void SetMessageLabel (string markup)
protected override bool OnExposeEvent (Gdk.EventExpose evnt)
{
Style.PaintFlatBox (Style, evnt.Window, StateType.Normal, ShadowType.Out, evnt.Area, this, "tooltip",
- Allocation.X + 1, Allocation.Y + 1, Allocation.Width - 2, Allocation.Height - 2);
+ Allocation.X + 1, Allocation.Y + 1, Allocation.Width - 2, Allocation.Height - 2);
return base.OnExposeEvent (evnt);
}
-
+
protected override void OnSizeAllocated (Gdk.Rectangle allocation)
{
var rect = Allocation.Union (allocation);
Commit: 0203acb68fff514f3abdd8106d301456070aa39c
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-08 12:31:26 GMT
URL: https://github.com/mono/monodevelop/commit/0203acb68fff514f3abdd8106d301456070aa39c
[CSharpBinding] Fixed reference.
Changed paths:
M main/src/addins/CSharpBinding/CSharpBinding.csproj
Modified: main/src/addins/CSharpBinding/CSharpBinding.csproj
===================================================================
@@ -129,10 +129,6 @@
<Project>{DC393B66-92ED-4CAD-AB25-CFEF23F3D7C6}</Project>
<Name>ICSharpCode.NRefactory.Xml</Name>
</ProjectReference>
- <ProjectReference Include="..\..\..\external\nrefactory\ICSharpCode.NRefactory.Tests\ICSharpCode.NRefactory.Tests.csproj">
- <Project>{63D3B27A-D966-4902-90B3-30290E1692F1}</Project>
- <Name>ICSharpCode.NRefactory.Tests</Name>
- </ProjectReference>
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
Commit: a89b068516a7b137cd254cf135f8dfac232afce9
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-08 13:33:01 GMT
URL: https://github.com/mono/monodevelop/commit/a89b068516a7b137cd254cf135f8dfac232afce9
[CSharpBinding] Filter already implemented protocol members.
Changed paths:
M main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ExportCodeGenerator.cs
M main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/MonoCSharpCompletionEngine.cs
Modified: main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ExportCodeGenerator.cs
===================================================================
@@ -28,11 +28,9 @@
using ICSharpCode.NRefactory.CSharp;
using MonoDevelop.Core;
using ICSharpCode.NRefactory.TypeSystem;
-using System;
using System.Linq;
using ICSharpCode.NRefactory.CSharp.Refactoring;
using MonoDevelop.CSharp.Refactoring.CodeActions;
-using MonoDevelop.CSharp.Refactoring;
using MonoDevelop.CodeGeneration;
namespace MonoDevelop.CodeGeneration
@@ -88,7 +86,7 @@ public static bool HasProtocolAttribute (IType type, out string name)
return false;
}
- public static ICSharpCode.NRefactory.CSharp.Attribute GenerateExportAttribute (RefactoringContext ctx, IMember member)
+ public static Attribute GenerateExportAttribute (RefactoringContext ctx, IMember member)
{
if (member == null)
return null;
@@ -99,18 +97,18 @@ public static ICSharpCode.NRefactory.CSharp.Attribute GenerateExportAttribute (R
astType = new MemberType (new MemberType (new SimpleType ("MonoTouch"), "Foundation"), "Export");
}
- var attr = new ICSharpCode.NRefactory.CSharp.Attribute {
+ var attr = new Attribute {
Type = astType,
};
var exportAttribute = member.GetAttribute (new FullTypeName (new TopLevelTypeName ("MonoTouch.Foundation", "ExportAttribute")));
if (exportAttribute == null || exportAttribute.PositionalArguments.Count == 0)
return null;
- attr.Arguments.Add (new PrimitiveExpression (exportAttribute.PositionalArguments.First ().ConstantValue));
+ attr.Arguments.Add (new PrimitiveExpression (exportAttribute.PositionalArguments [0].ConstantValue));
return attr;
}
- IMember GetProtocolMember (MDRefactoringContext ctx, IType protocolType, IMember member)
+ static IMember GetProtocolMember (RefactoringContext ctx, IType protocolType, IMember member)
{
foreach (var m in protocolType.GetMembers (m => m.SymbolKind == member.SymbolKind && m.Name == member.Name)) {
if (!SignatureComparer.Ordinal.Equals (m, member))
@@ -128,6 +126,30 @@ IMember GetProtocolMember (MDRefactoringContext ctx, IType protocolType, IMember
return null;
}
+ static string GetProtocol (IMember member)
+ {
+ var attr = member.Attributes.FirstOrDefault (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation");
+ if (attr == null || attr.PositionalArguments.Count == 0)
+ return null;
+ return attr.PositionalArguments.First ().ConstantValue.ToString ();
+ }
+
+ public static bool IsImplemented (IType type, IMember protocolMember)
+ {
+ foreach (var m in type.GetMembers (m => m.SymbolKind == protocolMember.SymbolKind && m.Name == protocolMember.Name)) {
+ var p = m as IProperty;
+ if (p != null) {
+ if (p.CanGet && ((IProperty)protocolMember).CanGet && GetProtocol (p.Getter) == GetProtocol (((IProperty)protocolMember).Getter))
+ return true;
+ if (p.CanSet && ((IProperty)protocolMember).CanSet && GetProtocol (p.Setter) == GetProtocol (((IProperty)protocolMember).Setter))
+ return true;
+ continue;
+ }
+ if (GetProtocol (m) == GetProtocol (protocolMember))
+ return true;
+ }
+ return false;
+ }
class ExportMethods : AbstractGenerateAction
{
@@ -156,6 +178,8 @@ protected override IEnumerable<object> GetValidMembers ()
continue;
if (!cg.IsValidMember (member))
continue;
+ if (IsImplemented (type, member))
+ continue;
if (member.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation"))
yield return member;
}
@@ -164,6 +188,8 @@ protected override IEnumerable<object> GetValidMembers ()
continue;
if (!cg.IsValidMember (member))
continue;
+ if (IsImplemented (type, member))
+ continue;
if (member.CanGet && member.Getter.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation") ||
member.CanSet && member.Setter.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation"))
yield return member;
@@ -171,8 +197,6 @@ protected override IEnumerable<object> GetValidMembers ()
}
}
-
-
protected override IEnumerable<string> GenerateCode (List<object> includedMembers)
{
var generator = Options.CreateCodeGenerator ();
@@ -192,7 +216,7 @@ internal static string GenerateMemberCode (MDRefactoringContext ctx, TypeSystemA
{
var method = builder.ConvertEntity (member) as MethodDeclaration;
if (method != null) {
- method.Body = new BlockStatement () {
+ method.Body = new BlockStatement {
new ThrowStatement (new ObjectCreateExpression (ctx.CreateShortType ("System", "NotImplementedException")))
};
method.Modifiers &= ~Modifiers.Virtual;
@@ -208,17 +232,10 @@ internal static string GenerateMemberCode (MDRefactoringContext ctx, TypeSystemA
if (property == null)
return null;
var p = (IProperty)member;
- var astType = ctx.CreateShortType ("MonoTouch.Foundation", "ExportAttribute");
- if (astType is SimpleType) {
- astType = new SimpleType ("Export");
- }
- else {
- astType = new MemberType (new MemberType (new SimpleType ("MonoTouch"), "Foundation"), "Export");
- }
property.Modifiers &= ~Modifiers.Virtual;
property.Modifiers &= ~Modifiers.Abstract;
if (p.CanGet) {
- property.Getter.Body = new BlockStatement () {
+ property.Getter.Body = new BlockStatement {
new ThrowStatement (new ObjectCreateExpression (ctx.CreateShortType ("System", "NotImplementedException")))
};
property.Getter.Attributes.Add (new AttributeSection {
@@ -228,7 +245,7 @@ internal static string GenerateMemberCode (MDRefactoringContext ctx, TypeSystemA
});
}
if (p.CanSet) {
- property.Setter.Body = new BlockStatement () {
+ property.Setter.Body = new BlockStatement {
new ThrowStatement (new ObjectCreateExpression (ctx.CreateShortType ("System", "NotImplementedException")))
};
property.Setter.Attributes.Add (new AttributeSection {
Modified: main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/MonoCSharpCompletionEngine.cs
===================================================================
@@ -64,6 +64,8 @@ protected override void AddVirtuals (List<IMember> alreadyInserted, CompletionDa
foreach (var member in GetProtocolMembers (curType)) {
if (alreadyInserted.Contains (member))
continue;
+ if (BaseExportCodeGenerator.IsImplemented (curType, member))
+ continue;
alreadyInserted.Add (member);
var data = new ProtocolCompletionData (this, declarationBegin, member);
col.Add (data);
Commit: 54752c0af203703d5fec5e339e6b5349dbb070fd
Author: Lluis Sanchez <[email protected]> (slluis)
Date: 2013-10-08 13:41:22 GMT
URL: https://github.com/mono/monodevelop/commit/54752c0af203703d5fec5e339e6b5349dbb070fd
[Core] Fix crash in the project buidler finalizer
Changed paths:
M main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectService.cs
M main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/RemoteProjectBuilder.cs
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectService.cs
===================================================================
@@ -58,6 +58,8 @@ public static class MSBuildProjectService
static Dictionary<string,RemoteBuildEngine> builders = new Dictionary<string, RemoteBuildEngine> ();
static GenericItemTypeNode genericItemTypeNode = new GenericItemTypeNode ();
+
+ internal static bool ShutDown { get; private set; }
public static DataContext DataContext {
get {
@@ -86,6 +88,7 @@ static MSBuildProjectService ()
DefaultMSBuildVerbosity = PropertyService.Get ("MonoDevelop.Ide.MSBuildVerbosity", MSBuildVerbosity.Normal);
Runtime.ShuttingDown += delegate {
+ ShutDown = true;
CleanProjectBuilders ();
};
}
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/RemoteProjectBuilder.cs
===================================================================
@@ -103,10 +103,14 @@ public void RefreshWithContent (string projectContent)
public void Dispose ()
{
- if (engine != null) {
- if (builder != null)
- engine.UnloadProject (builder);
- MSBuildProjectService.ReleaseProjectBuilder (engine);
+ if (!MSBuildProjectService.ShutDown && engine != null) {
+ try {
+ if (builder != null)
+ engine.UnloadProject (builder);
+ MSBuildProjectService.ReleaseProjectBuilder (engine);
+ } catch {
+ // Ignore
+ }
GC.SuppressFinalize (this);
engine = null;
builder = null;
Commit: fd46981b2c3ad8881bde778c3a34528a9012d2c2
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-09 05:54:00 GMT
URL: https://github.com/mono/monodevelop/commit/fd46981b2c3ad8881bde778c3a34528a9012d2c2
Fixed 'Bug 15223 - Can't create framework lookup'
Changed paths:
M main/external/nrefactory
Modified: main/external/nrefactory
===================================================================
@@ -1 +1 @@
-Subproject commit 9341dfd1ac29b50269259d0f58e5513bf8c6f24b
+Subproject commit 39b29513727ad54f0e1d13e55580c9d98c9ef43a
Commit: 83c032bdeb2beae7a30811087448144b95b25a25
Author: Cody Russell <[email protected]> (bratsche)
Date: 2013-10-10 04:17:01 GMT
URL: https://github.com/mono/monodevelop/commit/83c032bdeb2beae7a30811087448144b95b25a25
Reworking the logging services, using Raygun.io
Changed paths:
M .gitmodules
M main/Main.sln
M main/src/addins/AspNet/MonoDevelop.AspNet.Mvc/RazorEditorParserFixed/BackgroundParser.cs
M main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/SubviewAttachmentHandler.cs
M main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/TargetRuntime.cs
M main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj
M main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs
M main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs
M main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs
M main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LogAgentOptionsPanel.cs
M main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs
M main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/LogReportingStartup.cs
Added paths:
A main/external/raygun4net
A main/src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.AspNet/AspNetAppProject.cs
A main/src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor.Gui/XmlSchemasPanel.cs
A main/src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor/OpenStylesheetCommand.cs
Removed paths:
D main/src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.AspNet/AspNetAppProject.cs
D main/src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor.Gui/XmlSchemasPanel.cs
D main/src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor/OpenStylesheetCommand.cs
D main/src/core/MonoDevelop.Core/MonoDevelop.Core.LogReporting/LogReportingService.cs
Modified: .gitmodules
===================================================================
@@ -37,3 +37,6 @@
[submodule "main/external/guiunit"]
path = main/external/guiunit
url = git://github.com/mono/guiunit.git
+[submodule "main/external/raygun4net"]
+ path = main/external/raygun4net
+ url = [email protected]:bratsche/raygun4net.git
Modified: main/Main.sln
===================================================================
@@ -237,6 +237,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory.CSha
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GuiUnit_NET_4_0", "external\guiunit\src\framework\GuiUnit_NET_4_0.csproj", "{E13A0A7B-4DE6-43ED-A139-41052D065A9B}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mindscape.Raygun4Net", "external\raygun4net\Mindscape.Raygun4Net\Mindscape.Raygun4Net.csproj", "{495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}"
+EndProject
Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "po", "po\po.mdproj", "{AC7D119C-980B-4712-8811-5368C14412D7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{5D3F7E65-E55B-45CA-A83B-D1E10040281E}"
@@ -468,6 +470,14 @@ Global
{459868D2-54DC-415B-B1AB-BE39BDBD352F}.DebugWin32|Any CPU.ActiveCfg = Debug|Any CPU
{459868D2-54DC-415B-B1AB-BE39BDBD352F}.DebugWin32|Any CPU.Build.0 = Debug|Any CPU
{459868D2-54DC-415B-B1AB-BE39BDBD352F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU
+ {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.DebugMac|Any CPU.Build.0 = Debug|Any CPU
+ {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.DebugWin32|Any CPU.ActiveCfg = Debug|Any CPU
+ {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.DebugWin32|Any CPU.Build.0 = Debug|Any CPU
+ {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Release|Any CPU.Build.0 = Release|Any CPU
{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU
@@ -1059,6 +1069,7 @@ Global
{B8897B76-1A12-4DFA-8B60-7944CC4C9654} = {F12939F1-D55A-4CE9-9F33-8D959BFC7D6C}
{2D711139-8765-4929-BC7A-AA2DEE6F615D} = {F12939F1-D55A-4CE9-9F33-8D959BFC7D6C}
{E13A0A7B-4DE6-43ED-A139-41052D065A9B} = {F12939F1-D55A-4CE9-9F33-8D959BFC7D6C}
+ {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9} = {F12939F1-D55A-4CE9-9F33-8D959BFC7D6C}
{92494904-35FA-4DC9-BDE9-3A3E87AC49D3} = {67A32B53-F719-4ECB-B5E1-FD0B04FEE258}
{C3887A93-B2BD-4097-8E2F-3A063EFF32FD} = {67A32B53-F719-4ECB-B5E1-FD0B04FEE258}
{B7C1673E-5124-4BE5-8D21-EC8B12F85B6B} = {67A32B53-F719-4ECB-B5E1-FD0B04FEE258}
Added: main/external/raygun4net
===================================================================
@@ -0,0 +1 @@
+Subproject commit f22449a80d87f34b1f1469171391b27bd627017d
Modified: main/src/addins/AspNet/MonoDevelop.AspNet.Mvc/RazorEditorParserFixed/BackgroundParser.cs
===================================================================
@@ -438,7 +438,7 @@ private void WorkerLoop()
catch (Exception ex)
{
MonoDevelop.Core.LoggingService.LogError ("Internal error in Razor parser", ex);
- MonoDevelop.Core.LogReporting.LogReportingService.ReportUnhandledException (ex, false);
+ MonoDevelop.Core.LoggingService.ReportUnhandledException (ex, false);
}
finally
{
Added: main/src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.AspNet/AspNetAppProject.cs
===================================================================
Added: main/src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor.Gui/XmlSchemasPanel.cs
===================================================================
Added: main/src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor/OpenStylesheetCommand.cs
===================================================================
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/SubviewAttachmentHandler.cs
===================================================================
@@ -29,7 +29,7 @@
using Mono.Addins;
using MonoDevelop.VersionControl;
using MonoDevelop.Ide.Gui;
-using MonoDevelop.Core.LogReporting;
+using MonoDevelop.Core;
using MonoDevelop.Projects;
namespace MonoDevelop.VersionControl.Views
@@ -79,7 +79,7 @@ void HandleDocumentChanged (object sender, EventArgs e)
// If a user is hitting this, it will show a dialog box every time they
// switch to a document or open a document, so suppress the crash dialog
// This bug *should* be fixed already, but it's hard to tell.
- LogReportingService.ReportUnhandledException (ex, false, true);
+ LoggingService.ReportUnhandledException (ex, false, true);
}
}
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/TargetRuntime.cs
===================================================================
@@ -388,7 +388,7 @@ void BackgroundInitialize (object state)
try {
RunInitialization ();
} catch (Exception ex) {
- LogReporting.LogReportingService.ReportUnhandledException (ex, false);
+ //LogReporting.LogReportingService.ReportUnhandledException (ex, false);
LoggingService.LogFatalError ("Unhandled exception in SystemAssemblyService background initialisation thread.", ex);
} finally {
lock (initEventLock) {
Removed: main/src/core/MonoDevelop.Core/MonoDevelop.Core.LogReporting/LogReportingService.cs
===================================================================
@@ -1,196 +0,0 @@
-//
-// LogReportingService.cs
-//
-// Author:
-// Alan McGovern <[email protected]>
-//
-// Copyright (c) 2011 Alan McGovern
-//
-// 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 System.IO;
-using System.Threading;
-using System.Net;
-using System.Web;
-using System.IO.Compression;
-
-namespace MonoDevelop.Core.LogReporting
-{
- public static class LogReportingService
- {
- const string ServiceVersion = "1";
- public static readonly FilePath CrashLogDirectory = UserProfile.Current.LogDir.Combine ("LogAgent");
-
- const string ReportCrashesKey = "MonoDevelop.LogAgent.ReportCrashes";
- const string ReportUsageKey = "MonoDevelop.LogAgent.ReportUsage";
-
- static int CrashId;
- static int Processing;
-
- // Return value is the new value for 'ReportCrashes'
- // First parameter is the current value of 'ReportCrashes
- // Second parameter is the exception
- // Thirdparameter shows if the exception is fatal or not
- public static Func<bool?, Exception, bool, bool?> UnhandledErrorOccured;
-
- public static bool? ReportCrashes {
- get { return PropertyService.Get<bool?> (ReportCrashesKey); }
- set { PropertyService.Set (ReportCrashesKey, value); }
- }
-
- public static bool? ReportUsage {
- get { return PropertyService.Get<bool?> (ReportUsageKey); }
- set { PropertyService.Set (ReportUsageKey, value); }
- }
-
- public static void ReportUnhandledException (Exception ex, bool willShutDown)
- {
- ReportUnhandledException (ex, willShutDown, false);
- }
-
- static bool reporting;
-
- public static void ReportUnhandledException (Exception ex, bool willShutDown, bool silently)
- {
- if (reporting)
- return;
-
- reporting = true;
- try {
- var oldReportCrashes = ReportCrashes;
-
- if (UnhandledErrorOccured != null && !silently)
- ReportCrashes = UnhandledErrorOccured (ReportCrashes, ex, willShutDown);
-
- // If crash reporting has been explicitly disabled, disregard this crash
- if (ReportCrashes.HasValue && !ReportCrashes.Value)
- return;
-
- byte[] data;
- using (var stream = new MemoryStream ()) {
- using (var writer = System.Xml.XmlWriter.Create (stream)) {
- writer.WriteStartElement ("CrashLog");
- writer.WriteAttributeString ("version", ServiceVersion);
-
- writer.WriteElementString ("SystemInformation", SystemInformation.GetTextDescription ());
- writer.WriteElementString ("Exception", ex.ToString ());
-
- writer.WriteEndElement ();
- }
- data = stream.ToArray ();
- }
-
- // Log to disk only if uploading fails.
- var filename = string.Format ("{0}.{1}.{2}.crashlog", DateTime.UtcNow.ToString ("yyyy-MM-dd__HH-mm-ss"), SystemInformation.SessionUuid, Interlocked.Increment (ref CrashId));
- ThreadPool.QueueUserWorkItem (delegate {
- if (!TryUploadReport (filename, data)) {
- if (!Directory.Exists (CrashLogDirectory))
- Directory.CreateDirectory (CrashLogDirectory);
-
- File.WriteAllBytes (CrashLogDirectory.Combine (filename), data);
- }
- });
-
- //ensure we don't lose the setting
- if (ReportCrashes != oldReportCrashes) {
- PropertyService.SaveProperties ();
- }
-
- } finally {
- reporting = false;
- }
- }
-
- public static void ProcessCache ()
- {
- int origValue = -1;
- try {
- // Ensure only 1 thread at a time attempts to upload cached reports
- origValue = Interlocked.CompareExchange (ref Processing, 1, 0);
- if (origValue != 0)
- return;
-
- // Uploading is not enabled, so bail out
- if (!ReportCrashes.GetValueOrDefault ())
- return;
-
- // Definitely no crash reports if this doesn't exist
- if (!Directory.Exists (CrashLogDirectory))
- return;
-
- foreach (var file in Directory.GetFiles (CrashLogDirectory)) {
- if (TryUploadReport (file, File.ReadAllBytes (file)))
- File.Delete (file);
- }
- } catch (Exception ex) {
- LoggingService.LogError ("Exception processing cached crashes", ex);
- } finally {
- if (origValue == 0)
- Interlocked.CompareExchange (ref Processing, 0, 1);
- }
- }
-
- static bool TryUploadReport (string filename, byte[] data)
- {
- try {
- // Empty files won't be accepted by the server as it thinks 'ContentLength' has not been set as it's
- // zero. We don't need empty files anyway.
- if (data.Length == 0)
- return true;
-
- var server = Environment.GetEnvironmentVariable ("MONODEVELOP_CRASHREPORT_SERVER");
- if (string.IsNullOrEmpty (server))
- server = "monodevlog.xamarin.com:35162";
-
- var request = (HttpWebRequest) WebRequest.Create (string.Format ("http://{0}/logagentreport/", server));
- request.Headers.Add ("LogAgentVersion", ServiceVersion);
- request.Headers.Add ("LogAgent_Filename", Path.GetFileName (filename));
- request.Headers.Add ("Content-Encoding", "gzip");
- request.Method = "POST";
-
- // Compress the data and then use the compressed length in ContentLength
- var compressed = new MemoryStream ();
- using (var zipper = new GZipStream (compressed, CompressionMode.Compress))
- zipper.Write (data, 0, data.Length);
- data = compressed.ToArray ();
-
- request.ContentLength = data.Length;
- using (var requestStream = request.GetRequestStream ())
- requestStream.Write (data, 0, data.Length);
-
- LoggingService.LogDebug ("CrashReport sent to server, awaiting response...");
-
- // Ensure the server has correctly processed everything.
- using (var response = (HttpWebResponse) request.GetResponse ()) {
- if (response.StatusCode != HttpStatusCode.OK) {
- LoggingService.LogError ("Server responded with status code {1} and error: {0}", response.StatusDescription, response.StatusCode);
- return false;
- }
- }
- } catch (Exception ex) {
- LoggingService.LogError ("Failed to upload report to the server", ex);
- return false;
- }
-
- LoggingService.LogDebug ("Successfully uploaded crash report");
- return true;
- }
- }
-}
-
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj
===================================================================
@@ -82,6 +82,9 @@
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Web" />
+ <Reference Include="Mindscape.Raygun4Net">
+ <HintPath>..\..\..\external\Mindscape.Raygun4Net\Mindscape.Raygun4Net.dll</HintPath>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="MonoDevelop.Core.Web\Utility.cs" />
@@ -427,7 +430,6 @@
<Compile Include="MonoDevelop.Core\UnixSystemInformation.cs" />
<Compile Include="MonoDevelop.Core\ISystemInformationProvider.cs" />
<Compile Include="MonoDevelop.Core.FileSystem\UnixFileSystemExtension.cs" />
- <Compile Include="MonoDevelop.Core.LogReporting\LogReportingService.cs" />
<Compile Include="MonoDevelop.Core.LogReporting\CrashEventArgs.cs" />
<Compile Include="MonoDevelop.Core.LogReporting\CrashMonitor.cs" />
<Compile Include="MonoDevelop.Core.LogReporting\ICrashMonitor.cs" />
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs
===================================================================
@@ -29,20 +29,42 @@
using System;
using System.Collections.Generic;
using System.IO;
+using System.Net;
+using System.Web;
using System.Linq;
+using System.Diagnostics;
+using System.Threading;
+using System.IO.Compression;
+using Mindscape.Raygun4Net;
+using Mindscape.Raygun4Net.Messages;
using MonoDevelop.Core.Logging;
namespace MonoDevelop.Core
{
-
public static class LoggingService
{
+ const string ServiceVersion = "1";
+ const string ReportCrashesKey = "MonoDevelop.LogAgent.ReportCrashes";
+ const string ReportUsageKey = "MonoDevelop.LogAgent.ReportUsage";
+
+ public static readonly FilePath CrashLogDirectory = UserProfile.Current.LogDir.Combine ("LogAgent");
+
+ static RaygunClient raygunClient;
static List<ILogger> loggers = new List<ILogger> ();
static RemoteLogger remoteLogger;
static DateTime timestamp;
static TextWriter defaultError;
static TextWriter defaultOut;
+ static bool reporting;
+ static int CrashId;
+ static int Processing;
+
+ // Return value is the new value for 'ReportCrashes'
+ // First parameter is the current value of 'ReportCrashes
+ // Second parameter is the exception
+ // Thirdparameter shows if the exception is fatal or not
+ public static Func<bool?, Exception, bool, bool?> UnhandledErrorOccured;
static LoggingService ()
{
@@ -78,6 +100,11 @@ static LoggingService ()
timestamp = DateTime.Now;
+ string raygunKey = Environment.GetEnvironmentVariable ("MONODEVELOP_RAYGUN_KEY");
+ if (raygunKey != null) {
+ raygunClient = new RaygunClient (raygunKey);
+ }
+
//remove the default trace listener on .NET, it throws up horrible dialog boxes for asserts
System.Diagnostics.Debug.Listeners.Clear ();
@@ -85,6 +112,16 @@ static LoggingService ()
System.Diagnostics.Debug.Listeners.Add (new AssertLoggingTraceListener ());
}
+ public static bool? ReportCrashes {
+ get { return PropertyService.Get<bool?> (ReportCrashesKey); }
+ set { PropertyService.Set (ReportCrashesKey, value); }
+ }
+
+ public static bool? ReportUsage {
+ get { return PropertyService.Get<bool?> (ReportUsageKey); }
+ set { PropertyService.Set (ReportUsageKey, value); }
+ }
+
static string GenericLogFile {
get { return "Ide.log"; }
}
@@ -113,6 +150,148 @@ public static void Shutdown ()
RestoreOutputRedirection ();
}
+ public static void ReportUnhandledException (Exception ex, bool willShutDown)
+ {
+ ReportUnhandledException (ex, willShutDown, false, null);
+ }
+
+ public static void ReportUnhandledException (Exception ex, bool willShutDown, bool silently)
+ {
+ ReportUnhandledException (ex, willShutDown, silently);
+ }
+
+ public static void ReportUnhandledException (Exception ex, bool willShutDown, bool silently, string tag)
+ {
+ var tags = new List<string> { tag };
+
+ if (reporting)
+ return;
+
+ reporting = true;
+ try {
+ var oldReportCrashes = ReportCrashes;
+
+ if (UnhandledErrorOccured != null && !silently)
+ ReportCrashes = UnhandledErrorOccured (ReportCrashes, ex, willShutDown);
+
+ // If crash reporting has been explicitly disabled, disregard this crash
+ if (ReportCrashes.HasValue && !ReportCrashes.Value)
+ return;
+
+ byte[] data;
+ using (var stream = new MemoryStream ()) {
+ using (var writer = System.Xml.XmlWriter.Create (stream)) {
+ writer.WriteStartElement ("CrashLog");
+ writer.WriteAttributeString ("version", ServiceVersion);
+
+ writer.WriteElementString ("SystemInformation", SystemInformation.GetTextDescription ());
+ writer.WriteElementString ("Exception", ex.ToString ());
+
+ writer.WriteEndElement ();
+ }
+ data = stream.ToArray ();
+ }
+
+ if (raygunClient != null) {
+ raygunClient.Send (ex, tags);
+ }
+
+ // Log to disk only if uploading fails.
+ var filename = string.Format ("{0}.{1}.{2}.crashlog", DateTime.UtcNow.ToString ("yyyy-MM-dd__HH-mm-ss"), SystemInformation.SessionUuid, Interlocked.Increment (ref CrashId));
+ ThreadPool.QueueUserWorkItem (delegate {
+ if (!TryUploadReport (filename, data)) {
+ if (!Directory.Exists (CrashLogDirectory))
+ Directory.CreateDirectory (CrashLogDirectory);
+
+ File.WriteAllBytes (CrashLogDirectory.Combine (filename), data);
+ }
+ });
+
+ //ensure we don't lose the setting
+ if (ReportCrashes != oldReportCrashes) {
+ PropertyService.SaveProperties ();
+ }
+
+ } finally {
+ reporting = false;
+ }
+ }
+
+ public static void ProcessCache ()
+ {
+ int origValue = -1;
+ try {
+ // Ensure only 1 thread at a time attempts to upload cached reports
+ origValue = Interlocked.CompareExchange (ref Processing, 1, 0);
+ if (origValue != 0)
+ return;
+
+ // Uploading is not enabled, so bail out
+ if (!ReportCrashes.GetValueOrDefault ())
+ return;
+
+ // Definitely no crash reports if this doesn't exist
+ if (!Directory.Exists (CrashLogDirectory))
+ return;
+
+ foreach (var file in Directory.GetFiles (CrashLogDirectory)) {
+ if (TryUploadReport (file, File.ReadAllBytes (file)))
+ File.Delete (file);
+ }
+ } catch (Exception ex) {
+ LoggingService.LogError ("Exception processing cached crashes", ex);
+ } finally {
+ if (origValue == 0)
+ Interlocked.CompareExchange (ref Processing, 0, 1);
+ }
+ }
+
+ static bool TryUploadReport (string filename, byte[] data)
+ {
+ try {
+ // Empty files won't be accepted by the server as it thinks 'ContentLength' has not been set as it's
+ // zero. We don't need empty files anyway.
+ if (data.Length == 0)
+ return true;
+
+ var server = Environment.GetEnvironmentVariable ("MONODEVELOP_CRASHREPORT_SERVER");
+ if (string.IsNullOrEmpty (server))
+ server = "monodevlog.xamarin.com:35162";
+
+ var request = (HttpWebRequest) WebRequest.Create (string.Format ("http://{0}/logagentreport/", server));
+ request.Headers.Add ("LogAgentVersion", ServiceVersion);
+ request.Headers.Add ("LogAgent_Filename", Path.GetFileName (filename));
+ request.Headers.Add ("Content-Encoding", "gzip");
+ request.Method = "POST";
+
+ // Compress the data and then use the compressed length in ContentLength
+ var compressed = new MemoryStream ();
+ using (var zipper = new GZipStream (compressed, CompressionMode.Compress))
+ zipper.Write (data, 0, data.Length);
+ data = compressed.ToArray ();
+
+ request.ContentLength = data.Length;
+ using (var requestStream = request.GetRequestStream ())
+ requestStream.Write (data, 0, data.Length);
+
+ LoggingService.LogDebug ("CrashReport sent to server, awaiting response...");
+
+ // Ensure the server has correctly processed everything.
+ using (var response = (HttpWebResponse) request.GetResponse ()) {
+ if (response.StatusCode != HttpStatusCode.OK) {
+ LoggingService.LogError ("Server responded with status code {1} and error: {0}", response.StatusDescription, response.StatusCode);
+ return false;
+ }
+ }
+ } catch (Exception ex) {
+ LoggingService.LogError ("Failed to upload report to the server", ex);
+ return false;
+ }
+
+ LoggingService.LogDebug ("Successfully uploaded crash report");
+ return true;
+ }
+
static void PurgeOldLogs ()
{
// Delete all logs older than a week
@@ -220,7 +399,7 @@ static void RestoreOutputRedirection ()
return remoteLogger;
}
}
-
+
#region the core service
public static bool IsLevelEnabled (LogLevel level)
@@ -295,7 +474,7 @@ public static void LogFatalError (string message)
{
Log (LogLevel.Fatal, message);
}
-
+
#endregion
#region convenience methods (string messageFormat, params object[] args)
@@ -314,12 +493,17 @@ public static void LogWarning (string messageFormat, params object[] args)
{
Log (LogLevel.Warn, string.Format (messageFormat, args));
}
-
- public static void LogError (string messageFormat, params object[] args)
+
+ public static void LogUserError (string messageFormat, params object[] args)
{
Log (LogLevel.Error, string.Format (messageFormat, args));
}
+ public static void LogError (string messageFormat, params object[] args)
+ {
+ LogUserError (messageFormat, args);
+ }
+
public static void LogFatalError (string messageFormat, params object[] args)
{
Log (LogLevel.Fatal, string.Format (messageFormat, args));
@@ -346,12 +530,29 @@ public static void LogWarning (string message, Exception ex)
public static void LogError (string message, Exception ex)
{
+ LogUserError (message, ex);
+ }
+
+ public static void LogUserError (string message, Exception ex)
+ {
Log (LogLevel.Error, message + (ex != null? System.Environment.NewLine + ex.ToString () : string.Empty));
}
-
+
+ public static void LogInternalError (Exception ex)
+ {
+ ReportUnhandledException (ex, false, false, "internal");
+ }
+
+ public static void LogCriticalError (string message, Exception ex)
+ {
+ ReportUnhandledException (ex, true, false, "critical");
+ }
+
public static void LogFatalError (string message, Exception ex)
{
Log (LogLevel.Fatal, message + (ex != null? System.Environment.NewLine + ex.ToString () : string.Empty));
+
+ ReportUnhandledException (ex, true, false, "fatal");
}
#endregion
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs
===================================================================
@@ -198,7 +198,7 @@ static void SetupInstrumentation ()
static void OnLoadError (object s, AddinErrorEventArgs args)
{
string msg = "Add-in error (" + args.AddinId + "): " + args.Message;
- LogReporting.LogReportingService.ReportUnhandledException (args.Exception, false, true);
+ //LogReporting.LogReportingService.ReportUnhandledException (args.Exception, false, true);
LoggingService.LogError (msg, args.Exception);
}
Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs
===================================================================
@@ -155,7 +155,7 @@ public static void SaveTemplates ()
}
foreach (CodeTemplate template in templates) {
if (string.IsNullOrEmpty (template.Shortcut)) {
- LoggingService.LogError ("CodeTemplateService: Can't save unnamed template " + template);
+ LoggingService.LogUserError ("CodeTemplateService: Can't save unnamed template " + template);
continue;
}
SaveTemplate (template, Path.Combine (TemplatePath, template.Shortcut + ".template.xml"));
Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LogAgentOptionsPanel.cs
===================================================================
@@ -60,13 +60,13 @@ public LogAgentPanelWidget ()
{
global::Stetic.BinContainer.Attach (this);
- var value = LogReportingService.ReportCrashes;
+ var value = LoggingService.ReportCrashes;
chkCrash = new CheckButton (GettextCatalog.GetString ("Automatically submit error diagnostic information"));
if (value.HasValue)
chkCrash.Active = value.Value;
chkCrash.Toggled += (sender, e) => reportCrash = chkCrash.Active;
- value = LogReportingService.ReportUsage;
+ value = LoggingService.ReportUsage;
chkUsage = new CheckButton (GettextCatalog.GetString ("Automatically submit usage information"));
if (value.HasValue)
chkUsage.Active = value.Value;
@@ -83,9 +83,9 @@ public LogAgentPanelWidget ()
public void Store ()
{
if (reportCrash.HasValue)
- LogReportingService.ReportCrashes = reportCrash.Value;
+ LoggingService.ReportCrashes = reportCrash.Value;
if (reportUsage.HasValue)
- LogReportingService.ReportUsage = reportUsage.Value;
+ LoggingService.ReportUsage = reportUsage.Value;
}
}
}
Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs
===================================================================
@@ -123,7 +123,7 @@ int Run (MonoDevelopOptions options)
EndPoint ep = null;
DispatchService.Initialize ();
-
+
// Set a synchronization context for the main gtk thread
SynchronizationContext.SetSynchronizationContext (new GtkSynchronizationContext ());
@@ -505,7 +505,7 @@ void HandleException (Exception ex, bool willShutdown)
LoggingService.LogError (string.Format ("An unhandled exception has occured. Terminating MonoDevelop? {0}", willShutdown), ex);
// Pass it off to the reporting service now.
- LogReportingService.ReportUnhandledException (ex, willShutdown);
+ LoggingService.ReportUnhandledException (ex, willShutdown);
}
/// <summary>SDBM-style hash, bounded to a range of 1000.</summary>
Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/LogReportingStartup.cs
===================================================================
@@ -43,11 +43,11 @@ protected override void Run ()
{
System.Threading.ThreadPool.QueueUserWorkItem (delegate {
// Process cached crash reports if there are any and uploading is enabled
- LogReportingService.ProcessCache ();
+ LoggingService.ProcessCache ();
});
// Attach a handler for when exceptions need to be processed
- LogReportingService.UnhandledErrorOccured = (enabled, ex, willShutdown) => {
+ LoggingService.UnhandledErrorOccured = (enabled, ex, willShutdown) => {
var doNotSend = new AlertButton (GettextCatalog.GetString ("Do _Not Send"));
var sendOnce = new AlertButton (GettextCatalog.GetString ("_Send This Time"));
var alwaysSend = new AlertButton (GettextCatalog.GetString ("_Always Send"));
Commit: f2fb303446cf2958ddd67f8ae133d52debf83f9c
Author: Cody Russell <[email protected]> (bratsche)
Date: 2013-10-10 04:19:05 GMT
URL: https://github.com/mono/monodevelop/commit/f2fb303446cf2958ddd67f8ae133d52debf83f9c
Merge pull request #413 from bratsche/lumberjack
Reworking the logging services, using Raygun.io
Changed paths:
M .gitmodules
M main/Main.sln
M main/src/addins/AspNet/MonoDevelop.AspNet.Mvc/RazorEditorParserFixed/BackgroundParser.cs
M main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/SubviewAttachmentHandler.cs
M main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/TargetRuntime.cs
M main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj
M main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs
M main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs
M main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs
M main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LogAgentOptionsPanel.cs
M main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs
M main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/LogReportingStartup.cs
Added paths:
A main/external/raygun4net
A main/src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.AspNet/AspNetAppProject.cs
A main/src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor.Gui/XmlSchemasPanel.cs
A main/src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor/OpenStylesheetCommand.cs
Removed paths:
D main/src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.AspNet/AspNetAppProject.cs
D main/src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor.Gui/XmlSchemasPanel.cs
D main/src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor/OpenStylesheetCommand.cs
D main/src/core/MonoDevelop.Core/MonoDevelop.Core.LogReporting/LogReportingService.cs
Modified: .gitmodules
===================================================================
@@ -37,3 +37,6 @@
[submodule "main/external/guiunit"]
path = main/external/guiunit
url = git://github.com/mono/guiunit.git
+[submodule "main/external/raygun4net"]
+ path = main/external/raygun4net
+ url = [email protected]:bratsche/raygun4net.git
Modified: main/Main.sln
===================================================================
@@ -237,6 +237,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory.CSha
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GuiUnit_NET_4_0", "external\guiunit\src\framework\GuiUnit_NET_4_0.csproj", "{E13A0A7B-4DE6-43ED-A139-41052D065A9B}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mindscape.Raygun4Net", "external\raygun4net\Mindscape.Raygun4Net\Mindscape.Raygun4Net.csproj", "{495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}"
+EndProject
Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "po", "po\po.mdproj", "{AC7D119C-980B-4712-8811-5368C14412D7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{5D3F7E65-E55B-45CA-A83B-D1E10040281E}"
@@ -468,6 +470,14 @@ Global
{459868D2-54DC-415B-B1AB-BE39BDBD352F}.DebugWin32|Any CPU.ActiveCfg = Debug|Any CPU
{459868D2-54DC-415B-B1AB-BE39BDBD352F}.DebugWin32|Any CPU.Build.0 = Debug|Any CPU
{459868D2-54DC-415B-B1AB-BE39BDBD352F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU
+ {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.DebugMac|Any CPU.Build.0 = Debug|Any CPU
+ {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.DebugWin32|Any CPU.ActiveCfg = Debug|Any CPU
+ {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.DebugWin32|Any CPU.Build.0 = Debug|Any CPU
+ {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Release|Any CPU.Build.0 = Release|Any CPU
{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU
@@ -1059,6 +1069,7 @@ Global
{B8897B76-1A12-4DFA-8B60-7944CC4C9654} = {F12939F1-D55A-4CE9-9F33-8D959BFC7D6C}
{2D711139-8765-4929-BC7A-AA2DEE6F615D} = {F12939F1-D55A-4CE9-9F33-8D959BFC7D6C}
{E13A0A7B-4DE6-43ED-A139-41052D065A9B} = {F12939F1-D55A-4CE9-9F33-8D959BFC7D6C}
+ {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9} = {F12939F1-D55A-4CE9-9F33-8D959BFC7D6C}
{92494904-35FA-4DC9-BDE9-3A3E87AC49D3} = {67A32B53-F719-4ECB-B5E1-FD0B04FEE258}
{C3887A93-B2BD-4097-8E2F-3A063EFF32FD} = {67A32B53-F719-4ECB-B5E1-FD0B04FEE258}
{B7C1673E-5124-4BE5-8D21-EC8B12F85B6B} = {67A32B53-F719-4ECB-B5E1-FD0B04FEE258}
Added: main/external/raygun4net
===================================================================
@@ -0,0 +1 @@
+Subproject commit f22449a80d87f34b1f1469171391b27bd627017d
Modified: main/src/addins/AspNet/MonoDevelop.AspNet.Mvc/RazorEditorParserFixed/BackgroundParser.cs
===================================================================
@@ -438,7 +438,7 @@ private void WorkerLoop()
catch (Exception ex)
{
MonoDevelop.Core.LoggingService.LogError ("Internal error in Razor parser", ex);
- MonoDevelop.Core.LogReporting.LogReportingService.ReportUnhandledException (ex, false);
+ MonoDevelop.Core.LoggingService.ReportUnhandledException (ex, false);
}
finally
{
Added: main/src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.AspNet/AspNetAppProject.cs
===================================================================
Added: main/src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor.Gui/XmlSchemasPanel.cs
===================================================================
Added: main/src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor/OpenStylesheetCommand.cs
===================================================================
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/SubviewAttachmentHandler.cs
===================================================================
@@ -29,7 +29,7 @@
using Mono.Addins;
using MonoDevelop.VersionControl;
using MonoDevelop.Ide.Gui;
-using MonoDevelop.Core.LogReporting;
+using MonoDevelop.Core;
using MonoDevelop.Projects;
namespace MonoDevelop.VersionControl.Views
@@ -79,7 +79,7 @@ void HandleDocumentChanged (object sender, EventArgs e)
// If a user is hitting this, it will show a dialog box every time they
// switch to a document or open a document, so suppress the crash dialog
// This bug *should* be fixed already, but it's hard to tell.
- LogReportingService.ReportUnhandledException (ex, false, true);
+ LoggingService.ReportUnhandledException (ex, false, true);
}
}
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/TargetRuntime.cs
===================================================================
@@ -388,7 +388,7 @@ void BackgroundInitialize (object state)
try {
RunInitialization ();
} catch (Exception ex) {
- LogReporting.LogReportingService.ReportUnhandledException (ex, false);
+ //LogReporting.LogReportingService.ReportUnhandledException (ex, false);
LoggingService.LogFatalError ("Unhandled exception in SystemAssemblyService background initialisation thread.", ex);
} finally {
lock (initEventLock) {
Removed: main/src/core/MonoDevelop.Core/MonoDevelop.Core.LogReporting/LogReportingService.cs
===================================================================
@@ -1,196 +0,0 @@
-//
-// LogReportingService.cs
-//
-// Author:
-// Alan McGovern <[email protected]>
-//
-// Copyright (c) 2011 Alan McGovern
-//
-// 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 System.IO;
-using System.Threading;
-using System.Net;
-using System.Web;
-using System.IO.Compression;
-
-namespace MonoDevelop.Core.LogReporting
-{
- public static class LogReportingService
- {
- const string ServiceVersion = "1";
- public static readonly FilePath CrashLogDirectory = UserProfile.Current.LogDir.Combine ("LogAgent");
-
- const string ReportCrashesKey = "MonoDevelop.LogAgent.ReportCrashes";
- const string ReportUsageKey = "MonoDevelop.LogAgent.ReportUsage";
-
- static int CrashId;
- static int Processing;
-
- // Return value is the new value for 'ReportCrashes'
- // First parameter is the current value of 'ReportCrashes
- // Second parameter is the exception
- // Thirdparameter shows if the exception is fatal or not
- public static Func<bool?, Exception, bool, bool?> UnhandledErrorOccured;
-
- public static bool? ReportCrashes {
- get { return PropertyService.Get<bool?> (ReportCrashesKey); }
- set { PropertyService.Set (ReportCrashesKey, value); }
- }
-
- public static bool? ReportUsage {
- get { return PropertyService.Get<bool?> (ReportUsageKey); }
- set { PropertyService.Set (ReportUsageKey, value); }
- }
-
- public static void ReportUnhandledException (Exception ex, bool willShutDown)
- {
- ReportUnhandledException (ex, willShutDown, false);
- }
-
- static bool reporting;
-
- public static void ReportUnhandledException (Exception ex, bool willShutDown, bool silently)
- {
- if (reporting)
- return;
-
- reporting = true;
- try {
- var oldReportCrashes = ReportCrashes;
-
- if (UnhandledErrorOccured != null && !silently)
- ReportCrashes = UnhandledErrorOccured (ReportCrashes, ex, willShutDown);
-
- // If crash reporting has been explicitly disabled, disregard this crash
- if (ReportCrashes.HasValue && !ReportCrashes.Value)
- return;
-
- byte[] data;
- using (var stream = new MemoryStream ()) {
- using (var writer = System.Xml.XmlWriter.Create (stream)) {
- writer.WriteStartElement ("CrashLog");
- writer.WriteAttributeString ("version", ServiceVersion);
-
- writer.WriteElementString ("SystemInformation", SystemInformation.GetTextDescription ());
- writer.WriteElementString ("Exception", ex.ToString ());
-
- writer.WriteEndElement ();
- }
- data = stream.ToArray ();
- }
-
- // Log to disk only if uploading fails.
- var filename = string.Format ("{0}.{1}.{2}.crashlog", DateTime.UtcNow.ToString ("yyyy-MM-dd__HH-mm-ss"), SystemInformation.SessionUuid, Interlocked.Increment (ref CrashId));
- ThreadPool.QueueUserWorkItem (delegate {
- if (!TryUploadReport (filename, data)) {
- if (!Directory.Exists (CrashLogDirectory))
- Directory.CreateDirectory (CrashLogDirectory);
-
- File.WriteAllBytes (CrashLogDirectory.Combine (filename), data);
- }
- });
-
- //ensure we don't lose the setting
- if (ReportCrashes != oldReportCrashes) {
- PropertyService.SaveProperties ();
- }
-
- } finally {
- reporting = false;
- }
- }
-
- public static void ProcessCache ()
- {
- int origValue = -1;
- try {
- // Ensure only 1 thread at a time attempts to upload cached reports
- origValue = Interlocked.CompareExchange (ref Processing, 1, 0);
- if (origValue != 0)
- return;
-
- // Uploading is not enabled, so bail out
- if (!ReportCrashes.GetValueOrDefault ())
- return;
-
- // Definitely no crash reports if this doesn't exist
- if (!Directory.Exists (CrashLogDirectory))
- return;
-
- foreach (var file in Directory.GetFiles (CrashLogDirectory)) {
- if (TryUploadReport (file, File.ReadAllBytes (file)))
- File.Delete (file);
- }
- } catch (Exception ex) {
- LoggingService.LogError ("Exception processing cached crashes", ex);
- } finally {
- if (origValue == 0)
- Interlocked.CompareExchange (ref Processing, 0, 1);
- }
- }
-
- static bool TryUploadReport (string filename, byte[] data)
- {
- try {
- // Empty files won't be accepted by the server as it thinks 'ContentLength' has not been set as it's
- // zero. We don't need empty files anyway.
- if (data.Length == 0)
- return true;
-
- var server = Environment.GetEnvironmentVariable ("MONODEVELOP_CRASHREPORT_SERVER");
- if (string.IsNullOrEmpty (server))
- server = "monodevlog.xamarin.com:35162";
-
- var request = (HttpWebRequest) WebRequest.Create (string.Format ("http://{0}/logagentreport/", server));
- request.Headers.Add ("LogAgentVersion", ServiceVersion);
- request.Headers.Add ("LogAgent_Filename", Path.GetFileName (filename));
- request.Headers.Add ("Content-Encoding", "gzip");
- request.Method = "POST";
-
- // Compress the data and then use the compressed length in ContentLength
- var compressed = new MemoryStream ();
- using (var zipper = new GZipStream (compressed, CompressionMode.Compress))
- zipper.Write (data, 0, data.Length);
- data = compressed.ToArray ();
-
- request.ContentLength = data.Length;
- using (var requestStream = request.GetRequestStream ())
- requestStream.Write (data, 0, data.Length);
-
- LoggingService.LogDebug ("CrashReport sent to server, awaiting response...");
-
- // Ensure the server has correctly processed everything.
- using (var response = (HttpWebResponse) request.GetResponse ()) {
- if (response.StatusCode != HttpStatusCode.OK) {
- LoggingService.LogError ("Server responded with status code {1} and error: {0}", response.StatusDescription, response.StatusCode);
- return false;
- }
- }
- } catch (Exception ex) {
- LoggingService.LogError ("Failed to upload report to the server", ex);
- return false;
- }
-
- LoggingService.LogDebug ("Successfully uploaded crash report");
- return true;
- }
- }
-}
-
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj
===================================================================
@@ -82,6 +82,9 @@
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Web" />
+ <Reference Include="Mindscape.Raygun4Net">
+ <HintPath>..\..\..\external\Mindscape.Raygun4Net\Mindscape.Raygun4Net.dll</HintPath>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="MonoDevelop.Core.Web\Utility.cs" />
@@ -427,7 +430,6 @@
<Compile Include="MonoDevelop.Core\UnixSystemInformation.cs" />
<Compile Include="MonoDevelop.Core\ISystemInformationProvider.cs" />
<Compile Include="MonoDevelop.Core.FileSystem\UnixFileSystemExtension.cs" />
- <Compile Include="MonoDevelop.Core.LogReporting\LogReportingService.cs" />
<Compile Include="MonoDevelop.Core.LogReporting\CrashEventArgs.cs" />
<Compile Include="MonoDevelop.Core.LogReporting\CrashMonitor.cs" />
<Compile Include="MonoDevelop.Core.LogReporting\ICrashMonitor.cs" />
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs
===================================================================
@@ -29,20 +29,42 @@
using System;
using System.Collections.Generic;
using System.IO;
+using System.Net;
+using System.Web;
using System.Linq;
+using System.Diagnostics;
+using System.Threading;
+using System.IO.Compression;
+using Mindscape.Raygun4Net;
+using Mindscape.Raygun4Net.Messages;
using MonoDevelop.Core.Logging;
namespace MonoDevelop.Core
{
-
public static class LoggingService
{
+ const string ServiceVersion = "1";
+ const string ReportCrashesKey = "MonoDevelop.LogAgent.ReportCrashes";
+ const string ReportUsageKey = "MonoDevelop.LogAgent.ReportUsage";
+
+ public static readonly FilePath CrashLogDirectory = UserProfile.Current.LogDir.Combine ("LogAgent");
+
+ static RaygunClient raygunClient;
static List<ILogger> loggers = new List<ILogger> ();
static RemoteLogger remoteLogger;
static DateTime timestamp;
static TextWriter defaultError;
static TextWriter defaultOut;
+ static bool reporting;
+ static int CrashId;
+ static int Processing;
+
+ // Return value is the new value for 'ReportCrashes'
+ // First parameter is the current value of 'ReportCrashes
+ // Second parameter is the exception
+ // Thirdparameter shows if the exception is fatal or not
+ public static Func<bool?, Exception, bool, bool?> UnhandledErrorOccured;
static LoggingService ()
{
@@ -78,6 +100,11 @@ static LoggingService ()
timestamp = DateTime.Now;
+ string raygunKey = Environment.GetEnvironmentVariable ("MONODEVELOP_RAYGUN_KEY");
+ if (raygunKey != null) {
+ raygunClient = new RaygunClient (raygunKey);
+ }
+
//remove the default trace listener on .NET, it throws up horrible dialog boxes for asserts
System.Diagnostics.Debug.Listeners.Clear ();
@@ -85,6 +112,16 @@ static LoggingService ()
System.Diagnostics.Debug.Listeners.Add (new AssertLoggingTraceListener ());
}
+ public static bool? ReportCrashes {
+ get { return PropertyService.Get<bool?> (ReportCrashesKey); }
+ set { PropertyService.Set (ReportCrashesKey, value); }
+ }
+
+ public static bool? ReportUsage {
+ get { return PropertyService.Get<bool?> (ReportUsageKey); }
+ set { PropertyService.Set (ReportUsageKey, value); }
+ }
+
static string GenericLogFile {
get { return "Ide.log"; }
}
@@ -113,6 +150,148 @@ public static void Shutdown ()
RestoreOutputRedirection ();
}
+ public static void ReportUnhandledException (Exception ex, bool willShutDown)
+ {
+ ReportUnhandledException (ex, willShutDown, false, null);
+ }
+
+ public static void ReportUnhandledException (Exception ex, bool willShutDown, bool silently)
+ {
+ ReportUnhandledException (ex, willShutDown, silently);
+ }
+
+ public static void ReportUnhandledException (Exception ex, bool willShutDown, bool silently, string tag)
+ {
+ var tags = new List<string> { tag };
+
+ if (reporting)
+ return;
+
+ reporting = true;
+ try {
+ var oldReportCrashes = ReportCrashes;
+
+ if (UnhandledErrorOccured != null && !silently)
+ ReportCrashes = UnhandledErrorOccured (ReportCrashes, ex, willShutDown);
+
+ // If crash reporting has been explicitly disabled, disregard this crash
+ if (ReportCrashes.HasValue && !ReportCrashes.Value)
+ return;
+
+ byte[] data;
+ using (var stream = new MemoryStream ()) {
+ using (var writer = System.Xml.XmlWriter.Create (stream)) {
+ writer.WriteStartElement ("CrashLog");
+ writer.WriteAttributeString ("version", ServiceVersion);
+
+ writer.WriteElementString ("SystemInformation", SystemInformation.GetTextDescription ());
+ writer.WriteElementString ("Exception", ex.ToString ());
+
+ writer.WriteEndElement ();
+ }
+ data = stream.ToArray ();
+ }
+
+ if (raygunClient != null) {
+ raygunClient.Send (ex, tags);
+ }
+
+ // Log to disk only if uploading fails.
+ var filename = string.Format ("{0}.{1}.{2}.crashlog", DateTime.UtcNow.ToString ("yyyy-MM-dd__HH-mm-ss"), SystemInformation.SessionUuid, Interlocked.Increment (ref CrashId));
+ ThreadPool.QueueUserWorkItem (delegate {
+ if (!TryUploadReport (filename, data)) {
+ if (!Directory.Exists (CrashLogDirectory))
+ Directory.CreateDirectory (CrashLogDirectory);
+
+ File.WriteAllBytes (CrashLogDirectory.Combine (filename), data);
+ }
+ });
+
+ //ensure we don't lose the setting
+ if (ReportCrashes != oldReportCrashes) {
+ PropertyService.SaveProperties ();
+ }
+
+ } finally {
+ reporting = false;
+ }
+ }
+
+ public static void ProcessCache ()
+ {
+ int origValue = -1;
+ try {
+ // Ensure only 1 thread at a time attempts to upload cached reports
+ origValue = Interlocked.CompareExchange (ref Processing, 1, 0);
+ if (origValue != 0)
+ return;
+
+ // Uploading is not enabled, so bail out
+ if (!ReportCrashes.GetValueOrDefault ())
+ return;
+
+ // Definitely no crash reports if this doesn't exist
+ if (!Directory.Exists (CrashLogDirectory))
+ return;
+
+ foreach (var file in Directory.GetFiles (CrashLogDirectory)) {
+ if (TryUploadReport (file, File.ReadAllBytes (file)))
+ File.Delete (file);
+ }
+ } catch (Exception ex) {
+ LoggingService.LogError ("Exception processing cached crashes", ex);
+ } finally {
+ if (origValue == 0)
+ Interlocked.CompareExchange (ref Processing, 0, 1);
+ }
+ }
+
+ static bool TryUploadReport (string filename, byte[] data)
+ {
+ try {
+ // Empty files won't be accepted by the server as it thinks 'ContentLength' has not been set as it's
+ // zero. We don't need empty files anyway.
+ if (data.Length == 0)
+ return true;
+
+ var server = Environment.GetEnvironmentVariable ("MONODEVELOP_CRASHREPORT_SERVER");
+ if (string.IsNullOrEmpty (server))
+ server = "monodevlog.xamarin.com:35162";
+
+ var request = (HttpWebRequest) WebRequest.Create (string.Format ("http://{0}/logagentreport/", server));
+ request.Headers.Add ("LogAgentVersion", ServiceVersion);
+ request.Headers.Add ("LogAgent_Filename", Path.GetFileName (filename));
+ request.Headers.Add ("Content-Encoding", "gzip");
+ request.Method = "POST";
+
+ // Compress the data and then use the compressed length in ContentLength
+ var compressed = new MemoryStream ();
+ using (var zipper = new GZipStream (compressed, CompressionMode.Compress))
+ zipper.Write (data, 0, data.Length);
+ data = compressed.ToArray ();
+
+ request.ContentLength = data.Length;
+ using (var requestStream = request.GetRequestStream ())
+ requestStream.Write (data, 0, data.Length);
+
+ LoggingService.LogDebug ("CrashReport sent to server, awaiting response...");
+
+ // Ensure the server has correctly processed everything.
+ using (var response = (HttpWebResponse) request.GetResponse ()) {
+ if (response.StatusCode != HttpStatusCode.OK) {
+ LoggingService.LogError ("Server responded with status code {1} and error: {0}", response.StatusDescription, response.StatusCode);
+ return false;
+ }
+ }
+ } catch (Exception ex) {
+ LoggingService.LogError ("Failed to upload report to the server", ex);
+ return false;
+ }
+
+ LoggingService.LogDebug ("Successfully uploaded crash report");
+ return true;
+ }
+
static void PurgeOldLogs ()
{
// Delete all logs older than a week
@@ -220,7 +399,7 @@ static void RestoreOutputRedirection ()
return remoteLogger;
}
}
-
+
#region the core service
public static bool IsLevelEnabled (LogLevel level)
@@ -295,7 +474,7 @@ public static void LogFatalError (string message)
{
Log (LogLevel.Fatal, message);
}
-
+
#endregion
#region convenience methods (string messageFormat, params object[] args)
@@ -314,12 +493,17 @@ public static void LogWarning (string messageFormat, params object[] args)
{
Log (LogLevel.Warn, string.Format (messageFormat, args));
}
-
- public static void LogError (string messageFormat, params object[] args)
+
+ public static void LogUserError (string messageFormat, params object[] args)
{
Log (LogLevel.Error, string.Format (messageFormat, args));
}
+ public static void LogError (string messageFormat, params object[] args)
+ {
+ LogUserError (messageFormat, args);
+ }
+
public static void LogFatalError (string messageFormat, params object[] args)
{
Log (LogLevel.Fatal, string.Format (messageFormat, args));
@@ -346,12 +530,29 @@ public static void LogWarning (string message, Exception ex)
public static void LogError (string message, Exception ex)
{
+ LogUserError (message, ex);
+ }
+
+ public static void LogUserError (string message, Exception ex)
+ {
Log (LogLevel.Error, message + (ex != null? System.Environment.NewLine + ex.ToString () : string.Empty));
}
-
+
+ public static void LogInternalError (Exception ex)
+ {
+ ReportUnhandledException (ex, false, false, "internal");
+ }
+
+ public static void LogCriticalError (string message, Exception ex)
+ {
+ ReportUnhandledException (ex, true, false, "critical");
+ }
+
public static void LogFatalError (string message, Exception ex)
{
Log (LogLevel.Fatal, message + (ex != null? System.Environment.NewLine + ex.ToString () : string.Empty));
+
+ ReportUnhandledException (ex, true, false, "fatal");
}
#endregion
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs
===================================================================
@@ -198,7 +198,7 @@ static void SetupInstrumentation ()
static void OnLoadError (object s, AddinErrorEventArgs args)
{
string msg = "Add-in error (" + args.AddinId + "): " + args.Message;
- LogReporting.LogReportingService.ReportUnhandledException (args.Exception, false, true);
+ //LogReporting.LogReportingService.ReportUnhandledException (args.Exception, false, true);
LoggingService.LogError (msg, args.Exception);
}
Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs
===================================================================
@@ -155,7 +155,7 @@ public static void SaveTemplates ()
}
foreach (CodeTemplate template in templates) {
if (string.IsNullOrEmpty (template.Shortcut)) {
- LoggingService.LogError ("CodeTemplateService: Can't save unnamed template " + template);
+ LoggingService.LogUserError ("CodeTemplateService: Can't save unnamed template " + template);
continue;
}
SaveTemplate (template, Path.Combine (TemplatePath, template.Shortcut + ".template.xml"));
Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LogAgentOptionsPanel.cs
===================================================================
@@ -60,13 +60,13 @@ public LogAgentPanelWidget ()
{
global::Stetic.BinContainer.Attach (this);
- var value = LogReportingService.ReportCrashes;
+ var value = LoggingService.ReportCrashes;
chkCrash = new CheckButton (GettextCatalog.GetString ("Automatically submit error diagnostic information"));
if (value.HasValue)
chkCrash.Active = value.Value;
chkCrash.Toggled += (sender, e) => reportCrash = chkCrash.Active;
- value = LogReportingService.ReportUsage;
+ value = LoggingService.ReportUsage;
chkUsage = new CheckButton (GettextCatalog.GetString ("Automatically submit usage information"));
if (value.HasValue)
chkUsage.Active = value.Value;
@@ -83,9 +83,9 @@ public LogAgentPanelWidget ()
public void Store ()
{
if (reportCrash.HasValue)
- LogReportingService.ReportCrashes = reportCrash.Value;
+ LoggingService.ReportCrashes = reportCrash.Value;
if (reportUsage.HasValue)
- LogReportingService.ReportUsage = reportUsage.Value;
+ LoggingService.ReportUsage = reportUsage.Value;
}
}
}
Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs
===================================================================
@@ -123,7 +123,7 @@ int Run (MonoDevelopOptions options)
EndPoint ep = null;
DispatchService.Initialize ();
-
+
// Set a synchronization context for the main gtk thread
SynchronizationContext.SetSynchronizationContext (new GtkSynchronizationContext ());
@@ -505,7 +505,7 @@ void HandleException (Exception ex, bool willShutdown)
LoggingService.LogError (string.Format ("An unhandled exception has occured. Terminating MonoDevelop? {0}", willShutdown), ex);
// Pass it off to the reporting service now.
- LogReportingService.ReportUnhandledException (ex, willShutdown);
+ LoggingService.ReportUnhandledException (ex, willShutdown);
}
/// <summary>SDBM-style hash, bounded to a range of 1000.</summary>
Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/LogReportingStartup.cs
===================================================================
@@ -43,11 +43,11 @@ protected override void Run ()
{
System.Threading.ThreadPool.QueueUserWorkItem (delegate {
// Process cached crash reports if there are any and uploading is enabled
- LogReportingService.ProcessCache ();
+ LoggingService.ProcessCache ();
});
// Attach a handler for when exceptions need to be processed
- LogReportingService.UnhandledErrorOccured = (enabled, ex, willShutdown) => {
+ LoggingService.UnhandledErrorOccured = (enabled, ex, willShutdown) => {
var doNotSend = new AlertButton (GettextCatalog.GetString ("Do _Not Send"));
var sendOnce = new AlertButton (GettextCatalog.GetString ("_Send This Time"));
var alwaysSend = new AlertButton (GettextCatalog.GetString ("_Always Send"));
Commit: 58793fcc7d0261bc4d4a89733ed3ff2a85d6f876
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-10 08:34:03 GMT
URL: https://github.com/mono/monodevelop/commit/58793fcc7d0261bc4d4a89733ed3ff2a85d6f876
Implemented 'Bug 15248 - CRNL vs NL policy setting warning is too
obtrusive'.
Changed paths:
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/OverlayMessageWindow.cs
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs
Added paths:
A main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/HoverCloseButton.cs
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj
===================================================================
@@ -186,6 +186,7 @@
<Compile Include="AddinInfo.cs" />
<Compile Include="MonoDevelop.SourceEditor.OptionPanels\CompletionCharactersPanel.cs" />
<Compile Include="MonoDevelop.SourceEditor\OverlayMessageWindow.cs" />
+ <Compile Include="MonoDevelop.SourceEditor\HoverCloseButton.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="gtk-gui\gui.stetic">
Added: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/HoverCloseButton.cs
===================================================================
@@ -0,0 +1,160 @@
+//
+// HoverCloseButton.cs
+//
+// Author:
+// Mike Krüger <[email protected]>
+//
+// Copyright (c) 2013 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 Gtk;
+using Gdk;
+
+namespace MonoDevelop.SourceEditor
+{
+ public class HoverCloseButton : EventBox
+ {
+ bool hovered;
+
+ public HoverCloseButton ()
+ {
+ VisibleWindow = false;
+ Events |= EventMask.LeaveNotifyMask | EventMask.EnterNotifyMask | EventMask.ButtonPressMask | EventMask.ButtonReleaseMask;
+ }
+
+ protected override void OnSizeRequested (ref Requisition requisition)
+ {
+ base.OnSizeRequested (ref requisition);
+ requisition.Width = requisition.Height = 16;
+ }
+
+ protected override bool OnEnterNotifyEvent (Gdk.EventCrossing evnt)
+ {
+ hovered = true;
+ QueueDraw ();
+ return base.OnEnterNotifyEvent (evnt);
+ }
+
+ protected override bool OnLeaveNotifyEvent (Gdk.EventCrossing evnt)
+ {
+ hovered = false;
+ QueueDraw ();
+ return base.OnLeaveNotifyEvent (evnt);
+ }
+
+ bool click;
+ protected override bool OnButtonPressEvent (EventButton evnt)
+ {
+ if (evnt.Button == 1 && hovered)
+ click = true;
+ return base.OnButtonPressEvent (evnt);
+ }
+
+ protected override bool OnButtonReleaseEvent (EventButton evnt)
+ {
+ if (click && hovered)
+ OnClicked (EventArgs.Empty);
+ click = false;
+ return base.OnButtonReleaseEvent (evnt);
+ }
+
+ public event EventHandler Clicked;
+
+ protected virtual void OnClicked (EventArgs e)
+ {
+ var handler = Clicked;
+ if (handler != null)
+ handler (this, e);
+ }
+
+ protected override bool OnExposeEvent (Gdk.EventExpose evnt)
+ {
+ using (var cr = CairoHelper.Create (evnt.Window)) {
+ DrawCloseButton (cr, new Gdk.Point (Allocation.X + Allocation.Width / 2, Allocation.Y + Allocation.Height / 2), hovered, 1.0, 0);
+ }
+ return base.OnExposeEvent (evnt);
+ }
+
+ static void DrawCloseButton (Cairo.Context context, Gdk.Point center, bool hovered, double opacity, double animationProgress)
+ {
+ if (hovered) {
+ double radius = 6;
+ context.Arc (center.X, center.Y, radius, 0, Math.PI * 2);
+ context.SetSourceRGBA (.6, .6, .6, opacity);
+ context.Fill ();
+
+ context.SetSourceRGBA (0.95, 0.95, 0.95, opacity);
+ context.LineWidth = 2;
+
+ context.MoveTo (center.X - 3, center.Y - 3);
+ context.LineTo (center.X + 3, center.Y + 3);
+ context.MoveTo (center.X - 3, center.Y + 3);
+ context.LineTo (center.X + 3, center.Y - 3);
+ context.Stroke ();
+ } else {
+ double lineColor = .63 - .1 * animationProgress;
+ double fillColor = .74;
+
+ double heightMod = Math.Max (0, 1.0 - animationProgress * 2);
+ context.MoveTo (center.X - 3, center.Y - 3 * heightMod);
+ context.LineTo (center.X + 3, center.Y + 3 * heightMod);
+ context.MoveTo (center.X - 3, center.Y + 3 * heightMod);
+ context.LineTo (center.X + 3, center.Y - 3 * heightMod);
+
+ context.LineWidth = 2;
+ context.SetSourceRGBA (lineColor, lineColor, lineColor, opacity);
+ context.Stroke ();
+
+ if (animationProgress > 0.5) {
+ double partialProg = (animationProgress - 0.5) * 2;
+ context.MoveTo (center.X - 3, center.Y);
+ context.LineTo (center.X + 3, center.Y);
+
+ context.LineWidth = 2 - partialProg;
+ context.SetSourceRGBA (lineColor, lineColor, lineColor, opacity);
+ context.Stroke ();
+
+
+ double radius = partialProg * 3.5;
+
+ // Background
+ context.Arc (center.X, center.Y, radius, 0, Math.PI * 2);
+ context.SetSourceRGBA (fillColor, fillColor, fillColor, opacity);
+ context.Fill ();
+
+ // Inset shadow
+ using (var lg = new Cairo.LinearGradient (0, center.Y - 5, 0, center.Y)) {
+ context.Arc (center.X, center.Y + 1, radius, 0, Math.PI * 2);
+ lg.AddColorStop (0, new Cairo.Color (0, 0, 0, 0.2 * opacity));
+ lg.AddColorStop (1, new Cairo.Color (0, 0, 0, 0));
+ context.SetSource (lg);
+ context.Stroke ();
+ }
+
+ // Outline
+ context.Arc (center.X, center.Y, radius, 0, Math.PI * 2);
+ context.SetSourceRGBA (lineColor, lineColor, lineColor, opacity);
+ context.Stroke ();
+ }
+ }
+ }
+ }
+}
+
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/OverlayMessageWindow.cs
===================================================================
@@ -33,6 +33,10 @@ namespace MonoDevelop.SourceEditor
{
public class OverlayMessageWindow : Gtk.EventBox
{
+ const int border = 8;
+
+ public Func<int> SizeFunc;
+
ExtensibleTextEditor textEditor;
public OverlayMessageWindow ()
@@ -59,14 +63,36 @@ protected override void OnDestroyed ()
}
}
+ protected override void OnSizeRequested (ref Requisition requisition)
+ {
+ base.OnSizeRequested (ref requisition);
+
+ if (wRequest > 0) {
+ requisition.Width = wRequest;
+ }
+ }
+
protected override void OnSizeAllocated (Gdk.Rectangle allocation)
{
base.OnSizeAllocated (allocation);
Resize (allocation);
}
-
+ int wRequest = -1;
void HandleSizeAllocated (object o, Gtk.SizeAllocatedArgs args)
{
+ if (SizeFunc != null) {
+ var req = Math.Min (SizeFunc (), textEditor.Allocation.Width - border * 2);
+ if (req != wRequest) {
+ wRequest = req;
+ QueueResize ();
+ }
+ } else {
+ if (Allocation.Width > textEditor.Allocation.Width - border * 2) {
+ if (textEditor.Allocation.Width - border * 2 > 0) {
+ QueueResize ();
+ }
+ }
+ }
Resize (Allocation);
}
@@ -78,7 +104,11 @@ void Resize (Gdk.Rectangle alloc)
protected override bool OnExposeEvent (Gdk.EventExpose evnt)
{
using (var cr = CairoHelper.Create (evnt.Window)) {
+ cr.LineWidth = 1;
cr.Rectangle (0, 0, Allocation.Width, Allocation.Height);
+ cr.SetSourceColor (textEditor.ColorStyle.PlainText.Background);
+ cr.Fill ();
+ cr.RoundedRectangle (0, 0, Allocation.Width, Allocation.Height, 3);
cr.SetSourceColor (textEditor.ColorStyle.TooltipText.Background);
cr.FillPreserve ();
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs
===================================================================
@@ -915,7 +915,7 @@ internal void ConvertLineEndings ()
newText.Append (correctEol);
}
view.StoreSettings ();
- TextEditor.Text = newText.ToString ();
+ view.ReplaceContent (Document.FileName, newText.ToString (), null);
view.LoadSettings ();
}
@@ -923,7 +923,7 @@ static string GetEolString (string detectedEol)
{
switch (detectedEol) {
case "\n":
- return "Unix";
+ return "UNIX";
case "\r\n":
return "Windows";
case "\r":
@@ -936,33 +936,50 @@ static string GetEolString (string detectedEol)
void ShowIncorretEolMarkers (string fileName, bool multiple)
{
RemoveMessageBar ();
-
- Console.WriteLine ("SHOW EOL MARKER !!!!!");
-
var window = new OverlayMessageWindow ();
var hbox = new HBox ();
hbox.Spacing = 8;
- hbox.PackStart (ImageService.GetImage ("gtk-dialog-warning", IconSize.Menu));
- hbox.PackStart (new Label (string.Format ("This file has line endings ({0}) which differ from the policy settings ({1}).", GetEolString(DetectedEolMarker), GetEolString(textEditor.Options.DefaultEolMarker))), true, true, 0);
- var okButton = new Button (Gtk.Stock.Ok);
- hbox.PackEnd (okButton);
+ var image = new HoverCloseButton ();
+ hbox.PackStart (image, false, false, 0);
+ var label = new Label (string.Format ("This file has line endings ({0}) which differ from the policy settings ({1}).", GetEolString (DetectedEolMarker), GetEolString (textEditor.Options.DefaultEolMarker)));
+ int w, h;
+ label.Layout.GetPixelSize (out w, out h);
+ label.Ellipsize = Pango.EllipsizeMode.End;
+ hbox.PackStart (label, true, true, 0);
+ var okButton = new Button (Gtk.Stock.Ok);
+ okButton.WidthRequest = 60;
+ hbox.PackEnd (okButton, false, false, 0);
var combo = new ComboBox(new [] {
- string.Format ("Convert this file to {0} line endings", GetEolString(textEditor.Options.DefaultEolMarker)),
- string.Format ("Keep {0} line endings", GetEolString(DetectedEolMarker)),
+ string.Format ("Convert to {0} line endings", GetEolString(textEditor.Options.DefaultEolMarker)),
string.Format ("Convert all files to {0} line endings", GetEolString(textEditor.Options.DefaultEolMarker)),
+ string.Format ("Keep {0} line endings", GetEolString(DetectedEolMarker)),
string.Format ("Keep {0} line endings in all files", GetEolString(DetectedEolMarker))
});
combo.Active = 0;
- hbox.PackEnd (combo);
+ hbox.PackEnd (combo, false, false, 0);
var container = new HBox ();
- container.PackStart (hbox, true, true, 8);
+ const int containerPadding = 8;
+ container.PackStart (hbox, true, true, containerPadding);
window.Child = container;
window.ShowOverlay (this.TextEditor);
+ window.SizeFunc = () => {
+ return okButton.SizeRequest ().Width +
+ combo.SizeRequest ().Width +
+ image.SizeRequest ().Width +
+ w +
+ hbox.Spacing * 4 +
+ containerPadding * 2;
+ };
+ image.Clicked += delegate {
+ UseIncorrectMarkers = true;
+ view.WorkbenchWindow.ShowNotification = false;
+ window.Destroy ();
+ };
okButton.Clicked += delegate {
switch (combo.Active) {
case 0:
@@ -971,11 +988,11 @@ void ShowIncorretEolMarkers (string fileName, bool multiple)
view.Save (fileName, view.SourceEncoding);
break;
case 1:
- UseIncorrectMarkers = true;
- view.WorkbenchWindow.ShowNotification = false;
+ FileRegistry.ConvertLineEndingsInAllFiles ();
break;
case 2:
- FileRegistry.ConvertLineEndingsInAllFiles ();
+ UseIncorrectMarkers = true;
+ view.WorkbenchWindow.ShowNotification = false;
break;
case 3:
FileRegistry.IgnoreLineEndingsInAllFiles ();
@@ -983,60 +1000,6 @@ void ShowIncorretEolMarkers (string fileName, bool multiple)
}
window.Destroy ();
};
-
- /*
- if (messageBar == null) {
- messageBar = new InfoBar (MessageType.Warning);
- string detectedEol = DetectedEolMarker.Replace ("\n", "NL").Replace ("\r", "CR");
- string defaultEol = textEditor.Options.DefaultEolMarker.Replace ("\n", "NL").Replace ("\r", "CR");
- messageBar.SetMessageLabel (GettextCatalog.GetString (
- "<b>The file \"{0}\" has line endings (" + detectedEol + ") which differ from the policy settings(" + defaultEol + ").</b>\n" +
- "Do you want to convert the line endings?",
- EllipsizeMiddle (Document.FileName, 50)));
-
- Button b1 = new Button (GettextCatalog.GetString ("_Convert"));
- b1.Image = ImageService.GetImage (Gtk.Stock.Refresh, IconSize.Button);
- b1.Clicked += delegate(object sender, EventArgs e) {
- ConvertLineEndings ();
- view.WorkbenchWindow.ShowNotification = false;
- RemoveMessageBar ();
- view.Save (fileName, view.SourceEncoding);
- };
- messageBar.ActionArea.Add (b1);
-
- Button b2 = new Button (GettextCatalog.GetString ("_Keep line endings"));
- b2.Image = ImageService.GetImage (Gtk.Stock.Cancel, IconSize.Button);
- b2.Clicked += delegate(object sender, EventArgs e) {
- UseIncorrectMarkers = true;
- view.WorkbenchWindow.ShowNotification = false;
- RemoveMessageBar ();
- view.Save (fileName, view.SourceEncoding);
- };
- messageBar.ActionArea.Add (b2);
-
- if (multiple) {
- var b3 = new Button (GettextCatalog.GetString ("_Convert all files"));
- b3.Image = ImageService.GetImage (Gtk.Stock.Cancel, IconSize.Button);
- b3.Clicked += delegate {
- FileRegistry.ConvertLineEndingsInAllFiles ();
- };
- messageBar.ActionArea.Add (b3);
-
- var b4 = new Button (GettextCatalog.GetString ("_Keep in all files"));
- b4.Image = ImageService.GetImage (Gtk.Stock.Cancel, IconSize.Button);
- b4.Clicked += delegate {
- FileRegistry.IgnoreLineEndingsInAllFiles ();
- };
- messageBar.ActionArea.Add (b4);
- }
-
- }
-
- vbox.PackStart (messageBar, false, false, CHILD_PADDING);
- vbox.ReorderChild (messageBar, 0);
- messageBar.ShowAll ();
-
- messageBar.QueueDraw ();*/
}
#endregion
public void ShowAutoSaveWarning (string fileName)
Commit: 582664ab3cabcc4aac9ea08a4b0f5d766ec05355
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-10 10:00:36 GMT
URL: https://github.com/mono/monodevelop/commit/582664ab3cabcc4aac9ea08a4b0f5d766ec05355
Bump nrefactory.
Changed paths:
M main/external/nrefactory
Modified: main/external/nrefactory
===================================================================
@@ -1 +1 @@
-Subproject commit 39b29513727ad54f0e1d13e55580c9d98c9ef43a
+Subproject commit 0bbf46a3b1a78eb20267e4be90f3cb5e457f09a6
Commit: 7e53fef6ba50ba280ffd41799504f3861da12f2e
Author: Alan McGovern <[email protected]> (alanmcgovern)
Date: 2013-10-10 14:07:01 GMT
URL: https://github.com/mono/monodevelop/commit/7e53fef6ba50ba280ffd41799504f3861da12f2e
[core] Use a csproj reference, not dll reference, for raygun
Now it will build as expected
Changed paths:
M main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj
===================================================================
@@ -82,9 +82,6 @@
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Web" />
- <Reference Include="Mindscape.Raygun4Net">
- <HintPath>..\..\..\external\Mindscape.Raygun4Net\Mindscape.Raygun4Net.dll</HintPath>
- </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="MonoDevelop.Core.Web\Utility.cs" />
@@ -558,6 +555,10 @@
<Project>{2B8F4F83-C2B3-4E84-A27B-8DEE1BE0E006}</Project>
<Name>ICSharpCode.NRefactory.Cecil</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\..\external\raygun4net\Mindscape.Raygun4Net\Mindscape.Raygun4Net.csproj">
+ <Project>{495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}</Project>
+ <Name>Mindscape.Raygun4Net</Name>
+ </ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="MonoDevelop.Core.dll.config">
Commit: 6a99352edd923eff57fe357d54fd0e28c77ec220
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-10 14:21:07 GMT
URL: https://github.com/mono/monodevelop/commit/6a99352edd923eff57fe357d54fd0e28c77ec220
[SourceEditor] Fixed old cairo API.
Changed paths:
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/HoverCloseButton.cs
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/HoverCloseButton.cs
===================================================================
@@ -144,7 +144,7 @@ static void DrawCloseButton (Cairo.Context context, Gdk.Point center, bool hover
context.Arc (center.X, center.Y + 1, radius, 0, Math.PI * 2);
lg.AddColorStop (0, new Cairo.Color (0, 0, 0, 0.2 * opacity));
lg.AddColorStop (1, new Cairo.Color (0, 0, 0, 0));
- context.SetSource (lg);
+ context.Pattern = lg;
context.Stroke ();
}
Commit: 5d8e5373b0f70c60dd03b93da291b2810f96ae9d
Author: Alan McGovern <[email protected]> (alanmcgovern)
Date: 2013-10-10 15:16:40 GMT
URL: https://github.com/mono/monodevelop/commit/5d8e5373b0f70c60dd03b93da291b2810f96ae9d
Bump xwt and md-addins
Changed paths:
M main/external/xwt
M version-checks
Modified: main/external/xwt
===================================================================
@@ -1 +1 @@
-Subproject commit 08c43fbfe872498989c04c4444292bdcd0c3bbd1
+Subproject commit 8e343a1480a526bf0ace449c99fe8aec94584815
Modified: version-checks
===================================================================
@@ -17,7 +17,7 @@ DEP[0]=md-addins
DEP_NAME[0]=MDADDINS
DEP_PATH[0]=${top_srcdir}/../md-addins
DEP_MODULE[0][email protected]:xamarin/md-addins.git
-DEP_NEEDED_VERSION[0]=35fdc0a55c20027b578905ab0a7b2902168d3a63
+DEP_NEEDED_VERSION[0]=60889038577b053736b1036f62b00429139aaab1
DEP_BRANCH_AND_REMOTE[0]="master origin/master"
# heap-shot
Commit: 7e44ee49653c5b6586c208a3d4f4a84b49f740ab
Author: Alan McGovern <[email protected]> (alanmcgovern)
Date: 2013-10-10 16:40:57 GMT
URL: https://github.com/mono/monodevelop/commit/7e44ee49653c5b6586c208a3d4f4a84b49f740ab
Bump xwt and md-addins
Changed paths:
M main/external/xwt
M version-checks
Modified: main/external/xwt
===================================================================
@@ -1 +1 @@
-Subproject commit 8e343a1480a526bf0ace449c99fe8aec94584815
+Subproject commit 218021f6c6c2479be5656fc5abbd4fa07a693d60
Modified: version-checks
===================================================================
@@ -17,7 +17,7 @@ DEP[0]=md-addins
DEP_NAME[0]=MDADDINS
DEP_PATH[0]=${top_srcdir}/../md-addins
DEP_MODULE[0][email protected]:xamarin/md-addins.git
-DEP_NEEDED_VERSION[0]=60889038577b053736b1036f62b00429139aaab1
+DEP_NEEDED_VERSION[0]=ddb3f348b217e9370aa5165266846c38cfafd71d
DEP_BRANCH_AND_REMOTE[0]="master origin/master"
# heap-shot
Commit: 053ce00c8f8f307de1a197076fd54f0023cc10a2
Author: Cody Russell <[email protected]> (bratsche)
Date: 2013-10-10 18:23:51 GMT
URL: https://github.com/mono/monodevelop/commit/053ce00c8f8f307de1a197076fd54f0023cc10a2
[Core] Log{Internal,Critical,Fatal}Error now Log(LogLevel.Error) in addition to ReportUnhandledException.
Changed paths:
M main/src/addins/AspNet/MonoDevelop.AspNet.Mvc/RazorEditorParserFixed/BackgroundParser.cs
M main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/SubviewAttachmentHandler.cs
M main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/TargetRuntime.cs
M main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs
M main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs
M main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs
Modified: main/src/addins/AspNet/MonoDevelop.AspNet.Mvc/RazorEditorParserFixed/BackgroundParser.cs
===================================================================
@@ -437,8 +437,7 @@ private void WorkerLoop()
}
catch (Exception ex)
{
- MonoDevelop.Core.LoggingService.LogError ("Internal error in Razor parser", ex);
- MonoDevelop.Core.LoggingService.ReportUnhandledException (ex, false);
+ MonoDevelop.Core.LoggingService.LogInternalError ("Internal error in Razor parser", ex);
}
finally
{
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/SubviewAttachmentHandler.cs
===================================================================
@@ -79,7 +79,7 @@ void HandleDocumentChanged (object sender, EventArgs e)
// If a user is hitting this, it will show a dialog box every time they
// switch to a document or open a document, so suppress the crash dialog
// This bug *should* be fixed already, but it's hard to tell.
- LoggingService.ReportUnhandledException (ex, false, true);
+ LoggingService.LogInternalError (ex);
}
}
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/TargetRuntime.cs
===================================================================
@@ -388,7 +388,6 @@ void BackgroundInitialize (object state)
try {
RunInitialization ();
} catch (Exception ex) {
- //LogReporting.LogReportingService.ReportUnhandledException (ex, false);
LoggingService.LogFatalError ("Unhandled exception in SystemAssemblyService background initialisation thread.", ex);
} finally {
lock (initEventLock) {
@@ -621,4 +620,4 @@ static TargetFramework ReadTargetFramework (TargetFrameworkMoniker moniker, File
return null;
}
}
-}
\ No newline at end of file
+}
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs
===================================================================
@@ -150,17 +150,17 @@ public static void Shutdown ()
RestoreOutputRedirection ();
}
- public static void ReportUnhandledException (Exception ex, bool willShutDown)
+ internal static void ReportUnhandledException (Exception ex, bool willShutDown)
{
ReportUnhandledException (ex, willShutDown, false, null);
}
- public static void ReportUnhandledException (Exception ex, bool willShutDown, bool silently)
+ internal static void ReportUnhandledException (Exception ex, bool willShutDown, bool silently)
{
ReportUnhandledException (ex, willShutDown, silently);
}
- public static void ReportUnhandledException (Exception ex, bool willShutDown, bool silently, string tag)
+ internal static void ReportUnhandledException (Exception ex, bool willShutDown, bool silently, string tag)
{
var tags = new List<string> { tag };
@@ -540,17 +540,30 @@ public static void LogUserError (string message, Exception ex)
public static void LogInternalError (Exception ex)
{
+ if (ex != null) {
+ Log (LogLevel.Error, System.Environment.NewLine + ex.ToString ());
+ }
+
+ ReportUnhandledException (ex, false, false, "internal");
+ }
+
+ public static void LogInternalError (string message, Exception ex)
+ {
+ Log (LogLevel.Error, message + (ex != null? System.Environment.NewLine + ex.ToString () : string.Empty));
+
ReportUnhandledException (ex, false, false, "internal");
}
public static void LogCriticalError (string message, Exception ex)
{
+ Log (LogLevel.Error, message + (ex != null? System.Environment.NewLine + ex.ToString () : string.Empty));
+
ReportUnhandledException (ex, true, false, "critical");
}
public static void LogFatalError (string message, Exception ex)
{
- Log (LogLevel.Fatal, message + (ex != null? System.Environment.NewLine + ex.ToString () : string.Empty));
+ Log (LogLevel.Error, message + (ex != null? System.Environment.NewLine + ex.ToString () : string.Empty));
ReportUnhandledException (ex, true, false, "fatal");
}
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs
===================================================================
@@ -198,7 +198,6 @@ static void SetupInstrumentation ()
static void OnLoadError (object s, AddinErrorEventArgs args)
{
string msg = "Add-in error (" + args.AddinId + "): " + args.Message;
- //LogReporting.LogReportingService.ReportUnhandledException (args.Exception, false, true);
LoggingService.LogError (msg, args.Exception);
}
Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs
===================================================================
@@ -502,10 +502,7 @@ void SetupExceptionManager ()
void HandleException (Exception ex, bool willShutdown)
{
// Log the crash to the MonoDevelop.log file first:
- LoggingService.LogError (string.Format ("An unhandled exception has occured. Terminating MonoDevelop? {0}", willShutdown), ex);
-
- // Pass it off to the reporting service now.
- LoggingService.ReportUnhandledException (ex, willShutdown);
+ LoggingService.LogInternalError (string.Format ("An unhandled exception has occured. Terminating MonoDevelop? {0}", willShutdown), ex);
}
/// <summary>SDBM-style hash, bounded to a range of 1000.</summary>
Commit: 9268a771bf74589184efd089df821a9691456508
Author: Cody Russell <[email protected]> (bratsche)
Date: 2013-10-10 18:37:08 GMT
URL: https://github.com/mono/monodevelop/commit/9268a771bf74589184efd089df821a9691456508
Change the submodule path
Changed paths:
M .gitmodules
Modified: .gitmodules
===================================================================
@@ -39,4 +39,4 @@
url = git://github.com/mono/guiunit.git
[submodule "main/external/raygun4net"]
path = main/external/raygun4net
- url = [email protected]:bratsche/raygun4net.git
+ url = git://github.com/bratsche/raygun4net.git
Commit: 4ada0d87927b8fb8253841549dcb15785df4dfca
Author: Cody Russell <[email protected]> (bratsche)
Date: 2013-10-10 18:41:56 GMT
URL: https://github.com/mono/monodevelop/commit/4ada0d87927b8fb8253841549dcb15785df4dfca
Use raygun4net submodule from mono instead of bratsche
Changed paths:
M .gitmodules
Modified: .gitmodules
===================================================================
@@ -39,4 +39,4 @@
url = git://github.com/mono/guiunit.git
[submodule "main/external/raygun4net"]
path = main/external/raygun4net
- url = git://github.com/bratsche/raygun4net.git
+ url = git://github.com/mono/raygun4net.git
Commit: 9cd4ff6f2568585c54f091c85261128ea0cf96d5
Author: Cody Russell <[email protected]> (bratsche)
Date: 2013-10-10 20:08:40 GMT
URL: https://github.com/mono/monodevelop/commit/9cd4ff6f2568585c54f091c85261128ea0cf96d5
[Core] Get the Raygun API key through branding service rather than environment.
Changed paths:
M main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs
===================================================================
@@ -100,7 +100,7 @@ static LoggingService ()
timestamp = DateTime.Now;
- string raygunKey = Environment.GetEnvironmentVariable ("MONODEVELOP_RAYGUN_KEY");
+ string raygunKey = BrandingService.GetString ("RaygunApiKey");
if (raygunKey != null) {
raygunClient = new RaygunClient (raygunKey);
}
Commit: 04cb4b7abd2ce36f8146100d2ec2584e95ab04e4
Author: Cody Russell <[email protected]> (bratsche)
Date: 2013-10-10 20:42:45 GMT
URL: https://github.com/mono/monodevelop/commit/04cb4b7abd2ce36f8146100d2ec2584e95ab04e4
[Core] LogInternalError() now sets silent = true
Changed paths:
M main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs
===================================================================
@@ -544,14 +544,14 @@ public static void LogInternalError (Exception ex)
Log (LogLevel.Error, System.Environment.NewLine + ex.ToString ());
}
- ReportUnhandledException (ex, false, false, "internal");
+ ReportUnhandledException (ex, false, true, "internal");
}
public static void LogInternalError (string message, Exception ex)
{
Log (LogLevel.Error, message + (ex != null? System.Environment.NewLine + ex.ToString () : string.Empty));
- ReportUnhandledException (ex, false, false, "internal");
+ ReportUnhandledException (ex, false, true, "internal");
}
public static void LogCriticalError (string message, Exception ex)
Commit: cd3b3303fa14437b9625d8edb2df0fb5aeae6c42
Author: Cody Russell <[email protected]> (bratsche)
Date: 2013-10-10 20:43:39 GMT
URL: https://github.com/mono/monodevelop/commit/cd3b3303fa14437b9625d8edb2df0fb5aeae6c42
[Core] LogCriticalError() now sets willShutdown = false
Changed paths:
M main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs
===================================================================
@@ -558,7 +558,7 @@ public static void LogCriticalError (string message, Exception ex)
{
Log (LogLevel.Error, message + (ex != null? System.Environment.NewLine + ex.ToString () : string.Empty));
- ReportUnhandledException (ex, true, false, "critical");
+ ReportUnhandledException (ex, false, false, "critical");
}
public static void LogFatalError (string message, Exception ex)
Commit: 2fd64fb86889a6e6c795bde682f48999a7d654eb
Author: Alex Corrado <[email protected]> (chkn)
Date: 2013-10-11 00:48:32 GMT
URL: https://github.com/mono/monodevelop/commit/2fd64fb86889a6e6c795bde682f48999a7d654eb
[build] Bump md-addins for a build
Changed paths:
M version-checks
Modified: version-checks
===================================================================
@@ -17,7 +17,7 @@ DEP[0]=md-addins
DEP_NAME[0]=MDADDINS
DEP_PATH[0]=${top_srcdir}/../md-addins
DEP_MODULE[0][email protected]:xamarin/md-addins.git
-DEP_NEEDED_VERSION[0]=ddb3f348b217e9370aa5165266846c38cfafd71d
+DEP_NEEDED_VERSION[0]=1b927d2ec0b21307176598f73d8dd5c0ca1b0141
DEP_BRANCH_AND_REMOTE[0]="master origin/master"
# heap-shot
Commit: bd51d949e3dee7c973bbd6519bff9095b3aa68eb
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-11 04:50:11 GMT
URL: https://github.com/mono/monodevelop/commit/bd51d949e3dee7c973bbd6519bff9095b3aa68eb
Fixed 'Bug 15344 - Converted/ignored files do not update their
line-ending warning' and 'Bug 15342 - Choosing "Convert all files to
UNIX line endings" only converts the current file'
Changed paths:
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/FileRegistry.cs
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/FileRegistry.cs
===================================================================
@@ -69,6 +69,7 @@ public static void Add (SourceEditorView sourceEditorView)
public static void Remove (SourceEditorView sourceEditorView)
{
openFiles.Remove (sourceEditorView);
+ UpdateEolMessages ();
}
static bool SkipView (SourceEditorView view)
@@ -214,6 +215,16 @@ public static void IgnoreLineEndingsInAllFiles ()
view.Save ();
}
}
+
+ public static void UpdateEolMessages ()
+ {
+ var multiple = HasMultipleIncorretEolMarkers;
+ foreach (var view in openFiles) {
+ if (SkipView (view) || !view.SourceEditorWidget.HasIncorrectEolMarker)
+ continue;
+ view.SourceEditorWidget.UpdateEolMarkerMessage(multiple);
+ }
+ }
#endregion
}
}
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs
===================================================================
@@ -46,7 +46,6 @@
using MonoDevelop.SourceEditor.QuickTasks;
using ICSharpCode.NRefactory.Semantics;
using ICSharpCode.NRefactory.Refactoring;
-using ICSharpCode.NRefactory;
namespace MonoDevelop.SourceEditor
{
@@ -883,6 +882,11 @@ public void ShowFileChangedWarning (bool multiple)
}
}
+ internal void UpdateEolMarkerMessage (bool multiple)
+ {
+ ShowIncorretEolMarkers (Document.FileName, multiple);
+ }
+
internal bool EnsureCorrectEolMarker (string fileName)
{
if (UseIncorrectMarkers)
@@ -891,7 +895,11 @@ internal bool EnsureCorrectEolMarker (string fileName)
if (HasIncorrectEolMarker) {
switch (DefaultSourceEditorOptions.Instance.LineEndingConversion) {
case LineEndingConversion.Ask:
- ShowIncorretEolMarkers (fileName, FileRegistry.HasMultipleIncorretEolMarkers);
+ var hasMultipleIncorretEolMarkers = FileRegistry.HasMultipleIncorretEolMarkers;
+ ShowIncorretEolMarkers (fileName, hasMultipleIncorretEolMarkers);
+ if (hasMultipleIncorretEolMarkers) {
+ FileRegistry.UpdateEolMessages ();
+ }
return false;
case LineEndingConversion.ConvertAlways:
ConvertLineEndings ();
@@ -932,11 +940,12 @@ static string GetEolString (string detectedEol)
return "Unknown";
}
+ OverlayMessageWindow messageOverlayWindow;
void ShowIncorretEolMarkers (string fileName, bool multiple)
{
RemoveMessageBar ();
- var window = new OverlayMessageWindow ();
+ messageOverlayWindow = new OverlayMessageWindow ();
var hbox = new HBox ();
hbox.Spacing = 8;
@@ -953,21 +962,23 @@ void ShowIncorretEolMarkers (string fileName, bool multiple)
okButton.WidthRequest = 60;
hbox.PackEnd (okButton, false, false, 0);
- var combo = new ComboBox(new [] {
- string.Format ("Convert to {0} line endings", GetEolString(textEditor.Options.DefaultEolMarker)),
- string.Format ("Convert all files to {0} line endings", GetEolString(textEditor.Options.DefaultEolMarker)),
- string.Format ("Keep {0} line endings", GetEolString(DetectedEolMarker)),
- string.Format ("Keep {0} line endings in all files", GetEolString(DetectedEolMarker))
- });
+ var list = new List<string> ();
+ list.Add (string.Format ("Convert to {0} line endings", GetEolString (textEditor.Options.DefaultEolMarker)));
+ if (multiple)
+ list.Add (string.Format ("Convert all files to {0} line endings", GetEolString (textEditor.Options.DefaultEolMarker)));
+ list.Add (string.Format ("Keep {0} line endings", GetEolString (DetectedEolMarker)));
+ if (multiple)
+ list.Add (string.Format ("Keep {0} line endings in all files", GetEolString (DetectedEolMarker)));
+ var combo = new ComboBox (list.ToArray ());
combo.Active = 0;
hbox.PackEnd (combo, false, false, 0);
var container = new HBox ();
const int containerPadding = 8;
container.PackStart (hbox, true, true, containerPadding);
- window.Child = container;
- window.ShowOverlay (this.TextEditor);
+ messageOverlayWindow.Child = container;
+ messageOverlayWindow.ShowOverlay (this.TextEditor);
- window.SizeFunc = () => {
+ messageOverlayWindow.SizeFunc = () => {
return okButton.SizeRequest ().Width +
combo.SizeRequest ().Width +
image.SizeRequest ().Width +
@@ -978,27 +989,41 @@ void ShowIncorretEolMarkers (string fileName, bool multiple)
image.Clicked += delegate {
UseIncorrectMarkers = true;
view.WorkbenchWindow.ShowNotification = false;
- window.Destroy ();
+ RemoveMessageBar ();
};
okButton.Clicked += delegate {
- switch (combo.Active) {
- case 0:
- ConvertLineEndings ();
- view.WorkbenchWindow.ShowNotification = false;
- view.Save (fileName, view.SourceEncoding);
- break;
- case 1:
- FileRegistry.ConvertLineEndingsInAllFiles ();
- break;
- case 2:
- UseIncorrectMarkers = true;
- view.WorkbenchWindow.ShowNotification = false;
- break;
- case 3:
- FileRegistry.IgnoreLineEndingsInAllFiles ();
- break;
+ if (multiple) {
+ switch (combo.Active) {
+ case 0:
+ ConvertLineEndings ();
+ view.WorkbenchWindow.ShowNotification = false;
+ view.Save (fileName, view.SourceEncoding);
+ break;
+ case 1:
+ FileRegistry.ConvertLineEndingsInAllFiles ();
+ break;
+ case 2:
+ UseIncorrectMarkers = true;
+ view.WorkbenchWindow.ShowNotification = false;
+ break;
+ case 3:
+ FileRegistry.IgnoreLineEndingsInAllFiles ();
+ break;
+ }
+ } else {
+ switch (combo.Active) {
+ case 0:
+ ConvertLineEndings ();
+ view.WorkbenchWindow.ShowNotification = false;
+ view.Save (fileName, view.SourceEncoding);
+ break;
+ case 1:
+ UseIncorrectMarkers = true;
+ view.WorkbenchWindow.ShowNotification = false;
+ break;
+ }
}
- window.Destroy ();
+ RemoveMessageBar ();
};
}
#endregion
@@ -1073,6 +1098,10 @@ public void RemoveMessageBar ()
}
if (!TextEditor.Visible)
TextEditor.Visible = true;
+ if (messageOverlayWindow != null) {
+ messageOverlayWindow.Destroy ();
+ messageOverlayWindow = null;
+ }
}
public void Reload ()
Commit: 231ba0cca5331b254ad8eafc26614b7c5a21d87a
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-11 07:57:03 GMT
URL: https://github.com/mono/monodevelop/commit/231ba0cca5331b254ad8eafc26614b7c5a21d87a
Fixed 'Bug 15248 - CRNL vs NL policy setting warning is too
obtrusive'.
Changed paths:
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/OverlayMessageWindow.cs
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs
M main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/ColorScheme.cs
M main/src/core/Mono.Texteditor/Styles/DefaultStyle.json
M main/src/core/Mono.Texteditor/Styles/MonokaiStyle.json
M main/src/core/Mono.Texteditor/Styles/NightshadeStyle.json
M main/src/core/Mono.Texteditor/Styles/OblivionStyle.json
M main/src/core/Mono.Texteditor/Styles/SolarizedDarkStyle.json
M main/src/core/Mono.Texteditor/Styles/SolarizedLightStyle.json
M main/src/core/Mono.Texteditor/Styles/TangoStyle.json
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/OverlayMessageWindow.cs
===================================================================
@@ -106,13 +106,13 @@ protected override bool OnExposeEvent (Gdk.EventExpose evnt)
using (var cr = CairoHelper.Create (evnt.Window)) {
cr.LineWidth = 1;
cr.Rectangle (0, 0, Allocation.Width, Allocation.Height);
- cr.SetSourceColor (textEditor.ColorStyle.PlainText.Background);
+ cr.SetSourceColor (textEditor.ColorStyle.NotificationText.Background);
cr.Fill ();
cr.RoundedRectangle (0, 0, Allocation.Width, Allocation.Height, 3);
- cr.SetSourceColor (textEditor.ColorStyle.TooltipText.Background);
+ cr.SetSourceColor (textEditor.ColorStyle.NotificationText.Background);
cr.FillPreserve ();
- cr.SetSourceColor (textEditor.ColorStyle.TooltipBorder.Color);
+ cr.SetSourceColor (textEditor.ColorStyle.NotificationBorder.Color);
cr.Stroke();
}
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs
===================================================================
@@ -953,6 +953,9 @@ void ShowIncorretEolMarkers (string fileName, bool multiple)
var image = new HoverCloseButton ();
hbox.PackStart (image, false, false, 0);
var label = new Label (string.Format ("This file has line endings ({0}) which differ from the policy settings ({1}).", GetEolString (DetectedEolMarker), GetEolString (textEditor.Options.DefaultEolMarker)));
+ var color = (Mono.TextEditor.HslColor)textEditor.ColorStyle.NotificationText.Foreground;
+ label.ModifyFg (StateType.Normal, color);
+
int w, h;
label.Layout.GetPixelSize (out w, out h);
label.Ellipsize = Pango.EllipsizeMode.End;
Modified: main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/ColorScheme.cs
===================================================================
@@ -83,6 +83,9 @@ public class ColorScheme
[ColorDescription("Tooltip Pager Text")]
public AmbientColor TooltipPagerText { get; private set; }
+ [ColorDescription("Notification Border")]
+ public AmbientColor NotificationBorder { get; private set; }
+
[ColorDescription("Bookmarks")]
public AmbientColor Bookmarks { get; private set; }
@@ -281,6 +284,9 @@ public class ColorScheme
[ColorDescription("Tooltip Text")] // not defined in vs.net
public ChunkStyle TooltipText { get; private set; }
+ [ColorDescription("Notification Text")] // not defined in vs.net
+ public ChunkStyle NotificationText { get; private set; }
+
[ColorDescription("Completion Text")] //not defined in vs.net
public ChunkStyle CompletionText { get; private set; }
Modified: main/src/core/Mono.Texteditor/Styles/DefaultStyle.json
===================================================================
@@ -57,6 +57,8 @@
{ "name": "Tooltip Pager Triangle", "color":"#737373" },
{ "name": "Tooltip Pager Text", "color":"#828282" },
+ { "name": "Notification Border", "color":"#D2B457" },
+
{ "name": "Completion Matching Substring", "color":"#BA3373" },
{ "name": "Completion Border", "color":"#C9C9C9" },
{ "name": "Completion Border(Inactive)", "color":"#666666" },
@@ -153,6 +155,7 @@
{ "name": "Razor Code", "fore":"text-black", "back":"#fdfaed" },
{ "name": "Tooltip Text", "fore":"text-black", "back":"#feffe9" },
+ { "name": "Notification Text", "fore":"text-black", "back":"#feffe9" },
{ "name": "Completion Text", "fore":"#434343", "back":"#F0F6F8" },
{ "name": "Completion Selected Text", "fore":"#f8fcfc", "back":"#dff4f0" },
Modified: main/src/core/Mono.Texteditor/Styles/MonokaiStyle.json
===================================================================
@@ -45,6 +45,7 @@
{ "name": "Tooltip Pager Triangle", "color":"#C8C8C2" },
{ "name": "Tooltip Pager Text", "color":"#C8C8C2" },
+ { "name": "Notification Border", "color":"#989892" },
{ "name": "Completion Matching Substring", "color":"#BA3373" },
{ "name": "Completion Border", "color":"#C9C9C9" },
@@ -141,7 +142,8 @@
{ "name": "Html Tag Delimiter", "fore":"monokai-white" },
{ "name": "Razor Code", "fore":"monokai-white", "back":"#373832" },
- { "name": "Tooltip Text", "fore":"black", "back":"#272725" },
+ { "name": "Tooltip Text", "fore":"monokai-white", "back":"#272725" },
+ { "name": "Notification Text", "fore":"monokai-white", "back":"#272725" },
{ "name": "Completion Text", "fore":"#434343", "back":"#F0F6F8" },
{ "name": "Completion Selected Text", "fore":"#f8fcfc", "back":"#dff4f0" },
Modified: main/src/core/Mono.Texteditor/Styles/NightshadeStyle.json
===================================================================
@@ -82,6 +82,8 @@
{ "name": "Tooltip Pager Triangle", "color":"NormalVim" },
{ "name": "Tooltip Pager Text", "color":"NormalVim" },
+ { "name": "Notification Border", "color":"#989892" },
+
{ "name": "Completion Matching Substring", "color":"#BA3373" },
{ "name": "Completion Border", "color":"#C9C9C9" },
{ "name": "Completion Border(Inactive)", "color":"#666666" },
@@ -179,6 +181,7 @@
{ "name": "Razor Code", "fore":"NormalVim", "back":"aluminium6" },
{ "name": "Tooltip Text", "fore":"NormalVim", "back":"#0a0a0a" },
+ { "name": "Notification Text", "fore":"NormalVim", "back":"#0a0a0a" },
{ "name": "Completion Text", "fore":"#434343", "back":"#F0F6F8" },
{ "name": "Completion Selected Text", "fore":"#f8fcfc", "back":"#dff4f0" },
Modified: main/src/core/Mono.Texteditor/Styles/OblivionStyle.json
===================================================================
@@ -57,6 +57,8 @@
{ "name": "Tooltip Pager Triangle", "color":"aluminium2" },
{ "name": "Tooltip Pager Text", "color":"aluminium2" },
+ { "name": "Notification Border", "color":"aluminium1" },
+
{ "name": "Completion Matching Substring", "color":"#BA3373" },
{ "name": "Completion Border", "color":"#C9C9C9" },
{ "name": "Completion Border(Inactive)", "color":"#bebebe" },
@@ -153,6 +155,7 @@
{ "name": "Razor Code", "fore":"aluminium2", "back":"aluminium7" },
{ "name": "Tooltip Text", "fore":"aluminium2", "back":"aluminium5" },
+ { "name": "Notification Text", "fore":"aluminium2", "back":"aluminium5" },
{ "name": "Completion Text", "fore":"#434343", "back":"#F0F6F8" },
{ "name": "Completion Selected Text", "fore":"#f8fcfc", "back":"#dff4f0" },
Modified: main/src/core/Mono.Texteditor/Styles/SolarizedDarkStyle.json
===================================================================
@@ -46,6 +46,8 @@
{ "name": "Tooltip Pager Triangle", "color":"base00" },
{ "name": "Tooltip Pager Text", "color":"base00" },
+ { "name": "Notification Border", "color":"base1" },
+
{ "name": "Completion Matching Substring", "color":"#BA3373" },
{ "name": "Completion Border", "color":"#C9C9C9" },
{ "name": "Completion Border(Inactive)", "color":"#bebebe" },
@@ -142,6 +144,7 @@
{ "name": "Razor Code", "fore":"black", "back":"base02" },
{ "name": "Tooltip Text", "fore":"black", "back":"#feffe9" },
+ { "name": "Notification Text", "fore":"black", "back":"#feffe9" },
{ "name": "Completion Text", "fore":"#434343", "back":"#F0F6F8" },
{ "name": "Completion Selected Text", "fore":"#f8fcfc", "back":"#dff4f0" },
Modified: main/src/core/Mono.Texteditor/Styles/SolarizedLightStyle.json
===================================================================
@@ -46,6 +46,8 @@
{ "name": "Tooltip Pager Triangle", "color":"base00" },
{ "name": "Tooltip Pager Text", "color":"base00" },
+ { "name": "Notification Border", "color":"base1" },
+
{ "name": "Completion Matching Substring", "color":"#BA3373" },
{ "name": "Completion Border", "color":"#C9C9C9" },
{ "name": "Completion Border(Inactive)", "color":"#bebebe" },
@@ -142,6 +144,7 @@
{ "name": "Razor Code", "fore":"black", "back":"base2" },
{ "name": "Tooltip Text", "fore":"black", "back":"#feffe9" },
+ { "name": "Notification Text", "fore":"black", "back":"#feffe9" },
{ "name": "Completion Text", "fore":"#434343", "back":"#F0F6F8" },
{ "name": "Completion Selected Text", "fore":"#f8fcfc", "back":"#dff4f0" },
Modified: main/src/core/Mono.Texteditor/Styles/TangoStyle.json
===================================================================
@@ -57,6 +57,7 @@
{ "name": "Tooltip Pager Triangle", "color":"#737373" },
{ "name": "Tooltip Pager Text", "color":"#828282" },
+ { "name": "Notification Border", "color":"#b2b2b2" },
{ "name": "Completion Matching Substring", "color":"#BA3373" },
{ "name": "Completion Border", "color":"#C9C9C9" },
@@ -140,6 +141,7 @@
{ "name": "Razor Code", "fore":"black", "back":"#fdfaed" },
{ "name": "Tooltip Text", "fore":"black", "back":"#feffe9" },
+ { "name": "Notification Text", "fore":"black", "back":"#feffe9" },
{ "name": "Completion Text", "fore":"#434343", "back":"#F0F6F8" },
{ "name": "Completion Selected Text", "fore":"#f8fcfc", "back":"#dff4f0" },
Commit: 70fbd6db8c3729086944c3a38f9e7d7de5f06099
Author: lluis <[email protected]> (slluis)
Date: 2013-10-11 09:13:13 GMT
URL: https://github.com/mono/monodevelop/commit/70fbd6db8c3729086944c3a38f9e7d7de5f06099
Updated references to xwt, md-addins
Changed paths:
M main/external/xwt
M version-checks
Modified: main/external/xwt
===================================================================
@@ -1 +1 @@
-Subproject commit 218021f6c6c2479be5656fc5abbd4fa07a693d60
+Subproject commit c7c2e8c232b1213513fe67e38da33a433e495634
Modified: version-checks
===================================================================
@@ -17,7 +17,7 @@ DEP[0]=md-addins
DEP_NAME[0]=MDADDINS
DEP_PATH[0]=${top_srcdir}/../md-addins
DEP_MODULE[0][email protected]:xamarin/md-addins.git
-DEP_NEEDED_VERSION[0]=1b927d2ec0b21307176598f73d8dd5c0ca1b0141
+DEP_NEEDED_VERSION[0]=49616da5b5b861a7edbbbfa052ccb77f67b4a805
DEP_BRANCH_AND_REMOTE[0]="master origin/master"
# heap-shot
Commit: f548fd6dc60e90a26573cb09efa1002fcdf906ce
Author: Andrés G. Aragoneses <[email protected]> (knocte)
Date: 2013-10-11 12:24:19 GMT
URL: https://github.com/mono/monodevelop/commit/f548fd6dc60e90a26573cb09efa1002fcdf906ce
[NewProjectDialog] Fix typo in user-visible string
Changed paths:
M main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewProjectDialog.cs
Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewProjectDialog.cs
===================================================================
@@ -430,7 +430,7 @@ bool CreateProject ()
try {
if (Directory.Exists (ProjectLocation)) {
- var btn = MessageService.AskQuestion (GettextCatalog.GetString ("Directory {0} already exists.\nDo you want to coninue the Project creation?", ProjectLocation), AlertButton.No, AlertButton.Yes);
+ var btn = MessageService.AskQuestion (GettextCatalog.GetString ("Directory {0} already exists.\nDo you want to continue the Project creation?", ProjectLocation), AlertButton.No, AlertButton.Yes);
if (btn != AlertButton.Yes)
return false;
}
Commit: f63fcf020a8f46fb842fc14ae56d7cbd20bd3d2b
Author: Jeffrey Stedfast <[email protected]> (jstedfast)
Date: 2013-10-11 13:10:54 GMT
URL: https://github.com/mono/monodevelop/commit/f63fcf020a8f46fb842fc14ae56d7cbd20bd3d2b
Merge pull request #416 from knocte/master
Fix typo in user-visible string
Changed paths:
M main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewProjectDialog.cs
Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewProjectDialog.cs
===================================================================
@@ -430,7 +430,7 @@ bool CreateProject ()
try {
if (Directory.Exists (ProjectLocation)) {
- var btn = MessageService.AskQuestion (GettextCatalog.GetString ("Directory {0} already exists.\nDo you want to coninue the Project creation?", ProjectLocation), AlertButton.No, AlertButton.Yes);
+ var btn = MessageService.AskQuestion (GettextCatalog.GetString ("Directory {0} already exists.\nDo you want to continue the Project creation?", ProjectLocation), AlertButton.No, AlertButton.Yes);
if (btn != AlertButton.Yes)
return false;
}
Commit: 74fef8480fee2d62bf928066b27f704470973f8f
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-12 03:37:35 GMT
URL: https://github.com/mono/monodevelop/commit/74fef8480fee2d62bf928066b27f704470973f8f
[SourceEditor] Added text editor option to change the generation of
multi level undo steps for editor corrections.
Changed paths:
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorOptions.cs
M main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs
M main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/gui.stetic
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs
===================================================================
@@ -50,15 +50,17 @@ public BehaviorPanel ()
public virtual Gtk.Widget CreatePanelWidget ()
{
// this.autoInsertTemplateCheckbutton.Active = DefaultSourceEditorOptions.Options.AutoInsertTemplates;
- this.autoInsertBraceCheckbutton.Active = DefaultSourceEditorOptions.Instance.AutoInsertMatchingBracket;
- this.smartSemicolonPlaceCheckbutton.Active = DefaultSourceEditorOptions.Instance.SmartSemicolonPlacement;
-
- this.tabAsReindentCheckbutton.Active = DefaultSourceEditorOptions.Instance.TabIsReindent;
- this.indentationCombobox.Active = (int)DefaultSourceEditorOptions.Instance.IndentStyle;
- this.controlLeftRightCombobox.Active = (int)DefaultSourceEditorOptions.Instance.ControlLeftRightMode;
- this.useViModesCheck.Active = DefaultSourceEditorOptions.Instance.UseViModes;
- this.checkbuttonOnTheFlyFormatting.Active = DefaultSourceEditorOptions.Instance.OnTheFlyFormatting;
+ autoInsertBraceCheckbutton.Active = DefaultSourceEditorOptions.Instance.AutoInsertMatchingBracket;
+ smartSemicolonPlaceCheckbutton.Active = DefaultSourceEditorOptions.Instance.SmartSemicolonPlacement;
+ tabAsReindentCheckbutton.Active = DefaultSourceEditorOptions.Instance.TabIsReindent;
+ indentationCombobox.Active = (int)DefaultSourceEditorOptions.Instance.IndentStyle;
+ controlLeftRightCombobox.Active = (int)DefaultSourceEditorOptions.Instance.ControlLeftRightMode;
+ useViModesCheck.Active = DefaultSourceEditorOptions.Instance.UseViModes;
+ checkbuttonOnTheFlyFormatting.Active = DefaultSourceEditorOptions.Instance.OnTheFlyFormatting;
+ checkbuttonGenerateFormattingUndoStep.Active = DefaultSourceEditorOptions.Instance.GenerateFormattingUndoStep;
+
+
checkbuttonFormatOnSave.Active = PropertyService.Get ("AutoFormatDocumentOnSave", false);
checkbuttonAutoSetSearchPatternCasing.Active = PropertyService.Get ("AutoSetPatternCasing", false);
HandleAutoInsertBraceCheckbuttonToggled (null, null);
@@ -67,19 +69,20 @@ public virtual Gtk.Widget CreatePanelWidget ()
void HandleAutoInsertBraceCheckbuttonToggled (object sender, EventArgs e)
{
- this.smartSemicolonPlaceCheckbutton.Sensitive = this.autoInsertBraceCheckbutton.Active;
+ smartSemicolonPlaceCheckbutton.Sensitive = autoInsertBraceCheckbutton.Active;
}
public virtual void ApplyChanges ()
{
//DefaultSourceEditorOptions.Options.AutoInsertTemplates = this.autoInsertTemplateCheckbutton.Active;
- DefaultSourceEditorOptions.Instance.AutoInsertMatchingBracket = this.autoInsertBraceCheckbutton.Active;
- DefaultSourceEditorOptions.Instance.SmartSemicolonPlacement = this.smartSemicolonPlaceCheckbutton.Active;
- DefaultSourceEditorOptions.Instance.IndentStyle = (IndentStyle)this.indentationCombobox.Active;
- DefaultSourceEditorOptions.Instance.TabIsReindent = this.tabAsReindentCheckbutton.Active;
- DefaultSourceEditorOptions.Instance.ControlLeftRightMode = (ControlLeftRightMode)this.controlLeftRightCombobox.Active;
- DefaultSourceEditorOptions.Instance.UseViModes = this.useViModesCheck.Active;
- DefaultSourceEditorOptions.Instance.OnTheFlyFormatting = this.checkbuttonOnTheFlyFormatting.Active;
+ DefaultSourceEditorOptions.Instance.AutoInsertMatchingBracket = autoInsertBraceCheckbutton.Active;
+ DefaultSourceEditorOptions.Instance.SmartSemicolonPlacement = smartSemicolonPlaceCheckbutton.Active;
+ DefaultSourceEditorOptions.Instance.IndentStyle = (IndentStyle)indentationCombobox.Active;
+ DefaultSourceEditorOptions.Instance.TabIsReindent = tabAsReindentCheckbutton.Active;
+ DefaultSourceEditorOptions.Instance.ControlLeftRightMode = (ControlLeftRightMode)controlLeftRightCombobox.Active;
+ DefaultSourceEditorOptions.Instance.UseViModes = useViModesCheck.Active;
+ DefaultSourceEditorOptions.Instance.OnTheFlyFormatting = checkbuttonOnTheFlyFormatting.Active;
+ DefaultSourceEditorOptions.Instance.GenerateFormattingUndoStep = checkbuttonGenerateFormattingUndoStep.Active;
PropertyService.Set ("AutoSetPatternCasing", checkbuttonAutoSetSearchPatternCasing.Active);
PropertyService.Set ("AutoFormatDocumentOnSave", checkbuttonFormatOnSave.Active);
}
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs
===================================================================
@@ -398,8 +398,15 @@ protected override bool OnIMProcessedKeyPressEvent (Gdk.Key key, uint ch, Gdk.Mo
skipChars.Remove (skipChar);
}
if (Extension != null) {
- if (ExtensionKeyPress (key, ch, state))
- result = base.OnIMProcessedKeyPressEvent (key, ch, state);
+ if (!DefaultSourceEditorOptions.Instance.GenerateFormattingUndoStep) {
+ using (var undo = Document.OpenUndoGroup ()) {
+ if (ExtensionKeyPress (key, ch, state))
+ result = base.OnIMProcessedKeyPressEvent (key, ch, state);
+ }
+ } else {
+ if (ExtensionKeyPress (key, ch, state))
+ result = base.OnIMProcessedKeyPressEvent (key, ch, state);
+ }
if (returnBetweenBraces)
HitReturn ();
} else {
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorOptions.cs
===================================================================
@@ -231,6 +231,7 @@ void LoadAllPrefs ()
this.EnableHighlightUsages = PropertyService.Get ("EnableHighlightUsages", false);
base.DrawIndentationMarkers = PropertyService.Get ("DrawIndentationMarkers", false);
this.lineEndingConversion = PropertyService.Get ("LineEndingConversion", LineEndingConversion.Ask);
+ this.generateFormattingUndoStep = PropertyService.Get ("GenerateFormattingUndoStep", true);
base.ShowWhitespaces = PropertyService.Get ("ShowWhitespaces", Mono.TextEditor.ShowWhitespaces.Never);
base.IncludeWhitespaces = PropertyService.Get ("IncludeWhitespaces", Mono.TextEditor.IncludeWhitespaces.All);
base.WrapLines = PropertyService.Get ("WrapLines", false);
@@ -412,6 +413,20 @@ void LoadAllPrefs ()
}
}
+
+ bool generateFormattingUndoStep;
+ public bool GenerateFormattingUndoStep {
+ get {
+ return generateFormattingUndoStep;
+ }
+ set {
+ if (value != this.generateFormattingUndoStep) {
+ this.generateFormattingUndoStep = value;
+ PropertyService.Set ("GenerateFormattingUndoStep", value);
+ OnChanged (EventArgs.Empty);
+ }
+ }
+ }
#endregion
bool useViModes = false;
Modified: main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs
===================================================================
@@ -15,6 +15,7 @@ public partial class BehaviorPanel
private global::Gtk.CheckButton checkbuttonOnTheFlyFormatting;
private global::Gtk.CheckButton checkbuttonFormatOnSave;
private global::Gtk.CheckButton checkbuttonAutoSetSearchPatternCasing;
+ private global::Gtk.CheckButton checkbuttonGenerateFormattingUndoStep;
private global::Gtk.Label GtkLabel6;
private global::Gtk.Alignment GtkAlignment;
private global::Gtk.VBox vbox2;
@@ -29,7 +30,7 @@ public partial class BehaviorPanel
private global::Gtk.HBox hbox3;
private global::Gtk.Label label2;
private global::Gtk.ComboBox controlLeftRightCombobox;
-
+
protected virtual void Build ()
{
global::Stetic.Gui.Initialize (this);
@@ -136,12 +137,24 @@ protected virtual void Build ()
w8.Position = 4;
w8.Expand = false;
w8.Fill = false;
+ // Container child vbox4.Gtk.Box+BoxChild
+ this.checkbuttonGenerateFormattingUndoStep = new global::Gtk.CheckButton ();
+ this.checkbuttonGenerateFormattingUndoStep.CanFocus = true;
+ this.checkbuttonGenerateFormattingUndoStep.Name = "checkbuttonGenerateFormattingUndoStep";
+ this.checkbuttonGenerateFormattingUndoStep.Label = global::Mono.Unix.Catalog.GetString ("_Generate additional undo steps for formatting");
+ this.checkbuttonGenerateFormattingUndoStep.DrawIndicator = true;
+ this.checkbuttonGenerateFormattingUndoStep.UseUnderline = true;
+ this.vbox4.Add (this.checkbuttonGenerateFormattingUndoStep);
+ global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.checkbuttonGenerateFormattingUndoStep]));
+ w9.Position = 5;
+ w9.Expand = false;
+ w9.Fill = false;
this.alignment3.Add (this.vbox4);
this.vbox1.Add (this.alignment3);
- global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.alignment3]));
- w10.Position = 1;
- w10.Expand = false;
- w10.Fill = false;
+ global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.alignment3]));
+ w11.Position = 1;
+ w11.Expand = false;
+ w11.Fill = false;
// Container child vbox1.Gtk.Box+BoxChild
this.GtkLabel6 = new global::Gtk.Label ();
this.GtkLabel6.Name = "GtkLabel6";
@@ -149,10 +162,10 @@ protected virtual void Build ()
this.GtkLabel6.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>Indentation</b>");
this.GtkLabel6.UseMarkup = true;
this.vbox1.Add (this.GtkLabel6);
- global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.GtkLabel6]));
- w11.Position = 2;
- w11.Expand = false;
- w11.Fill = false;
+ global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.GtkLabel6]));
+ w12.Position = 2;
+ w12.Expand = false;
+ w12.Fill = false;
// Container child vbox1.Gtk.Box+BoxChild
this.GtkAlignment = new global::Gtk.Alignment (0F, 0F, 1F, 1F);
this.GtkAlignment.Name = "GtkAlignment";
@@ -171,23 +184,23 @@ protected virtual void Build ()
this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("_Indentation mode:");
this.label1.UseUnderline = true;
this.hbox1.Add (this.label1);
- global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.label1]));
- w12.Position = 0;
- w12.Expand = false;
- w12.Fill = false;
+ global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.label1]));
+ w13.Position = 0;
+ w13.Expand = false;
+ w13.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild
this.indentationCombobox = global::Gtk.ComboBox.NewText ();
this.indentationCombobox.Name = "indentationCombobox";
this.hbox1.Add (this.indentationCombobox);
- global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.indentationCombobox]));
- w13.Position = 1;
- w13.Expand = false;
- w13.Fill = false;
- this.vbox2.Add (this.hbox1);
- global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1]));
- w14.Position = 0;
+ global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.indentationCombobox]));
+ w14.Position = 1;
w14.Expand = false;
w14.Fill = false;
+ this.vbox2.Add (this.hbox1);
+ global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1]));
+ w15.Position = 0;
+ w15.Expand = false;
+ w15.Fill = false;
// Container child vbox2.Gtk.Box+BoxChild
this.tabAsReindentCheckbutton = new global::Gtk.CheckButton ();
this.tabAsReindentCheckbutton.CanFocus = true;
@@ -196,16 +209,16 @@ protected virtual void Build ()
this.tabAsReindentCheckbutton.DrawIndicator = true;
this.tabAsReindentCheckbutton.UseUnderline = true;
this.vbox2.Add (this.tabAsReindentCheckbutton);
- global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.tabAsReindentCheckbutton]));
- w15.Position = 1;
- w15.Expand = false;
- w15.Fill = false;
+ global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.tabAsReindentCheckbutton]));
+ w16.Position = 1;
+ w16.Expand = false;
+ w16.Fill = false;
this.GtkAlignment.Add (this.vbox2);
this.vbox1.Add (this.GtkAlignment);
- global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.GtkAlignment]));
- w17.Position = 3;
- w17.Expand = false;
- w17.Fill = false;
+ global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.GtkAlignment]));
+ w18.Position = 3;
+ w18.Expand = false;
+ w18.Fill = false;
// Container child vbox1.Gtk.Box+BoxChild
this.GtkLabel8 = new global::Gtk.Label ();
this.GtkLabel8.Name = "GtkLabel8";
@@ -213,10 +226,10 @@ protected virtual void Build ()
this.GtkLabel8.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>Navigation</b>");
this.GtkLabel8.UseMarkup = true;
this.vbox1.Add (this.GtkLabel8);
- global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.GtkLabel8]));
- w18.Position = 4;
- w18.Expand = false;
- w18.Fill = false;
+ global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.GtkLabel8]));
+ w19.Position = 4;
+ w19.Expand = false;
+ w19.Fill = false;
// Container child vbox1.Gtk.Box+BoxChild
this.alignment4 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
this.alignment4.Name = "alignment4";
@@ -233,10 +246,10 @@ protected virtual void Build ()
this.useViModesCheck.DrawIndicator = true;
this.useViModesCheck.UseUnderline = true;
this.vbox5.Add (this.useViModesCheck);
- global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.useViModesCheck]));
- w19.Position = 0;
- w19.Expand = false;
- w19.Fill = false;
+ global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.useViModesCheck]));
+ w20.Position = 0;
+ w20.Expand = false;
+ w20.Fill = false;
// Container child vbox5.Gtk.Box+BoxChild
this.hbox3 = new global::Gtk.HBox ();
this.hbox3.Name = "hbox3";
@@ -247,29 +260,29 @@ protected virtual void Build ()
this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("Word _break mode:");
this.label2.UseUnderline = true;
this.hbox3.Add (this.label2);
- global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.label2]));
- w20.Position = 0;
- w20.Expand = false;
- w20.Fill = false;
+ global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.label2]));
+ w21.Position = 0;
+ w21.Expand = false;
+ w21.Fill = false;
// Container child hbox3.Gtk.Box+BoxChild
this.controlLeftRightCombobox = global::Gtk.ComboBox.NewText ();
this.controlLeftRightCombobox.Name = "controlLeftRightCombobox";
this.hbox3.Add (this.controlLeftRightCombobox);
- global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.controlLeftRightCombobox]));
- w21.Position = 1;
- w21.Expand = false;
- w21.Fill = false;
- this.vbox5.Add (this.hbox3);
- global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hbox3]));
+ global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.controlLeftRightCombobox]));
w22.Position = 1;
w22.Expand = false;
w22.Fill = false;
+ this.vbox5.Add (this.hbox3);
+ global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hbox3]));
+ w23.Position = 1;
+ w23.Expand = false;
+ w23.Fill = false;
this.alignment4.Add (this.vbox5);
this.vbox1.Add (this.alignment4);
- global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.alignment4]));
- w24.Position = 5;
- w24.Expand = false;
- w24.Fill = false;
+ global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.alignment4]));
+ w25.Position = 5;
+ w25.Expand = false;
+ w25.Fill = false;
this.Add (this.vbox1);
if ((this.Child != null)) {
this.Child.ShowAll ();
Modified: main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/gui.stetic
===================================================================
@@ -7,6 +7,7 @@
<import>
<widget-library name="../../../../build/bin/MonoDevelop.Ide.dll" />
<widget-library name="../../../../build/AddIns/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.dll" />
+ <widget-library name="../../../../build/AddIns/MonoDevelop.Debugger/MonoDevelop.Debugger.dll" />
<widget-library name="../../../../build/bin/Mono.TextEditor.dll" />
<widget-library name="../../../../build/AddIns/DisplayBindings/SourceEditor/MonoDevelop.SourceEditor2.dll" internal="true" />
</import>
@@ -717,6 +718,22 @@
<property name="Fill">False</property>
</packing>
</child>
+ <child>
+ <widget class="Gtk.CheckButton" id="checkbuttonGenerateFormattingUndoStep">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Label" translatable="yes">_Generate additional undo steps for formatting</property>
+ <property name="DrawIndicator">True</property>
+ <property name="HasLabel">True</property>
+ <property name="UseUnderline">True</property>
+ </widget>
+ <packing>
+ <property name="Position">5</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
</widget>
</child>
</widget>
Commit: e20e35664bf0236d9915a113458c6ef84b1e9b20
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-12 03:54:54 GMT
URL: https://github.com/mono/monodevelop/commit/e20e35664bf0236d9915a113458c6ef84b1e9b20
[TextEditor] Be more careful with stacking keyboard undo steps.
Changed paths:
M main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs
Modified: main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs
===================================================================
@@ -755,7 +755,7 @@ public void OptimizeTypedUndo ()
undoStack.Push (keyUndo);
keyUndo = new KeyboardStackUndo ();
}
- if (keyUndo.Args != null && keyUndo.Args.Offset + 1 != top.Args.Offset) {
+ if (keyUndo.Args != null && keyUndo.Args.Offset + 1 != top.Args.Offset || !char.IsLetterOrDigit (top.Args.InsertedText.GetCharAt (0))) {
keyUndo.IsClosed = true;
undoStack.Push (keyUndo);
keyUndo = new KeyboardStackUndo ();
Commit: ef18fb96dad5108083199461a9a1e0ae36d28485
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-12 16:16:44 GMT
URL: https://github.com/mono/monodevelop/commit/ef18fb96dad5108083199461a9a1e0ae36d28485
[SourceEditor] Changed general formatting undo step option default.
Changed paths:
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorOptions.cs
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorOptions.cs
===================================================================
@@ -231,7 +231,7 @@ void LoadAllPrefs ()
this.EnableHighlightUsages = PropertyService.Get ("EnableHighlightUsages", false);
base.DrawIndentationMarkers = PropertyService.Get ("DrawIndentationMarkers", false);
this.lineEndingConversion = PropertyService.Get ("LineEndingConversion", LineEndingConversion.Ask);
- this.generateFormattingUndoStep = PropertyService.Get ("GenerateFormattingUndoStep", true);
+ this.generateFormattingUndoStep = PropertyService.Get ("GenerateFormattingUndoStep", false);
base.ShowWhitespaces = PropertyService.Get ("ShowWhitespaces", Mono.TextEditor.ShowWhitespaces.Never);
base.IncludeWhitespaces = PropertyService.Get ("IncludeWhitespaces", Mono.TextEditor.IncludeWhitespaces.All);
base.WrapLines = PropertyService.Get ("WrapLines", false);
Commit: ba9ba3ee2b94fe4e0d7e7bb013353b088ab44eb4
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-14 06:18:57 GMT
URL: https://github.com/mono/monodevelop/commit/ba9ba3ee2b94fe4e0d7e7bb013353b088ab44eb4
Fixed 'Bug 15335 - In a multiline comment, pressing Enter jumps way ahead'
Changed paths:
M main/external/nrefactory
M main/tests/UnitTests/MonoDevelop.CSharpBinding/CSharpTextEditorIndentationTests.cs
Modified: main/external/nrefactory
===================================================================
@@ -1 +1 @@
-Subproject commit 0bbf46a3b1a78eb20267e4be90f3cb5e457f09a6
+Subproject commit 37f7f49e89db32b4fa5eab0a6a7bdea54154e313
Modified: main/tests/UnitTests/MonoDevelop.CSharpBinding/CSharpTextEditorIndentationTests.cs
===================================================================
@@ -358,5 +358,18 @@ public void TestEnterSelectionBehavior ()
CheckOutput (data, "\tfirst\n\t$third");
}
+
+
+ /// <summary>
+ /// Bug 15335 - In a multiline comment, pressing Enter jumps way ahead
+ /// </summary>
+ [Test]
+ public void TestBug15335 ()
+ {
+ var data = Create ("namespace Foo\n{\n\tpublic class Bar\n\t{\n\t\tvoid Test()\r\n\t\t{\r\n\t\t\t/* foo$\n\t\t}\n\t}\n}\n");
+ MiscActions.InsertNewLine (data);
+
+ CheckOutput (data, "namespace aFoo\n{\n\tpublic class Bar\n\t{\n\t\tvoid Test()\r\n\t\t{\r\n\t\t\t/* foo\n\t\t\t * $\n\t\t}\n\t}\n}\n");
+ }
}
}
Commit: 7a159de82c689945b5eb8cc78078d07180bfbdaf
Author: Mike Krüger <[email protected]> (mkrueger)
Date: 2013-10-14 06:47:36 GMT
URL: https://github.com/mono/monodevelop/commit/7a159de82c689945b5eb8cc78078d07180bfbdaf
[SourceEditor] Editor now detects mixed line endings as well.
Changed paths:
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs
M main/src/core/Mono.Texteditor/Mono.TextEditor/Actions/ClipboardActions.cs
M main/src/core/Mono.Texteditor/Mono.TextEditor/Document/ILineSplitter.cs
M main/src/core/Mono.Texteditor/Mono.TextEditor/Document/LineSplitter.cs
M main/src/core/Mono.Texteditor/Mono.TextEditor/Document/PrimitiveLineSplitter.cs
M main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs
===================================================================
@@ -861,6 +861,8 @@ public void ShowFileChangedWarning (bool multiple)
internal bool UseIncorrectMarkers { get; set; }
internal bool HasIncorrectEolMarker {
get {
+ if (Document.HasLineEndingMismatchOnTextSet)
+ return true;
string eol = DetectedEolMarker;
if (eol == null)
return false;
@@ -869,6 +871,8 @@ public void ShowFileChangedWarning (bool multiple)
}
string DetectedEolMarker {
get {
+ if (Document.HasLineEndingMismatchOnTextSet)
+ return "?";
if (textEditor.IsDisposed) {
LoggingService.LogWarning ("SourceEditorWidget.cs: HasIncorrectEolMarker was called on disposed source editor widget." + Environment.NewLine + Environment.StackTrace);
return null;
@@ -924,6 +928,7 @@ internal void ConvertLineEndings ()
}
view.StoreSettings ();
view.ReplaceContent (Document.FileName, newText.ToString (), null);
+ Document.HasLineEndingMismatchOnTextSet = false;
view.LoadSettings ();
}
@@ -936,6 +941,8 @@ static string GetEolString (string detectedEol)
return "Windows";
case "\r":
return "Mac";
+ case "?":
+ return "mixed";
}
return "Unknown";
}
Modified: main/src/core/Mono.Texteditor/Mono.TextEditor/Actions/ClipboardActions.cs
===================================================================
@@ -312,7 +312,7 @@ static int PasteFrom (Clipboard clipboard, TextEditorData data, bool preserveSel
if (delimiter.IsInvalid)
break;
- int delimiterEndOffset = delimiter.Offset + delimiter.Length;
+ int delimiterEndOffset = delimiter.EndOffset;
lines.Add (text.Substring (offset, delimiter.Offset - offset));
offset = delimiterEndOffset;
}
Modified: main/src/core/Mono.Texteditor/Mono.TextEditor/Document/ILineSplitter.cs
===================================================================
@@ -8,6 +8,14 @@ public interface ILineSplitter
{
int Count { get; }
+ /// <summary>
+ /// True if during initialization a line ending mismatch was encountered.
+ /// </summary>
+ bool LineEndingMismatch {
+ get;
+ set;
+ }
+
IEnumerable<DocumentLine> Lines { get; }
void Clear ();
Modified: main/src/core/Mono.Texteditor/Mono.TextEditor/Document/LineSplitter.cs
===================================================================
@@ -131,23 +131,31 @@ public void TextRemove (int offset, int length)
ChangeLength (startNode, startNode.LengthIncludingDelimiter - charsRemoved + charsLeft, endNode.DelimiterLength);
}
+ public bool LineEndingMismatch {
+ get;
+ set;
+ }
+
//bool inInit;
public void Initalize (string text)
{
+ LineEndingMismatch = false;
Clear ();
if (string.IsNullOrEmpty (text))
return;
var nodes = new List<TreeNode> ();
+ var delimiterType = UnicodeNewline.Unknown;
int offset = 0;
while (true) {
var delimiter = NextDelimiter (text, offset);
if (delimiter.IsInvalid)
break;
-
int delimiterEndOffset = delimiter.Offset + delimiter.Length;
var newLine = new TreeNode (delimiterEndOffset - offset, delimiter.Length);
nodes.Add (newLine);
+ if (offset > 0 && delimiterType != delimiter.UnicodeNewline)
+ LineEndingMismatch = true;
offset = delimiterEndOffset;
}
var lastLine = new TreeNode (text.Length - offset, 0);
@@ -219,7 +227,13 @@ internal struct Delimiter
public static readonly Delimiter Invalid = new Delimiter (-1, 0);
public readonly int Offset;
- public readonly int Length;
+ public readonly UnicodeNewline UnicodeNewline;
+
+ public int Length {
+ get {
+ return UnicodeNewline == UnicodeNewline.CRLF ? 2 : 1;
+ }
+ }
public int EndOffset {
get { return Offset + Length; }
@@ -231,10 +245,10 @@ internal struct Delimiter
}
}
- public Delimiter (int offset, int length)
+ public Delimiter (int offset, UnicodeNewline unicodeNewline)
{
Offset = offset;
- Length = length;
+ UnicodeNewline = unicodeNewline;
}
}
@@ -243,12 +257,13 @@ static unsafe internal Delimiter NextDelimiter (string text, int offset)
fixed (char* start = text) {
char* p = start + offset;
char* endPtr = start + text.Length;
+
while (p < endPtr) {
char* nextp = p + 1;
char nextChar = nextp < endPtr ? *nextp : '\0';
- var nl = NewLine.GetDelimiterLength (*p, nextChar);
- if (nl > 0)
- return new Delimiter ((int)(p - start), nl);
+ var type = NewLine.GetDelimiterType (*p, nextChar);
+ if (type != UnicodeNewline.Unknown)
+ return new Delimiter ((int)(p - start), type);
p++;
}
return Delimiter.Invalid;
Modified: main/src/core/Mono.Texteditor/Mono.TextEditor/Document/PrimitiveLineSplitter.cs
===================================================================
@@ -45,6 +45,11 @@ public PrimitiveLineSegment (PrimitiveLineSplitter splitter, int lineNumber, int
}
}
+ public bool LineEndingMismatch {
+ get;
+ set;
+ }
+
public int Count {
get { return delimiters.Count + 1; }
}
Modified: main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs
===================================================================
@@ -125,6 +125,15 @@ protected virtual void OnSyntaxModeChanged (Mono.TextEditor.SyntaxModeChangeEven
get;
set;
}
+
+ public bool HasLineEndingMismatchOnTextSet {
+ get {
+ return splitter.LineEndingMismatch;
+ }
+ set {
+ splitter.LineEndingMismatch = value;
+ }
+ }
protected TextDocument (IBuffer buffer,ILineSplitter splitter)
{
Commit: f508ab545796858530165a150d5b7ac26c12ba52
Author: Lluis Sanchez <[email protected]> (slluis)
Date: 2013-10-14 08:13:11 GMT
URL: https://github.com/mono/monodevelop/commit/f508ab545796858530165a150d5b7ac26c12ba52
Merge remote-tracking branch 'origin/master' into retina
Conflicts:
main/external/nrefactory
main/src/addins/NUnit/Gui/TestNodeBuilder.cs
version-checks
Changed paths:
M .gitmodules
M main/Main.sln
M main/external/debugger-libs
M main/external/guiunit
M main/external/nrefactory
M main/external/xwt
M main/src/addins/AspNet/MonoDevelop.AspNet.Mvc/RazorEditorParserFixed/BackgroundParser.cs
M main/src/addins/CSharpBinding/CSharpBinding.addin.xml
M main/src/addins/CSharpBinding/CSharpBinding.csproj
M main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ExportCodeGenerator.cs
M main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs
M main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/OnTheFlyFormatter.cs
M main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringContext.cs
M main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringScript.cs
M main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerationService.cs
M main/src/addins/CSharpBinding/md1format.xml
M main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/SoftDebuggerEngine.cs
M main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultMarker.cs
M main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultsEditorExtension.cs
M main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.addin.xml
M main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/ResolveCommandHandler.cs
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.addin.xml
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/FileRegistry.cs
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCache.cs
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorOptions.cs
M main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs
M main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs
M main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/gui.stetic
M main/src/addins/NUnit/Gui/TestNodeBuilder.cs
M main/src/addins/NUnit/Services/NUnitAssemblyTestSuite.cs
M main/src/addins/NUnit/Services/TcpTestListener.cs
M main/src/addins/NUnit/Services/TestContext.cs
M main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git.csproj
M main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditBranchDialog.cs
M main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitConfigurationDialog.cs
M main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs
M main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitUtil.cs
M main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/MonoDevelop.VersionControl.Git.GitConfigurationDialog.cs
M main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/gui.stetic
M main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/SubviewAttachmentHandler.cs
M main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UrlBasedRepository.cs
M main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/ColorScheme.cs
M main/src/core/Mono.Texteditor/Mono.TextEditor/Actions/ClipboardActions.cs
M main/src/core/Mono.Texteditor/Mono.TextEditor/Document/ILineSplitter.cs
M main/src/core/Mono.Texteditor/Mono.TextEditor/Document/LineSplitter.cs
M main/src/core/Mono.Texteditor/Mono.TextEditor/Document/PrimitiveLineSplitter.cs
M main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs
M main/src/core/Mono.Texteditor/Mono.TextEditor/UrlMarker.cs
M main/src/core/Mono.Texteditor/Styles/DefaultStyle.json
M main/src/core/Mono.Texteditor/Styles/MonokaiStyle.json
M main/src/core/Mono.Texteditor/Styles/NightshadeStyle.json
M main/src/core/Mono.Texteditor/Styles/OblivionStyle.json
M main/src/core/Mono.Texteditor/Styles/SolarizedDarkStyle.json
M main/src/core/Mono.Texteditor/Styles/SolarizedLightStyle.json
M main/src/core/Mono.Texteditor/Styles/TangoStyle.json
M main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/TargetRuntime.cs
M main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj
M main/src/core/MonoDevelop.Core/MonoDevelop.Core/FileService.cs
M main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs
M main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs
M main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProject.cs
M main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs
M main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectService.cs
M main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/RemoteProjectBuilder.cs
M main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildTool.cs
M main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs
M main/src/core/MonoDevelop.Ide/AssemblyInfo.cs
M main/src/core/MonoDevelop.Ide/MonoDevelop.Components/InfoBar.cs
M main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs
M main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs
M main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LogAgentOptionsPanel.cs
M main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs
M main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewProjectDialog.cs
M main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs
M main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs
M main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/LogReportingStartup.cs
M main/tests/UnitTests/MonoDevelop.CSharpBinding/CSharpTextEditorIndentationTests.cs
M main/tests/UnitTests/MonoDevelop.Ide.FindInFiles/MemberCollectorTests.cs
M main/tests/UnitTests/MonoDevelop.Projects/LocalCopyTests.cs
M main/tests/UnitTests/MonoDevelop.Projects/MSBuildTests.cs
M main/tests/UnitTests/MonoDevelop.Projects/ProjectTests.cs
M main/tests/test-projects/ContactBook/ContactBook/ContactBook.mdp
M main/tests/test-projects/ContactBook/CustomWidgets/CustomWidgets.mdp
M main/tests/test-projects/console-with-libs-mdp/console-with-libs-mdp/console-with-libs-mdp.mdp
M main/tests/test-projects/console-with-libs-mdp/library1/library1.mdp
M main/tests/test-projects/console-with-libs-mdp/library2/library2.mdp
M main/tests/test-projects/csharp-console-mdp/csharp-console-mdp/csharp-console-mdp.mdp
M main/tests/test-projects/generated-console-project/TestProject.mdp
M main/tests/test-projects/nested-solutions-mdp/console-project/console-project.mdp
M main/tests/test-projects/nested-solutions-mdp/nested-solution1/library1/library1.mdp
M main/tests/test-projects/nested-solutions-mdp/nested-solution1/library2/library2.mdp
M main/tests/test-projects/nested-solutions-mdp/nested-solution2/console-project2/console-project2.mdp
M main/tests/test-projects/nested-solutions-mdp/nested-solution2/nested-solution3/library3/library3.mdp
M main/tests/test-projects/nested-solutions-mdp/nested-solution2/nested-solution3/library4/library4.mdp
M main/tests/test-projects/test-build-configs/Lib1/Lib1.mdp
M main/tests/test-projects/test-build-configs/Lib2/Lib2.mdp
M main/tests/test-projects/test-build-configs/Lib3/Lib3.mdp
M main/tests/test-projects/test-build-configs/Lib4/Lib4.mdp
M main/tests/test-projects/vs-local-copy/ClassLibrary1/ClassLibrary1.csproj
M main/tests/test-projects/vs-local-copy/ClassLibrary2/ClassLibrary2.csproj
M main/tests/test-projects/vs-local-copy/ClassLibrary3/ClassLibrary3.csproj
M main/tests/test-projects/vs-local-copy/ClassLibrary4/ClassLibrary4.csproj
M main/tests/test-projects/vs-local-copy/ClassLibrary5/ClassLibrary5.csproj
M main/tests/test-projects/vs-local-copy/VSLocalCopyTest/VSLocalCopyTest.csproj
Added paths:
A main/external/raygun4net
A main/src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.AspNet/AspNetAppProject.cs
A main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/MonoCSharpCompletionEngine.cs
A main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ProtocolCompletionData.cs
A main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/HoverCloseButton.cs
A main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/OverlayMessageWindow.cs
A main/src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor.Gui/XmlSchemasPanel.cs
A main/src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor/OpenStylesheetCommand.cs
A main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitSelectRevisionDialog.cs
A main/tests/test-projects/property-evaluation-test/property-evaluation-test.csproj
A main/tests/test-projects/property-evaluation-test/property-evaluation-test.sln
Removed paths:
D main/src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.AspNet/AspNetAppProject.cs
D main/src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor.Gui/XmlSchemasPanel.cs
D main/src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor/OpenStylesheetCommand.cs
D main/src/core/MonoDevelop.Core/MonoDevelop.Core.LogReporting/LogReportingService.cs
Modified: .gitmodules
===================================================================
@@ -37,3 +37,6 @@
[submodule "main/external/guiunit"]
path = main/external/guiunit
url = git://github.com/mono/guiunit.git
+[submodule "main/external/raygun4net"]
+ path = main/external/raygun4net
+ url = git://github.com/mono/raygun4net.git
Modified: main/Main.sln
===================================================================
@@ -237,6 +237,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.NRefactory.CSha
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GuiUnit_NET_4_0", "external\guiunit\src\framework\GuiUnit_NET_4_0.csproj", "{E13A0A7B-4DE6-43ED-A139-41052D065A9B}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mindscape.Raygun4Net", "external\raygun4net\Mindscape.Raygun4Net\Mindscape.Raygun4Net.csproj", "{495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}"
+EndProject
Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "po", "po\po.mdproj", "{AC7D119C-980B-4712-8811-5368C14412D7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{5D3F7E65-E55B-45CA-A83B-D1E10040281E}"
@@ -468,6 +470,14 @@ Global
{459868D2-54DC-415B-B1AB-BE39BDBD352F}.DebugWin32|Any CPU.ActiveCfg = Debug|Any CPU
{459868D2-54DC-415B-B1AB-BE39BDBD352F}.DebugWin32|Any CPU.Build.0 = Debug|Any CPU
{459868D2-54DC-415B-B1AB-BE39BDBD352F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU
+ {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.DebugMac|Any CPU.Build.0 = Debug|Any CPU
+ {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.DebugWin32|Any CPU.ActiveCfg = Debug|Any CPU
+ {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.DebugWin32|Any CPU.Build.0 = Debug|Any CPU
+ {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Release|Any CPU.Build.0 = Release|Any CPU
{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4CB170EF-DFE6-4A56-9E1B-A85449E827A7}.DebugMac|Any CPU.ActiveCfg = Debug|Any CPU
@@ -1059,6 +1069,7 @@ Global
{B8897B76-1A12-4DFA-8B60-7944CC4C9654} = {F12939F1-D55A-4CE9-9F33-8D959BFC7D6C}
{2D711139-8765-4929-BC7A-AA2DEE6F615D} = {F12939F1-D55A-4CE9-9F33-8D959BFC7D6C}
{E13A0A7B-4DE6-43ED-A139-41052D065A9B} = {F12939F1-D55A-4CE9-9F33-8D959BFC7D6C}
+ {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9} = {F12939F1-D55A-4CE9-9F33-8D959BFC7D6C}
{92494904-35FA-4DC9-BDE9-3A3E87AC49D3} = {67A32B53-F719-4ECB-B5E1-FD0B04FEE258}
{C3887A93-B2BD-4097-8E2F-3A063EFF32FD} = {67A32B53-F719-4ECB-B5E1-FD0B04FEE258}
{B7C1673E-5124-4BE5-8D21-EC8B12F85B6B} = {67A32B53-F719-4ECB-B5E1-FD0B04FEE258}
Modified: main/external/debugger-libs
===================================================================
@@ -1 +1 @@
-Subproject commit ff905103422ff3b0af304ff9ed911593fb621004
+Subproject commit 8c6cdc6a77abaf1a6ee75498c62c46474794a2b7
Modified: main/external/guiunit
===================================================================
@@ -1 +1 @@
-Subproject commit 1895e4bbff9cef63b3667ac73da3fdf58f79e46f
+Subproject commit aaf2b9650baad6c5c9f06f5f431958803f386135
Modified: main/external/nrefactory
===================================================================
@@ -1 +1 @@
-Subproject commit 3d405cd949c96527bffebcc47609276b31b68ffa
+Subproject commit 37f7f49e89db32b4fa5eab0a6a7bdea54154e313
Added: main/external/raygun4net
===================================================================
@@ -0,0 +1 @@
+Subproject commit f22449a80d87f34b1f1469171391b27bd627017d
Modified: main/external/xwt
===================================================================
@@ -1 +1 @@
-Subproject commit 353682c3935a1fd7857ebc93c509fa4cad17c59c
+Subproject commit c7c2e8c232b1213513fe67e38da33a433e495634
Modified: main/src/addins/AspNet/MonoDevelop.AspNet.Mvc/RazorEditorParserFixed/BackgroundParser.cs
===================================================================
@@ -437,8 +437,7 @@ private void WorkerLoop()
}
catch (Exception ex)
{
- MonoDevelop.Core.LoggingService.LogError ("Internal error in Razor parser", ex);
- MonoDevelop.Core.LogReporting.LogReportingService.ReportUnhandledException (ex, false);
+ MonoDevelop.Core.LoggingService.LogInternalError ("Internal error in Razor parser", ex);
}
finally
{
Added: main/src/addins/AspNet/MonoDevelop.AspNet/MonoDevelop.AspNet/AspNetAppProject.cs
===================================================================
Modified: main/src/addins/CSharpBinding/CSharpBinding.addin.xml
===================================================================
@@ -231,7 +231,8 @@
<Class class = "MonoDevelop.CodeGeneration.ReadonlyPropertyGenerator" />
<Class class = "MonoDevelop.CodeGeneration.PropertyGenerator" />
<Class class = "MonoDevelop.CodeGeneration.ImplementInterfaceMembersGenerator" />
- <Class class = "MonoDevelop.CodeGeneration.ExportCodeGenerator" />
+ <Class class = "MonoDevelop.CodeGeneration.RequiredProtocolMemberGenerator" />
+ <Class class = "MonoDevelop.CodeGeneration.OptionalProtocolMemberGenerator" />
<Class class = "MonoDevelop.CodeGeneration.PartialGenerator" />
<Class class = "MonoDevelop.CodeGeneration.OverrideMembersGenerator" />
<Class class = "MonoDevelop.CodeGeneration.ToStringGenerator" />
Modified: main/src/addins/CSharpBinding/CSharpBinding.csproj
===================================================================
@@ -22,8 +22,8 @@
<Execution clr-version="Net_2_0" />
</Execution>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
- <GenerateDocumentation>true</GenerateDocumentation>
<NoWarn>1591;1573</NoWarn>
+ <DocumentationFile>..\..\..\build\AddIns\BackendBindings\MonoDevelop.CSharpBinding.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -37,8 +37,8 @@
</Execution>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<DebugSymbols>true</DebugSymbols>
- <GenerateDocumentation>true</GenerateDocumentation>
<NoWarn>1591;1573</NoWarn>
+ <DocumentationFile>..\..\..\build\AddIns\BackendBindings\MonoDevelop.CSharpBinding.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\core\MonoDevelop.Core\MonoDevelop.Core.csproj">
@@ -315,6 +315,8 @@
<Compile Include="MonoDevelop.CSharp.Refactoring.CodeIssues\Issues\MonoTODOIssue.cs" />
<Compile Include="MonoDevelop.CSharp.Refactoring\CSharpCodeGenerationService.cs" />
<Compile Include="MonoDevelop.CSharp.CodeGeneration\ExportCodeGenerator.cs" />
+ <Compile Include="MonoDevelop.CSharp.Completion\MonoCSharpCompletionEngine.cs" />
+ <Compile Include="MonoDevelop.CSharp.Completion\ProtocolCompletionData.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Makefile.am" />
Modified: main/src/addins/CSharpBinding/MonoDevelop.CSharp.CodeGeneration/ExportCodeGenerator.cs
===================================================================
@@ -28,26 +28,27 @@
using ICSharpCode.NRefactory.CSharp;
using MonoDevelop.Core;
using ICSharpCode.NRefactory.TypeSystem;
-using System;
using System.Linq;
using ICSharpCode.NRefactory.CSharp.Refactoring;
using MonoDevelop.CSharp.Refactoring.CodeActions;
+using MonoDevelop.CodeGeneration;
namespace MonoDevelop.CodeGeneration
{
- class ExportCodeGenerator : ICodeGenerator
+ abstract class BaseExportCodeGenerator : ICodeGenerator
{
+ public abstract bool IsValidMember (IMember member);
#region ICodeGenerator implementation
bool ICodeGenerator.IsValid (CodeGenerationOptions options)
{
- return new ExportMethods (options).IsValid ();
+ return new ExportMethods (this, options).IsValid ();
}
IGenerateAction ICodeGenerator.InitalizeSelection (CodeGenerationOptions options, TreeView treeView)
{
- var exportMethods = new ExportMethods (options);
+ var exportMethods = new ExportMethods (this, options);
exportMethods.Initialize (treeView);
return exportMethods;
}
@@ -58,49 +59,140 @@ IGenerateAction ICodeGenerator.InitalizeSelection (CodeGenerationOptions options
}
}
- string ICodeGenerator.Text {
- get {
- return GettextCatalog.GetString ("Implement protocol methods");
+ public abstract string Text {
+ get;
+ }
+
+ public abstract string GenerateDescription {
+ get;
+ }
+
+ #endregion
+
+ public static bool HasProtocolAttribute (IType type, out string name)
+ {
+ foreach (var attrs in type.GetDefinition ().GetAttributes ()) {
+ if (attrs.AttributeType.Name == "ProtocolAttribute" && attrs.AttributeType.Namespace == "MonoTouch.Foundation") {
+ foreach (var na in attrs.NamedArguments) {
+ if (na.Key.Name != "Name")
+ continue;
+ name = na.Value.ConstantValue as string;
+ if (name != null)
+ return true;
+ }
+ }
}
+ name = null;
+ return false;
}
- string ICodeGenerator.GenerateDescription {
- get {
- return GettextCatalog.GetString ("Select methods to implement");
+ public static Attribute GenerateExportAttribute (RefactoringContext ctx, IMember member)
+ {
+ if (member == null)
+ return null;
+ var astType = ctx.CreateShortType ("MonoTouch.Foundation", "ExportAttribute");
+ if (astType is SimpleType) {
+ astType = new SimpleType ("Export");
+ } else {
+ astType = new MemberType (new MemberType (new SimpleType ("MonoTouch"), "Foundation"), "Export");
}
+
+ var attr = new Attribute {
+ Type = astType,
+ };
+ var exportAttribute = member.GetAttribute (new FullTypeName (new TopLevelTypeName ("MonoTouch.Foundation", "ExportAttribute")));
+ if (exportAttribute == null || exportAttribute.PositionalArguments.Count == 0)
+ return null;
+ attr.Arguments.Add (new PrimitiveExpression (exportAttribute.PositionalArguments [0].ConstantValue));
+ return attr;
+
}
- #endregion
+ static IMember GetProtocolMember (RefactoringContext ctx, IType protocolType, IMember member)
+ {
+ foreach (var m in protocolType.GetMembers (m => m.SymbolKind == member.SymbolKind && m.Name == member.Name)) {
+ if (!SignatureComparer.Ordinal.Equals (m, member))
+ return null;
+ var prop = m as IProperty;
+ if (prop != null) {
+ if (prop.CanGet && GenerateExportAttribute (ctx, prop.Getter) != null ||
+ prop.CanSet && GenerateExportAttribute (ctx, prop.Setter) != null)
+ return m;
+ } else {
+ if (GenerateExportAttribute (ctx, m) != null)
+ return m;
+ }
+ }
+ return null;
+ }
+
+ static string GetProtocol (IMember member)
+ {
+ var attr = member.Attributes.FirstOrDefault (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation");
+ if (attr == null || attr.PositionalArguments.Count == 0)
+ return null;
+ return attr.PositionalArguments.First ().ConstantValue.ToString ();
+ }
+
+ public static bool IsImplemented (IType type, IMember protocolMember)
+ {
+ foreach (var m in type.GetMembers (m => m.SymbolKind == protocolMember.SymbolKind && m.Name == protocolMember.Name)) {
+ var p = m as IProperty;
+ if (p != null) {
+ if (p.CanGet && ((IProperty)protocolMember).CanGet && GetProtocol (p.Getter) == GetProtocol (((IProperty)protocolMember).Getter))
+ return true;
+ if (p.CanSet && ((IProperty)protocolMember).CanSet && GetProtocol (p.Setter) == GetProtocol (((IProperty)protocolMember).Setter))
+ return true;
+ continue;
+ }
+ if (GetProtocol (m) == GetProtocol (protocolMember))
+ return true;
+ }
+ return false;
+ }
class ExportMethods : AbstractGenerateAction
{
- public ExportMethods (CodeGenerationOptions options) : base (options)
+ readonly BaseExportCodeGenerator cg;
+
+ public ExportMethods (BaseExportCodeGenerator cg, CodeGenerationOptions options) : base (options)
{
+ this.cg = cg;
}
+
protected override IEnumerable<object> GetValidMembers ()
{
var type = Options.EnclosingType;
if (type == null || Options.EnclosingMember != null)
yield break;
foreach (var t in type.DirectBaseTypes) {
- foreach (var attrs in t.GetDefinition ().GetAttributes ()) {
- if (attrs.AttributeType.Name != "ProtocolAttribute" || attrs.AttributeType.Namespace != "MonoTouch.Foundation")
+ string name;
+ if (!HasProtocolAttribute (t, out name))
+ continue;
+ var protocolType = Options.Document.Compilation.FindType (new FullTypeName (new TopLevelTypeName (t.Namespace, name)));
+ if (protocolType == null)
+ break;
+ foreach (var member in protocolType.GetMethods (null, GetMemberOptions.IgnoreInheritedMembers)) {
+ if (member.ImplementedInterfaceMembers.Any ())
+ continue;
+ if (!cg.IsValidMember (member))
+ continue;
+ if (IsImplemented (type, member))
+ continue;
+ if (member.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation"))
+ yield return member;
+ }
+ foreach (var member in protocolType.GetProperties (null, GetMemberOptions.IgnoreInheritedMembers)) {
+ if (member.ImplementedInterfaceMembers.Any ())
+ continue;
+ if (!cg.IsValidMember (member))
+ continue;
+ if (IsImplemented (type, member))
continue;
- foreach (var na in attrs.NamedArguments) {
- if (na.Key.Name != "Name")
- continue;
- string name = na.Value.ConstantValue as string;
- if (name == null)
- break;
- var protocolType = Options.Document.Compilation.FindType (new FullTypeName (new TopLevelTypeName (t.Namespace, name)));
- if (protocolType == null)
- break;
- foreach (var member in protocolType.GetMembers ()) {
- if (member.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation"))
- yield return member;
- }
- }
+ if (member.CanGet && member.Getter.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation") ||
+ member.CanSet && member.Setter.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation"))
+ yield return member;
}
}
}
@@ -115,30 +207,96 @@ protected override IEnumerable<string> GenerateCode (List<object> includedMember
var builder = ctx.CreateTypeSystemAstBuilder ();
foreach (IMember member in includedMembers) {
- var method = builder.ConvertEntity (member) as MethodDeclaration;
- method.Body = new BlockStatement () {
- new ThrowStatement (new ObjectCreateExpression (ctx.CreateShortType ("System", "NotImplementedException")))
- };
- var astType = ctx.CreateShortType ("MonoTouch.Foundation", "ExportAttribute");
- if (astType is SimpleType) {
- astType = new SimpleType ("Export");
- } else {
- astType = new MemberType (new MemberType (new SimpleType ("MonoTouch"), "Foundation"), "Export");
+ yield return GenerateMemberCode (ctx, builder, member);
+ }
+ }
+ }
+
+ internal static string GenerateMemberCode (MDRefactoringContext ctx, TypeSystemAstBuilder builder, IMember member)
+ {
+ var method = builder.ConvertEntity (member) as MethodDeclaration;
+ if (method != null) {
+ method.Body = new BlockStatement {
+ new ThrowStatement (new ObjectCreateExpression (ctx.CreateShortType ("System", "NotImplementedException")))
+ };
+ method.Modifiers &= ~Modifiers.Virtual;
+ method.Modifiers &= ~Modifiers.Abstract;
+ method.Attributes.Add (new AttributeSection {
+ Attributes = {
+ GenerateExportAttribute (ctx, member)
}
+ });
+ return method.ToString (ctx.FormattingOptions);
+ }
+ var property = builder.ConvertEntity (member) as PropertyDeclaration;
+ if (property == null)
+ return null;
+ var p = (IProperty)member;
+ property.Modifiers &= ~Modifiers.Virtual;
+ property.Modifiers &= ~Modifiers.Abstract;
+ if (p.CanGet) {
+ property.Getter.Body = new BlockStatement {
+ new ThrowStatement (new ObjectCreateExpression (ctx.CreateShortType ("System", "NotImplementedException")))
+ };
+ property.Getter.Attributes.Add (new AttributeSection {
+ Attributes = {
+ GenerateExportAttribute (ctx, p.Getter)
+ }
+ });
+ }
+ if (p.CanSet) {
+ property.Setter.Body = new BlockStatement {
+ new ThrowStatement (new ObjectCreateExpression (ctx.CreateShortType ("System", "NotImplementedException")))
+ };
+ property.Setter.Attributes.Add (new AttributeSection {
+ Attributes = {
+ GenerateExportAttribute (ctx, p.Setter)
+ }
+ });
+ }
+ return property.ToString (ctx.FormattingOptions);
+ }
+ }
- var attr = new ICSharpCode.NRefactory.CSharp.Attribute {
- Type = astType,
- };
- method.Modifiers &= ~Modifiers.Virtual;
- var exportAttribute = member.GetAttribute (new FullTypeName (new TopLevelTypeName ("MonoTouch.Foundation", "ExportAttribute")));
- attr.Arguments.Add (new PrimitiveExpression (exportAttribute.PositionalArguments.First ().ConstantValue));
- method.Attributes.Add (new AttributeSection {
- Attributes = { attr }
- });
- yield return method.ToString ();
- }
+ class OptionalProtocolMemberGenerator : BaseExportCodeGenerator
+ {
+ public override string Text {
+ get {
+ return GettextCatalog.GetString ("Implement protocol members");
+ }
+ }
+
+ public override string GenerateDescription {
+ get {
+ return GettextCatalog.GetString ("Select protocol members to implement");
}
}
+
+ public override bool IsValidMember (IMember member)
+ {
+ return !member.IsAbstract;
+ }
}
+
+ class RequiredProtocolMemberGenerator : BaseExportCodeGenerator
+ {
+ public override string Text {
+ get {
+ return GettextCatalog.GetString ("Implement required protocol members");
+ }
+ }
+
+ public override string GenerateDescription {
+ get {
+ return GettextCatalog.GetString ("Select protocol members to implement");
+ }
+ }
+
+ public override bool IsValidMember (IMember member)
+ {
+ return member.IsAbstract;
+ }
+ }
+
}
Modified: main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpCompletionTextEditorExtension.cs
===================================================================
@@ -209,7 +209,7 @@ void HandleDocumentParsed (object sender, EventArgs e)
unstableTypeSystemSegmentTree = newTree;
}
newTree.InstallListener (document.Editor.Document);
-
+
this.Unit = newDocument.GetAst<SyntaxTree> ();
this.CSharpUnresolvedFile = newDocument.ParsedFile as CSharpUnresolvedFile;
this.UnresolvedFileCompilation = Document.Compilation;
@@ -284,6 +284,8 @@ ICompletionContextProvider CreateContextProvider ()
CSharpTypeResolveContext CreateTypeResolveContext ()
{
var compilation = UnresolvedFileCompilation;
+ if (compilation == null)
+ return null;
var rctx = new CSharpTypeResolveContext (compilation.MainAssembly);
var loc = TextEditorData.Caret.Location;
rctx = rctx.WithUsingScope (CSharpUnresolvedFile.GetUsingScope (loc).Resolve (compilation));
@@ -304,7 +306,7 @@ CSharpTypeResolveContext CreateTypeResolveContext ()
return rctx;
}
-
+ CompletionEngineCache cache = new CompletionEngineCache ();
ICompletionDataList InternalHandleCodeCompletion (CodeCompletionContext completionContext, char completionChar, bool ctrlSpace, ref int triggerWordLength)
{
var data = TextEditorData;
@@ -320,9 +322,11 @@ ICompletionDataList InternalHandleCodeCompletion (CodeCompletionContext completi
var list = new CSharpCompletionDataList ();
list.Resolver = CSharpUnresolvedFile != null ? CSharpUnresolvedFile.GetResolver (UnresolvedFileCompilation, Document.Editor.Caret.Location) : new CSharpResolver (Compilation);
var ctx = CreateTypeResolveContext ();
-
+ if (ctx == null)
+ return null;
var completionDataFactory = new CompletionDataFactory (this, new CSharpResolver (ctx));
- var engine = new CSharpCompletionEngine (
+ var engine = new MonoCSharpCompletionEngine (
+ this,
data.Document,
CreateContextProvider (),
completionDataFactory,
@@ -332,6 +336,7 @@ ICompletionDataList InternalHandleCodeCompletion (CodeCompletionContext completi
completionDataFactory.Engine = engine;
engine.AutomaticallyAddImports = AddImportedItemsToCompletionList.Value;
engine.IncludeKeywordsInCompletionList = EnableAutoCodeCompletion || IncludeKeywordsInCompletionList.Value;
+ engine.CompletionEngineCache = cache;
if (FilterCompletionListByEditorBrowsable) {
engine.EditorBrowsableBehavior = IncludeEditorBrowsableAdvancedMembers ? EditorBrowsableBehavior.IncludeAdvanced : EditorBrowsableBehavior.Normal;
} else {
@@ -391,12 +396,15 @@ static bool HasAllUsedParameters (IParameterDataProvider provider, List<string>
}
public override int GuessBestMethodOverload (IParameterDataProvider provider, int currentOverload)
{
+ var ctx = CreateTypeResolveContext ();
+ if (ctx == null)
+ return -1;
var engine = new CSharpParameterCompletionEngine (
TextEditorData.Document,
CreateContextProvider (),
this,
Document.GetProjectContext (),
- CreateTypeResolveContext ()
+ ctx
);
List<string> list;
int cparam = engine.GetCurrentParameterIndex (provider.StartOffset, document.Editor.Caret.Offset, out list);
@@ -549,13 +557,17 @@ public override ParameterDataProvider HandleParameterCompletion (CodeCompletionC
// return null;
if (Unit == null || CSharpUnresolvedFile == null)
return null;
+ var ctx = CreateTypeResolveContext ();
+ if (ctx == null)
+ return null;
+
try {
var engine = new CSharpParameterCompletionEngine (
TextEditorData.Document,
CreateContextProvider (),
this,
Document.GetProjectContext (),
- CreateTypeResolveContext ()
+ ctx
);
return engine.GetParameterDataProvider (completionContext.TriggerOffset, completionChar) as ParameterDataProvider;
} catch (Exception e) {
@@ -591,12 +603,18 @@ List<string> GetUsedNamespaces ()
public override bool GetParameterCompletionCommandOffset (out int cpos)
{
+ var ctx = CreateTypeResolveContext ();
+ if (ctx == null) {
+ cpos = -1;
+ return false;
+ }
+
var engine = new CSharpParameterCompletionEngine (
TextEditorData.Document,
CreateContextProvider (),
this,
Document.GetProjectContext (),
- CreateTypeResolveContext ()
+ ctx
);
engine.SetOffset (document.Editor.Caret.Offset);
return engine.GetParameterCompletionCommandOffset (out cpos);
@@ -604,13 +622,17 @@ public override bool GetParameterCompletionCommandOffset (out int cpos)
public override int GetCurrentParameterIndex (int startOffset)
{
+ var ctx = CreateTypeResolveContext ();
+ if (ctx == null)
+ return -1;
+
var engine = new CSharpParameterCompletionEngine (
TextEditorData.Document,
CreateContextProvider (),
this,
Document.GetProjectContext (),
- CreateTypeResolveContext ()
- );
+ ctx
+ );
List<string> list;
return engine.GetCurrentParameterIndex (startOffset, document.Editor.Caret.Offset, out list);
}
@@ -1075,25 +1097,25 @@ ICompletionData ICompletionDataFactory.CreateFormatItemCompletionData(string for
}
- class ImportSymbolCompletionData : CompletionData
+ class ImportSymbolCompletionData : CompletionData, IEntityCompletionData
{
- IType type;
-// ParsedDocument unit;
- MonoDevelop.Ide.Gui.Document doc;
- bool useFullName;
-// bool addConstructors;
-
+ readonly IType type;
+ readonly bool useFullName;
+ readonly CSharpCompletionTextEditorExtension ext;
public IType Type {
get { return this.type; }
}
- public ImportSymbolCompletionData (MonoDevelop.Ide.Gui.Document doc, bool useFullName, IType type, bool addConstructors)
+ public ImportSymbolCompletionData (CSharpCompletionTextEditorExtension ext, bool useFullName, IType type, bool addConstructors)
{
- this.doc = doc;
+ this.ext = ext;
this.useFullName = useFullName;
this.type = type;
-// this.unit = doc.ParsedDocument;
-// this.addConstructors = addConstructors;
+ }
+
+ public override TooltipInformation CreateTooltipInformation (bool smartWrap)
+ {
+ return MemberCompletionData.CreateTooltipInformation (ext, null, type.GetDefinition (), smartWrap);
}
bool initialized = false;
@@ -1114,6 +1136,7 @@ void Initialize ()
public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier)
{
Initialize ();
+ var doc = ext.document;
using (var undo = doc.Editor.OpenUndoGroup ()) {
string text = insertNamespace ? type.Namespace + "." + type.Name : type.Name;
if (text != GetCurrentWord (window)) {
@@ -1173,7 +1196,7 @@ public override string GetDisplayDescription (bool isSelected)
get {
Initialize ();
if (generateUsing)
- return string.Format (GettextCatalog.GetString ("Add namespace import '{0}'"), type.Namespace);
+ return type.Namespace;
return null;
}
}
@@ -1198,12 +1221,46 @@ public override int CompareTo (object obj)
}
return result;
}
+
+ List<CompletionData> overloads;
+
+ public override IEnumerable<ICompletionData> OverloadedData {
+ get {
+ yield return this;
+ if (overloads == null)
+ yield break;
+ foreach (var overload in overloads)
+ yield return overload;
+ }
+ }
+
+ public override bool HasOverloads {
+ get { return overloads != null && overloads.Count > 0; }
+ }
+
+ public override void AddOverload (ICSharpCode.NRefactory.Completion.ICompletionData data)
+ {
+ AddOverload ((ImportSymbolCompletionData)data);
+ }
+
+ void AddOverload (ImportSymbolCompletionData overload)
+ {
+ if (overloads == null)
+ overloads = new List<CompletionData> ();
+ overloads.Add (overload);
+ }
+
+ IEntity IEntityCompletionData.Entity {
+ get {
+ return type.GetDefinition ();
+ }
+ }
}
ICompletionData ICompletionDataFactory.CreateImportCompletionData(IType type, bool useFullName, bool addConstructors)
{
- return new ImportSymbolCompletionData (ext.Document, useFullName, type, addConstructors);
+ return new ImportSymbolCompletionData (ext, useFullName, type, addConstructors);
}
}
Added: main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/MonoCSharpCompletionEngine.cs
===================================================================
@@ -0,0 +1,102 @@
+//
+// MonoCSharpCompletionEngine.cs
+//
+// Author:
+// Mike Krüger <[email protected]>
+//
+// Copyright (c) 2013 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 ICSharpCode.NRefactory.CSharp.Completion;
+using System.Collections.Generic;
+using MonoDevelop.CodeGeneration;
+using ICSharpCode.NRefactory.TypeSystem;
+using System.Linq;
+using MonoDevelop.CSharp.Refactoring.CodeActions;
+using ICSharpCode.NRefactory.Editor;
+
+namespace MonoDevelop.CSharp.Completion
+{
+ class MonoCSharpCompletionEngine : CSharpCompletionEngine
+ {
+ readonly CSharpCompletionTextEditorExtension ext;
+ readonly MDRefactoringContext mdRefactoringCtx;
+
+ public CSharpCompletionTextEditorExtension Ext {
+ get {
+ return ext;
+ }
+ }
+
+ public MDRefactoringContext MDRefactoringCtx {
+ get {
+ return mdRefactoringCtx;
+ }
+ }
+
+ public MonoCSharpCompletionEngine (CSharpCompletionTextEditorExtension ext, ICSharpCode.NRefactory.Editor.IDocument document, ICompletionContextProvider completionContextProvider, ICompletionDataFactory factory, ICSharpCode.NRefactory.TypeSystem.IProjectContent content, ICSharpCode.NRefactory.CSharp.TypeSystem.CSharpTypeResolveContext ctx) : base (document, completionContextProvider, factory, content, ctx)
+ {
+ this.ext = ext;
+ this.mdRefactoringCtx = MDRefactoringContext.Create (ext.Document, ext.Document.Editor.Caret.Location);
+
+ }
+
+ protected override void AddVirtuals (List<IMember> alreadyInserted, CompletionDataWrapper col, string modifiers, IType curType, int declarationBegin)
+ {
+ base.AddVirtuals (alreadyInserted, col, modifiers, curType, declarationBegin);
+ foreach (var member in GetProtocolMembers (curType)) {
+ if (alreadyInserted.Contains (member))
+ continue;
+ if (BaseExportCodeGenerator.IsImplemented (curType, member))
+ continue;
+ alreadyInserted.Add (member);
+ var data = new ProtocolCompletionData (this, declarationBegin, member);
+ col.Add (data);
+ }
+ }
+
+ IEnumerable<IMember> GetProtocolMembers (IType curType)
+ {
+ foreach (var t in curType.DirectBaseTypes) {
+ string name;
+ if (!BaseExportCodeGenerator.HasProtocolAttribute (t, out name))
+ continue;
+ var protocolType = Compilation.FindType (new FullTypeName (new TopLevelTypeName (t.Namespace, name)));
+ if (protocolType == null)
+ break;
+ foreach (var member in protocolType.GetMethods (null, GetMemberOptions.IgnoreInheritedMembers)) {
+ if (member.ImplementedInterfaceMembers.Any () || member.IsAbstract || !member.IsVirtual)
+ continue;
+ if (member.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation")) {
+ yield return member;
+ }
+ }
+ foreach (var member in protocolType.GetProperties (null, GetMemberOptions.IgnoreInheritedMembers)) {
+ if (member.ImplementedInterfaceMembers.Any () || member.IsAbstract || !member.IsVirtual)
+ continue;
+ if (member.CanGet && member.Getter.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation") ||
+ member.CanSet && member.Setter.Attributes.Any (a => a.AttributeType.Name == "ExportAttribute" && a.AttributeType.Namespace == "MonoTouch.Foundation"))
+ yield return member;
+ }
+ }
+ }
+ }
+}
+
Added: main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/ProtocolCompletionData.cs
===================================================================
@@ -0,0 +1,88 @@
+//
+// ProtocolCompletionData.cs
+//
+// Author:
+// Mike Krüger <[email protected]>
+//
+// Copyright (c) 2013 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 ICSharpCode.NRefactory.TypeSystem;
+using MonoDevelop.Ide.CodeCompletion;
+using MonoDevelop.Ide.TypeSystem;
+using MonoDevelop.CodeGeneration;
+
+namespace MonoDevelop.CSharp.Completion
+{
+ class ProtocolCompletionData : CompletionData
+ {
+ readonly MonoCSharpCompletionEngine engine;
+ readonly IMember member;
+ readonly static Ambience ambience = new CSharpAmbience ();
+ readonly int declarationBegin;
+
+ public bool GenerateBody { get; set; }
+
+ public override TooltipInformation CreateTooltipInformation (bool smartWrap)
+ {
+ return MemberCompletionData.CreateTooltipInformation (engine.Ext, null, member, smartWrap);
+ }
+
+ public ProtocolCompletionData (MonoCSharpCompletionEngine engine, int declarationBegin, IMember member) : base (null)
+ {
+ this.engine = engine;
+ this.member = member;
+
+ this.declarationBegin = declarationBegin;
+ this.GenerateBody = true;
+ this.Icon = member.GetStockIcon ();
+ this.DisplayText = ambience.GetString (member, OutputFlags.IncludeParameters | OutputFlags.IncludeParameterName | OutputFlags.IncludeGenerics | OutputFlags.HideExtensionsParameter| OutputFlags.IncludeAccessor);
+ this.CompletionText = member.SymbolKind == SymbolKind.Indexer ? "this" : member.Name;
+ }
+
+ public override void InsertCompletionText (CompletionListWindow window, ref KeyActions ka, Gdk.Key closeChar, char keyChar, Gdk.ModifierType modifier)
+ {
+ var ext = engine.Ext;
+ var editor = ext.TextEditorData;
+ var generator = CodeGenerator.CreateGenerator (ext.Document);
+ if (ext.Project != null)
+ generator.PolicyParent = ext.Project.Policies;
+ var builder = engine.MDRefactoringCtx.CreateTypeSystemAstBuilder ();
+
+ string sb = BaseExportCodeGenerator.GenerateMemberCode (engine.MDRefactoringCtx, builder, member);
+ sb = sb.TrimEnd ();
+
+ string indent = editor.GetIndentationString (editor.Caret.Location);
+ sb = sb.Replace (editor.EolMarker, editor.EolMarker + indent);
+
+ int targetCaretPosition = sb.LastIndexOf ("throw", StringComparison.Ordinal);
+ int selectionEndPosition = sb.LastIndexOf (";", StringComparison.Ordinal);
+
+ editor.Replace (declarationBegin, editor.Caret.Offset - declarationBegin, sb);
+ if (selectionEndPosition > 0) {
+ targetCaretPosition += declarationBegin;
+ selectionEndPosition += declarationBegin;
+ editor.Caret.Offset = selectionEndPosition;
+ editor.SetSelection (targetCaretPosition, selectionEndPosition);
+ }
+ }
+ }
+}
+
Modified: main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/OnTheFlyFormatter.cs
===================================================================
@@ -112,7 +112,7 @@ static string BuildStub (MonoDevelop.Ide.Gui.Document data, CSharpCompletionText
}
memberStartOffset = sb.Length;
- var text = data.Editor.GetTextBetween (seg.Offset, endOffset);
+ var text = data.Editor.GetTextBetween (Math.Max (0, seg.Offset), endOffset);
sb.Append (text);
var lex = new CSharpCompletionEngineBase.MiniLexer (text);
Modified: main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringContext.cs
===================================================================
@@ -173,6 +173,12 @@ internal void SetLocation (TextLocation loc)
readonly CSharpFormattingOptions formattingOptions;
+ public CSharpFormattingOptions FormattingOptions {
+ get {
+ return formattingOptions;
+ }
+ }
+
public Script StartScript ()
{
return new MDRefactoringScript (this, formattingOptions);
Modified: main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringScript.cs
===================================================================
@@ -352,14 +352,19 @@ public override void CreateNewType (AstNode newType, NewTypeContext ntctx = NewT
insertLocation = content.Length;
content = content.Substring (0, insertLocation) + newType.ToString (FormattingOptions) + content.Substring (insertLocation);
- var policy = context.Project.Policies.Get<CSharpFormattingPolicy> ();
- var textPolicy = context.Project.Policies.Get<TextStylePolicy> ();
-
- content = MonoDevelop.CSharp.Formatting.CSharpFormatter.FormatText (policy, textPolicy, MonoDevelop.CSharp.Formatting.CSharpFormatter.MimeType, content, 0, content.Length);
+ var project = context.Project;
+ if (project != null) {
+ var policy = project.Policies.Get<CSharpFormattingPolicy> ();
+ var textPolicy = project.Policies.Get<TextStylePolicy> ();
+ content = MonoDevelop.CSharp.Formatting.CSharpFormatter.FormatText (policy, textPolicy, MonoDevelop.CSharp.Formatting.CSharpFormatter.MimeType, content, 0, content.Length);
+ }
File.WriteAllText (correctFileName, content);
- context.Project.AddFile (correctFileName);
- IdeApp.ProjectOperations.Save (context.Project);
+
+ if (project != null) {
+ project.AddFile (correctFileName);
+ IdeApp.ProjectOperations.Save (project);
+ }
IdeApp.Workbench.OpenDocument (correctFileName);
}
Modified: main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring/CSharpCodeGenerationService.cs
===================================================================
@@ -28,6 +28,8 @@
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.NRefactory.CSharp.Refactoring;
using System.Linq;
+using Atk;
+using Gdk;
namespace MonoDevelop.CSharp.Refactoring
{
@@ -58,4 +60,3 @@ public override EntityDeclaration GenerateMemberImplementation (RefactoringConte
}
}
}
-
Modified: main/src/addins/CSharpBinding/md1format.xml
===================================================================
@@ -8,7 +8,6 @@
<ItemProperty member="generateOverflowChecks" name="generateoverflowchecks"/>
<ItemProperty member="mainclass" name="mainclass" defaultValue=""/>
<ItemProperty member="definesymbols" name="definesymbols" defaultValue="" />
- <ItemProperty member="generateXmlDocumentation" name="generatexmldocumentation"/>
<ItemProperty member="win32Icon" name="win32Icon" defaultValue="" serializationDataType="MonoDevelop.Projects.PathDataType"/>
<ItemProperty member="win32Resource" name="win32Resource" defaultValue="" />
<ItemProperty member="codePage" name="codepage" defaultValue="0"/>
Modified: main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/SoftDebuggerEngine.cs
===================================================================
@@ -140,7 +140,7 @@ class MDLogger : ICustomLogger
{
public void LogError (string message, Exception ex)
{
- MonoDevelop.Core.LoggingService.LogError (message, ex);
+ LoggingService.LogError (message, ex);
}
public void LogAndShowException (string message, Exception ex)
@@ -151,7 +151,7 @@ public void LogAndShowException (string message, Exception ex)
public void LogMessage (string messageFormat, params object[] args)
{
- MonoDevelop.Core.LoggingService.LogInfo (messageFormat, args);
+ LoggingService.LogInfo (messageFormat, args);
}
}
}
Modified: main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultMarker.cs
===================================================================
@@ -100,12 +100,21 @@ public override void Draw (TextEditor editor, Cairo.Context cr, Pango.Layout lay
double drawTo;
if (markerStart < startOffset && endOffset < markerEnd) {
- drawFrom = startXPos;
drawTo = endXPos;
+ var line = editor.GetLineByOffset (startOffset);
+ int offset = line.GetIndentation (editor.Document).Length;
+ drawFrom = startXPos + (layout.IndexToPos (offset).X / Pango.Scale.PangoScale);
} else {
- int start = startOffset < markerStart ? markerStart : startOffset;
+ int start;
+ if (startOffset < markerStart) {
+ start = markerStart;
+ } else {
+ var line = editor.GetLineByOffset (startOffset);
+ int offset = line.GetIndentation (editor.Document).Length;
+ start = startOffset + offset;
+ }
int end = endOffset < markerEnd ? endOffset : markerEnd;
- int /*lineNr,*/ x_pos;
+ int x_pos;
x_pos = layout.IndexToPos (start - startOffset).X;
drawFrom = startXPos + (int)(x_pos / Pango.Scale.PangoScale);
Modified: main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/Gui/ResultsEditorExtension.cs
===================================================================
@@ -193,7 +193,8 @@ bool IdleHandler ()
if (currentResult.InspectionMark != IssueMarker.None) {
int start = editor.LocationToOffset (currentResult.Region.Begin);
int end = editor.LocationToOffset (currentResult.Region.End);
-
+ if (start >= end)
+ continue;
if (currentResult.InspectionMark == IssueMarker.GrayOut) {
var marker = new GrayOutMarker (currentResult, TextSegment.FromBounds (start, end));
marker.IsVisible = currentResult.Underline;
Modified: main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.addin.xml
===================================================================
@@ -128,9 +128,6 @@
<CommandItem id = "MonoDevelop.Refactoring.RefactoryCommands.CurrentRefactoryOperations" insertafter="MonoDevelop.SourceEditor.SourceEditorCommands.MarkerOperations" insertbefore="MonoDevelop.Debugger.DebugCommands.ExpressionEvaluator"/>
--
- <CommandItem id = "MonoDevelop.CodeGeneration.CodeGenerationCommands.ShowCodeGenerationWindow"
- insertafter="MonoDevelop.Ide.Commands.TextEditorCommands.ShowCodeTemplateWindow" />
</Extension>
<Extension path = "/MonoDevelop/Ide/TextEditorExtensions">
Modified: main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/ResolveCommandHandler.cs
===================================================================
@@ -346,7 +346,7 @@ static IEnumerable<PossibleNamespace> GetPossibleNamespaces (Document doc, AstNo
}
} catch (Exception e) {
if (!TypeSystemService.RecreateFrameworkLookup (netProject))
- LoggingService.LogError ("Error while looking up framework extension methods.", e);
+ LoggingService.LogError (string.Format ("Error while looking up extension method {0}", umResult.MemberName), e);
}
}
bool foundIdentifier = false;
@@ -373,14 +373,13 @@ static IEnumerable<PossibleNamespace> GetPossibleNamespaces (Document doc, AstNo
scope = scope.Parent;
}
}
-
var allTypes = compilation == doc.Compilation ? compilation.GetAllTypeDefinitions () : compilation.MainAssembly.GetAllTypeDefinitions ();
if (resolveResult is UnknownIdentifierResolveResult) {
var uiResult = resolveResult as UnknownIdentifierResolveResult;
string possibleAttributeName = isInsideAttributeType ? uiResult.Identifier + "Attribute" : uiResult.Identifier;
foreach (var typeDefinition in allTypes) {
- if ((typeDefinition.Name == possibleAttributeName || typeDefinition.Name == uiResult.Identifier) && typeDefinition.TypeParameterCount == tc &&
- lookup.IsAccessible (typeDefinition, false)) {
+ if ((typeDefinition.Name == possibleAttributeName || typeDefinition.Name == uiResult.Identifier) && typeDefinition.TypeParameterCount == tc &&
+ lookup.IsAccessible (typeDefinition, false)) {
if (typeDefinition.DeclaringTypeDefinition != null) {
var builder = new TypeSystemAstBuilder (new CSharpResolver (doc.Compilation));
foundIdentifier = true;
@@ -434,8 +433,9 @@ out inferredTypes
}
}
}
+
// Try to search framework types
- if (!foundIdentifier && frameworkLookup != null && resolveResult is UnknownIdentifierResolveResult) {
+ if (!foundIdentifier && frameworkLookup != null && resolveResult is UnknownIdentifierResolveResult && node is AstType) {
var uiResult = resolveResult as UnknownIdentifierResolveResult;
if (uiResult != null) {
var lookups = new List<Tuple<FrameworkLookup.AssemblyLookup, SystemAssembly>> ();
@@ -449,7 +449,7 @@ out inferredTypes
}
} catch (Exception e) {
if (!TypeSystemService.RecreateFrameworkLookup (netProject))
- LoggingService.LogError ("Error while looking up framework types.", e);
+ LoggingService.LogError (string.Format ("Error while looking up identifier {0}", uiResult.Identifier), e);
}
foreach(var kv in lookups)
yield return new PossibleNamespace (kv.Item1.Namespace, true, new MonoDevelop.Projects.ProjectReference (kv.Item2));
@@ -470,7 +470,7 @@ out inferredTypes
}
} catch (Exception e) {
if (!TypeSystemService.RecreateFrameworkLookup (netProject))
- LoggingService.LogError ("Error while looking up framework types.", e);
+ LoggingService.LogError (string.Format ("Error while looking up member resolve result {0}", node), e);
}
foreach(var kv in lookups)
yield return new PossibleNamespace (kv.Item1.Namespace, true, new MonoDevelop.Projects.ProjectReference (kv.Item2));
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/BehaviorPanel.cs
===================================================================
@@ -50,15 +50,17 @@ public BehaviorPanel ()
public virtual Gtk.Widget CreatePanelWidget ()
{
// this.autoInsertTemplateCheckbutton.Active = DefaultSourceEditorOptions.Options.AutoInsertTemplates;
- this.autoInsertBraceCheckbutton.Active = DefaultSourceEditorOptions.Instance.AutoInsertMatchingBracket;
- this.smartSemicolonPlaceCheckbutton.Active = DefaultSourceEditorOptions.Instance.SmartSemicolonPlacement;
-
- this.tabAsReindentCheckbutton.Active = DefaultSourceEditorOptions.Instance.TabIsReindent;
- this.indentationCombobox.Active = (int)DefaultSourceEditorOptions.Instance.IndentStyle;
- this.controlLeftRightCombobox.Active = (int)DefaultSourceEditorOptions.Instance.ControlLeftRightMode;
- this.useViModesCheck.Active = DefaultSourceEditorOptions.Instance.UseViModes;
- this.checkbuttonOnTheFlyFormatting.Active = DefaultSourceEditorOptions.Instance.OnTheFlyFormatting;
+ autoInsertBraceCheckbutton.Active = DefaultSourceEditorOptions.Instance.AutoInsertMatchingBracket;
+ smartSemicolonPlaceCheckbutton.Active = DefaultSourceEditorOptions.Instance.SmartSemicolonPlacement;
+ tabAsReindentCheckbutton.Active = DefaultSourceEditorOptions.Instance.TabIsReindent;
+ indentationCombobox.Active = (int)DefaultSourceEditorOptions.Instance.IndentStyle;
+ controlLeftRightCombobox.Active = (int)DefaultSourceEditorOptions.Instance.ControlLeftRightMode;
+ useViModesCheck.Active = DefaultSourceEditorOptions.Instance.UseViModes;
+ checkbuttonOnTheFlyFormatting.Active = DefaultSourceEditorOptions.Instance.OnTheFlyFormatting;
+ checkbuttonGenerateFormattingUndoStep.Active = DefaultSourceEditorOptions.Instance.GenerateFormattingUndoStep;
+
+
checkbuttonFormatOnSave.Active = PropertyService.Get ("AutoFormatDocumentOnSave", false);
checkbuttonAutoSetSearchPatternCasing.Active = PropertyService.Get ("AutoSetPatternCasing", false);
HandleAutoInsertBraceCheckbuttonToggled (null, null);
@@ -67,19 +69,20 @@ public virtual Gtk.Widget CreatePanelWidget ()
void HandleAutoInsertBraceCheckbuttonToggled (object sender, EventArgs e)
{
- this.smartSemicolonPlaceCheckbutton.Sensitive = this.autoInsertBraceCheckbutton.Active;
+ smartSemicolonPlaceCheckbutton.Sensitive = autoInsertBraceCheckbutton.Active;
}
public virtual void ApplyChanges ()
{
//DefaultSourceEditorOptions.Options.AutoInsertTemplates = this.autoInsertTemplateCheckbutton.Active;
- DefaultSourceEditorOptions.Instance.AutoInsertMatchingBracket = this.autoInsertBraceCheckbutton.Active;
- DefaultSourceEditorOptions.Instance.SmartSemicolonPlacement = this.smartSemicolonPlaceCheckbutton.Active;
- DefaultSourceEditorOptions.Instance.IndentStyle = (IndentStyle)this.indentationCombobox.Active;
- DefaultSourceEditorOptions.Instance.TabIsReindent = this.tabAsReindentCheckbutton.Active;
- DefaultSourceEditorOptions.Instance.ControlLeftRightMode = (ControlLeftRightMode)this.controlLeftRightCombobox.Active;
- DefaultSourceEditorOptions.Instance.UseViModes = this.useViModesCheck.Active;
- DefaultSourceEditorOptions.Instance.OnTheFlyFormatting = this.checkbuttonOnTheFlyFormatting.Active;
+ DefaultSourceEditorOptions.Instance.AutoInsertMatchingBracket = autoInsertBraceCheckbutton.Active;
+ DefaultSourceEditorOptions.Instance.SmartSemicolonPlacement = smartSemicolonPlaceCheckbutton.Active;
+ DefaultSourceEditorOptions.Instance.IndentStyle = (IndentStyle)indentationCombobox.Active;
+ DefaultSourceEditorOptions.Instance.TabIsReindent = tabAsReindentCheckbutton.Active;
+ DefaultSourceEditorOptions.Instance.ControlLeftRightMode = (ControlLeftRightMode)controlLeftRightCombobox.Active;
+ DefaultSourceEditorOptions.Instance.UseViModes = useViModesCheck.Active;
+ DefaultSourceEditorOptions.Instance.OnTheFlyFormatting = checkbuttonOnTheFlyFormatting.Active;
+ DefaultSourceEditorOptions.Instance.GenerateFormattingUndoStep = checkbuttonGenerateFormattingUndoStep.Active;
PropertyService.Set ("AutoSetPatternCasing", checkbuttonAutoSetSearchPatternCasing.Active);
PropertyService.Set ("AutoFormatDocumentOnSave", checkbuttonFormatOnSave.Active);
}
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.QuickTasks/QuickTaskOverviewMode.cs
===================================================================
@@ -399,7 +399,7 @@ protected void DrawSearchIndicator (Cairo.Context cr)
{
int diameter = Math.Min (Allocation.Width, (int)IndicatorHeight) - indicatorPadding * 2;
var x1 = Math.Round (Allocation.Width / 2d);
- double y1 = indicatorPadding;
+ double y1 = indicatorPadding + diameter / 2;
if (diameter % 2 == 0) {
x1 += 0.5;
y1 += 0.5;
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.addin.xml
===================================================================
@@ -1,6 +1,6 @@
<ExtensionModel>
- <!-- Extension points -->
+ <!-- Extension points -->
<ExtensionPoint path = "/MonoDevelop/SourceEditor2/ContextMenu/Editor" name = "Editor context menu">
<Description>Context menu for the editor.</Description>;
@@ -218,8 +218,9 @@
</Extension>
<Extension path = "/MonoDevelop/Ide/Fonts">
- <Font name ="MessageBubbles" _displayName="Message bubbles" default ="_DEFAULT_SANS" defaultMac = "Lucida Grande 10"/>
- <Font name ="MessageBubbleTooltip" _displayName="Message bubbles tooltip" default ="_DEFAULT_SANS" defaultMac = "Lucida Grande Bold 10"/>
+ <Font name ="MessageBubbles" _displayName="Message bubbles" default ="_DEFAULT_SANS" defaultMac = "Lucida Grande 11"/>
+ <Font name ="MessageBubbleCounter" _displayName="Message bubbles error count" default ="_DEFAULT_SANS" defaultMac = "Lucida Grande Bold 11"/>
+ <Font name ="MessageBubbleTooltip" _displayName="Message bubbles tooltip" default ="_DEFAULT_SANS" defaultMac = "Lucida Grande Bold 11"/>
<Font name ="LanguageTooltips" _displayName="Editor tooltips" default ="_DEFAULT_SANS"/>
</Extension>
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj
===================================================================
@@ -27,9 +27,9 @@
</CustomCommands>
<AssemblyName>MonoDevelop.SourceEditor2</AssemblyName>
<ConsolePause>False</ConsolePause>
- <GenerateDocumentation>true</GenerateDocumentation>
<DefineConstants>DEBUG</DefineConstants>
<NoWarn>1591;1573</NoWarn>
+ <DocumentationFile>..\..\..\build\AddIns\DisplayBindings\SourceEditor\MonoDevelop.SourceEditor2.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -43,8 +43,8 @@
<Execution clr-version="Net_2_0" />
</Execution>
<DebugSymbols>true</DebugSymbols>
- <GenerateDocumentation>true</GenerateDocumentation>
<NoWarn>1591;1573</NoWarn>
+ <DocumentationFile>..\..\..\build\AddIns\DisplayBindings\SourceEditor\MonoDevelop.SourceEditor.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\core\MonoDevelop.Core\MonoDevelop.Core.csproj">
@@ -185,6 +185,8 @@
<Compile Include="gtk-gui\MonoDevelop.SourceEditor.OptionPanels.CompletionAppearancePanel.cs" />
<Compile Include="AddinInfo.cs" />
<Compile Include="MonoDevelop.SourceEditor.OptionPanels\CompletionCharactersPanel.cs" />
+ <Compile Include="MonoDevelop.SourceEditor\OverlayMessageWindow.cs" />
+ <Compile Include="MonoDevelop.SourceEditor\HoverCloseButton.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="gtk-gui\gui.stetic">
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs
===================================================================
@@ -398,8 +398,15 @@ protected override bool OnIMProcessedKeyPressEvent (Gdk.Key key, uint ch, Gdk.Mo
skipChars.Remove (skipChar);
}
if (Extension != null) {
- if (ExtensionKeyPress (key, ch, state))
- result = base.OnIMProcessedKeyPressEvent (key, ch, state);
+ if (!DefaultSourceEditorOptions.Instance.GenerateFormattingUndoStep) {
+ using (var undo = Document.OpenUndoGroup ()) {
+ if (ExtensionKeyPress (key, ch, state))
+ result = base.OnIMProcessedKeyPressEvent (key, ch, state);
+ }
+ } else {
+ if (ExtensionKeyPress (key, ch, state))
+ result = base.OnIMProcessedKeyPressEvent (key, ch, state);
+ }
if (returnBetweenBraces)
HitReturn ();
} else {
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/FileRegistry.cs
===================================================================
@@ -69,6 +69,7 @@ public static void Add (SourceEditorView sourceEditorView)
public static void Remove (SourceEditorView sourceEditorView)
{
openFiles.Remove (sourceEditorView);
+ UpdateEolMessages ();
}
static bool SkipView (SourceEditorView view)
@@ -214,6 +215,16 @@ public static void IgnoreLineEndingsInAllFiles ()
view.Save ();
}
}
+
+ public static void UpdateEolMessages ()
+ {
+ var multiple = HasMultipleIncorretEolMarkers;
+ foreach (var view in openFiles) {
+ if (SkipView (view) || !view.SourceEditorWidget.HasIncorrectEolMarker)
+ continue;
+ view.SourceEditorWidget.UpdateEolMarkerMessage(multiple);
+ }
+ }
#endregion
}
}
Added: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/HoverCloseButton.cs
===================================================================
@@ -0,0 +1,160 @@
+//
+// HoverCloseButton.cs
+//
+// Author:
+// Mike Krüger <[email protected]>
+//
+// Copyright (c) 2013 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 Gtk;
+using Gdk;
+
+namespace MonoDevelop.SourceEditor
+{
+ public class HoverCloseButton : EventBox
+ {
+ bool hovered;
+
+ public HoverCloseButton ()
+ {
+ VisibleWindow = false;
+ Events |= EventMask.LeaveNotifyMask | EventMask.EnterNotifyMask | EventMask.ButtonPressMask | EventMask.ButtonReleaseMask;
+ }
+
+ protected override void OnSizeRequested (ref Requisition requisition)
+ {
+ base.OnSizeRequested (ref requisition);
+ requisition.Width = requisition.Height = 16;
+ }
+
+ protected override bool OnEnterNotifyEvent (Gdk.EventCrossing evnt)
+ {
+ hovered = true;
+ QueueDraw ();
+ return base.OnEnterNotifyEvent (evnt);
+ }
+
+ protected override bool OnLeaveNotifyEvent (Gdk.EventCrossing evnt)
+ {
+ hovered = false;
+ QueueDraw ();
+ return base.OnLeaveNotifyEvent (evnt);
+ }
+
+ bool click;
+ protected override bool OnButtonPressEvent (EventButton evnt)
+ {
+ if (evnt.Button == 1 && hovered)
+ click = true;
+ return base.OnButtonPressEvent (evnt);
+ }
+
+ protected override bool OnButtonReleaseEvent (EventButton evnt)
+ {
+ if (click && hovered)
+ OnClicked (EventArgs.Empty);
+ click = false;
+ return base.OnButtonReleaseEvent (evnt);
+ }
+
+ public event EventHandler Clicked;
+
+ protected virtual void OnClicked (EventArgs e)
+ {
+ var handler = Clicked;
+ if (handler != null)
+ handler (this, e);
+ }
+
+ protected override bool OnExposeEvent (Gdk.EventExpose evnt)
+ {
+ using (var cr = CairoHelper.Create (evnt.Window)) {
+ DrawCloseButton (cr, new Gdk.Point (Allocation.X + Allocation.Width / 2, Allocation.Y + Allocation.Height / 2), hovered, 1.0, 0);
+ }
+ return base.OnExposeEvent (evnt);
+ }
+
+ static void DrawCloseButton (Cairo.Context context, Gdk.Point center, bool hovered, double opacity, double animationProgress)
+ {
+ if (hovered) {
+ double radius = 6;
+ context.Arc (center.X, center.Y, radius, 0, Math.PI * 2);
+ context.SetSourceRGBA (.6, .6, .6, opacity);
+ context.Fill ();
+
+ context.SetSourceRGBA (0.95, 0.95, 0.95, opacity);
+ context.LineWidth = 2;
+
+ context.MoveTo (center.X - 3, center.Y - 3);
+ context.LineTo (center.X + 3, center.Y + 3);
+ context.MoveTo (center.X - 3, center.Y + 3);
+ context.LineTo (center.X + 3, center.Y - 3);
+ context.Stroke ();
+ } else {
+ double lineColor = .63 - .1 * animationProgress;
+ double fillColor = .74;
+
+ double heightMod = Math.Max (0, 1.0 - animationProgress * 2);
+ context.MoveTo (center.X - 3, center.Y - 3 * heightMod);
+ context.LineTo (center.X + 3, center.Y + 3 * heightMod);
+ context.MoveTo (center.X - 3, center.Y + 3 * heightMod);
+ context.LineTo (center.X + 3, center.Y - 3 * heightMod);
+
+ context.LineWidth = 2;
+ context.SetSourceRGBA (lineColor, lineColor, lineColor, opacity);
+ context.Stroke ();
+
+ if (animationProgress > 0.5) {
+ double partialProg = (animationProgress - 0.5) * 2;
+ context.MoveTo (center.X - 3, center.Y);
+ context.LineTo (center.X + 3, center.Y);
+
+ context.LineWidth = 2 - partialProg;
+ context.SetSourceRGBA (lineColor, lineColor, lineColor, opacity);
+ context.Stroke ();
+
+
+ double radius = partialProg * 3.5;
+
+ // Background
+ context.Arc (center.X, center.Y, radius, 0, Math.PI * 2);
+ context.SetSourceRGBA (fillColor, fillColor, fillColor, opacity);
+ context.Fill ();
+
+ // Inset shadow
+ using (var lg = new Cairo.LinearGradient (0, center.Y - 5, 0, center.Y)) {
+ context.Arc (center.X, center.Y + 1, radius, 0, Math.PI * 2);
+ lg.AddColorStop (0, new Cairo.Color (0, 0, 0, 0.2 * opacity));
+ lg.AddColorStop (1, new Cairo.Color (0, 0, 0, 0));
+ context.Pattern = lg;
+ context.Stroke ();
+ }
+
+ // Outline
+ context.Arc (center.X, center.Y, radius, 0, Math.PI * 2);
+ context.SetSourceRGBA (lineColor, lineColor, lineColor, opacity);
+ context.Stroke ();
+ }
+ }
+ }
+ }
+}
+
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleCache.cs
===================================================================
@@ -30,6 +30,8 @@
using MonoDevelop.Ide.Fonts;
using Mono.TextEditor.Highlighting;
using MonoDevelop.Components;
+using Cairo;
+using MonoDevelop.Ide.Gui.Components;
namespace MonoDevelop.SourceEditor
{
@@ -45,6 +47,7 @@ class MessageBubbleCache : IDisposable
internal Pango.FontDescription fontDescription;
internal Pango.FontDescription tooltipFontDescription;
+ internal Pango.FontDescription errorCountFontDescription;
public MessageBubbleTextMarker CurrentSelectedTextMarker;
@@ -62,6 +65,7 @@ public MessageBubbleCache (TextEditor editor)
editor.HAdjustment.ValueChanged += HandleValueChanged;
fontDescription = FontService.GetFontDescription ("MessageBubbles");
tooltipFontDescription = FontService.GetFontDescription ("MessageBubbleTooltip");
+ errorCountFontDescription = FontService.GetFontDescription ("MessageBubbleCounter");
}
void HandleValueChanged (object sender, EventArgs e)
@@ -105,7 +109,7 @@ public MessageBubblePopoverWindow (MessageBubbleCache cache, MessageBubbleTextMa
// Layout constants
const int verticalTextBorder = 10;
- const int verticalTextSpace = 6;
+ const int verticalTextSpace = 7;
const int textBorder = 12;
const int iconTextSpacing = 8;
@@ -140,7 +144,7 @@ protected override void OnSizeRequested (ref Gtk.Requisition requisition)
protected override bool OnEnterNotifyEvent (Gdk.EventCrossing evnt)
{
- cache.DestroyPopoverWindow ();
+ cache.CancelLeaveDestroyTimeout ();
return base.OnEnterNotifyEvent (evnt);
}
@@ -172,7 +176,7 @@ protected override void OnDrawContent (Gdk.EventExpose evnt, Cairo.Context g)
g.Translate (
textBorder,
- y + verticalTextSpace / 2
+ y + verticalTextSpace / 2 + 1 + Math.Max (0, (h - icon.Height) / 2)
);
g.DrawImage (this, icon, 0, 0);
g.Restore ();
@@ -234,9 +238,25 @@ void HandleBeginHover (object sender, EventArgs e)
editor.QueueDraw ();
}
+ uint leaveDestroyTimeout;
+
+ void CancelLeaveDestroyTimeout ()
+ {
+ if (leaveDestroyTimeout != 0) {
+ GLib.Source.Remove (leaveDestroyTimeout);
+ leaveDestroyTimeout = 0;
+ }
+ }
+
void HandleLeaveNotifyEvent (object o, Gtk.LeaveNotifyEventArgs args)
{
- DestroyPopoverWindow ();
+ CancelLeaveDestroyTimeout ();
+ leaveDestroyTimeout = GLib.Timeout.Add (100, delegate {
+ DestroyPopoverWindow ();
+ leaveDestroyTimeout = 0;
+ return false;
+ });
+
CancelHoverTimeout ();
if (CurrentSelectedTextMarker == null)
return;
@@ -262,6 +282,7 @@ internal void DestroyPopoverWindow ()
public void Dispose ()
{
+ CancelLeaveDestroyTimeout ();
CancelHoverTimeout ();
DestroyPopoverWindow ();
editor.VAdjustment.ValueChanged -= HandleValueChanged;
@@ -330,4 +351,3 @@ protected virtual void OnChanged (EventArgs e)
public event EventHandler Changed;
}
}
-
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs
===================================================================
@@ -283,7 +283,7 @@ internal void EnsureLayoutCreated (TextEditor editor)
if (errorCountLayout == null && errors.Count > 1) {
errorCountLayout = new Pango.Layout (editor.PangoContext);
- errorCountLayout.FontDescription = FontService.GetFontDescription ("MessageBubbles");
+ errorCountLayout.FontDescription = cache.errorCountFontDescription;
errorCountLayout.SetText (errors.Count.ToString ());
}
}
@@ -374,23 +374,25 @@ public override void DrawAfterEol (TextEditor textEditor, Cairo.Context g, doubl
var sx = metrics.TextRenderEndPosition;
var width = LayoutWidth + errorCounterWidth + editor.LineHeight;
var drawLayout = layouts[0].Layout;
- int ex = 0 , ey = 0;
bool customLayout = true; //sx + width > editor.Allocation.Width;
bool hideText = false;
bubbleIsReduced = customLayout;
var showErrorCount = errorCounterWidth > 0 && errorCountLayout != null;
+ double roundingRadius = editor.LineHeight / 2 - 1;
+
if (customLayout) {
width = editor.Allocation.Width - sx;
string text = layouts[0].Layout.Text;
drawLayout = new Pango.Layout (editor.PangoContext);
drawLayout.FontDescription = cache.fontDescription;
var paintWidth = (width - errorCounterWidth - editor.LineHeight + 4);
- var minWidth = Math.Max (17, errorCounterWidth) + editor.LineHeight;
+ var minWidth = Math.Max (25, errorCounterWidth) * editor.Options.Zoom;
if (paintWidth < minWidth) {
hideText = true;
- drawLayout.SetMarkup ("<span weight='heavy'>···</span>");
- width = minWidth;
showErrorCount = false;
+// drawLayout.SetMarkup ("<span weight='heavy'>···</span>");
+ width = minWidth;
+ roundingRadius = 10 * editor.Options.Zoom;
sx = Math.Min (sx, editor.Allocation.Width - width);
} else {
drawLayout.Ellipsize = Pango.EllipsizeMode.End;
@@ -406,7 +408,7 @@ public override void DrawAfterEol (TextEditor textEditor, Cairo.Context g, doubl
bubbleWidth = width;
var bubbleHeight = editor.LineHeight - 1;
- g.RoundedRectangle (sx, y + 1, width, bubbleHeight, editor.LineHeight / 2 - 1);
+ g.RoundedRectangle (sx, y + 1, width, bubbleHeight, roundingRadius);
g.SetSourceColor (TagColor.Color);
g.Fill ();
@@ -437,7 +439,7 @@ public override void DrawAfterEol (TextEditor textEditor, Cairo.Context g, doubl
using (var lg = new Cairo.LinearGradient (errorCounterX, errorCounterY, errorCounterX, errorCounterY + errorCounterHeight)) {
lg.AddColorStop (0, CounterColor.Color);
lg.AddColorStop (1, CounterColor.Color.AddLight (-0.1));
- g.Pattern = lg;
+ g.SetSource (lg);
g.Fill ();
}
@@ -447,16 +449,34 @@ public override void DrawAfterEol (TextEditor textEditor, Cairo.Context g, doubl
errorCountLayout.GetPixelSize (out ew, out eh);
g.Translate (
- errorCounterX + (errorCounterWidth - ew) / 2,
- errorCounterY + (errorCounterHeight - eh) / 2
+ errorCounterX + (2 + errorCounterWidth - ew) / 2,
+ errorCounterY + (-1 + errorCounterHeight - eh) / 2
);
g.SetSourceColor (CounterColor.SecondColor);
g.ShowLayout (errorCountLayout);
g.Restore ();
}
- // Draw label text
- if (!showErrorCount || !hideText) {
+ if (hideText) {
+ // Draw dots
+ double radius = 2 * editor.Options.Zoom;
+ double spacing = 1 * editor.Options.Zoom;
+ double shadowOffset = 1 * editor.Options.Zoom;
+
+ sx += 1 * editor.Options.Zoom + Math.Ceiling((bubbleWidth - 3 * (radius * 2) - 2 * spacing) / 2);
+ for (int i = 0; i < 3; i++) {
+ g.Arc (sx, y + 1 + bubbleHeight / 2 + shadowOffset, radius, 0, Math.PI * 2);
+ g.SetSourceColor (MessageBubbleCache.ShadowColor);
+ g.Fill ();
+
+ g.Arc (sx, y + 1 + bubbleHeight / 2, radius, 0, Math.PI * 2);
+ g.SetSourceColor (TagColor.SecondColor);
+ g.Fill ();
+ sx += radius * 2 + spacing;
+ }
+
+ } else {
+ // Draw label text
g.Save ();
g.Translate (sx + editor.LineHeight / 2, y + (editor.LineHeight - layouts [0].Height) / 2 + 1);
Added: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/OverlayMessageWindow.cs
===================================================================
@@ -0,0 +1,124 @@
+//
+// OverlayMessageWindow.cs
+//
+// Author:
+// Mike Krüger <[email protected]>
+//
+// Copyright (c) 2013 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 Mono.TextEditor;
+using Gtk;
+using MonoDevelop.Components;
+using Gdk;
+
+namespace MonoDevelop.SourceEditor
+{
+ public class OverlayMessageWindow : Gtk.EventBox
+ {
+ const int border = 8;
+
+ public Func<int> SizeFunc;
+
+ ExtensibleTextEditor textEditor;
+
+ public OverlayMessageWindow ()
+ {
+ AppPaintable = true;
+ }
+
+ public void ShowOverlay (ExtensibleTextEditor textEditor)
+ {
+ this.textEditor = textEditor;
+ this.ShowAll ();
+ textEditor.AddTopLevelWidget (this, 0, 0);
+ textEditor.SizeAllocated += HandleSizeAllocated;
+ var child = (TextEditor.EditorContainerChild)textEditor [this];
+ child.FixedPosition = true;
+ }
+
+ protected override void OnDestroyed ()
+ {
+ base.OnDestroyed ();
+ if (textEditor != null) {
+ textEditor.SizeAllocated -= HandleSizeAllocated;
+ textEditor = null;
+ }
+ }
+
+ protected override void OnSizeRequested (ref Requisition requisition)
+ {
+ base.OnSizeRequested (ref requisition);
+
+ if (wRequest > 0) {
+ requisition.Width = wRequest;
+ }
+ }
+
+ protected override void OnSizeAllocated (Gdk.Rectangle allocation)
+ {
+ base.OnSizeAllocated (allocation);
+ Resize (allocation);
+ }
+ int wRequest = -1;
+ void HandleSizeAllocated (object o, Gtk.SizeAllocatedArgs args)
+ {
+ if (SizeFunc != null) {
+ var req = Math.Min (SizeFunc (), textEditor.Allocation.Width - border * 2);
+ if (req != wRequest) {
+ wRequest = req;
+ QueueResize ();
+ }
+ } else {
+ if (Allocation.Width > textEditor.Allocation.Width - border * 2) {
+ if (textEditor.Allocation.Width - border * 2 > 0) {
+ QueueResize ();
+ }
+ }
+ }
+ Resize (Allocation);
+ }
+
+ void Resize (Gdk.Rectangle alloc)
+ {
+ textEditor.MoveTopLevelWidget (this, (textEditor.Allocation.Width - alloc.Width) / 2, textEditor.Allocation.Height - alloc.Height - 8);
+ }
+
+ protected override bool OnExposeEvent (Gdk.EventExpose evnt)
+ {
+ using (var cr = CairoHelper.Create (evnt.Window)) {
+ cr.LineWidth = 1;
+ cr.Rectangle (0, 0, Allocation.Width, Allocation.Height);
+ cr.SetSourceColor (textEditor.ColorStyle.NotificationText.Background);
+ cr.Fill ();
+ cr.RoundedRectangle (0, 0, Allocation.Width, Allocation.Height, 3);
+ cr.SetSourceColor (textEditor.ColorStyle.NotificationText.Background);
+ cr.FillPreserve ();
+
+ cr.SetSourceColor (textEditor.ColorStyle.NotificationBorder.Color);
+ cr.Stroke();
+ }
+
+ return base.OnExposeEvent (evnt);
+ }
+
+ }
+}
+
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorOptions.cs
===================================================================
@@ -231,6 +231,7 @@ void LoadAllPrefs ()
this.EnableHighlightUsages = PropertyService.Get ("EnableHighlightUsages", false);
base.DrawIndentationMarkers = PropertyService.Get ("DrawIndentationMarkers", false);
this.lineEndingConversion = PropertyService.Get ("LineEndingConversion", LineEndingConversion.Ask);
+ this.generateFormattingUndoStep = PropertyService.Get ("GenerateFormattingUndoStep", false);
base.ShowWhitespaces = PropertyService.Get ("ShowWhitespaces", Mono.TextEditor.ShowWhitespaces.Never);
base.IncludeWhitespaces = PropertyService.Get ("IncludeWhitespaces", Mono.TextEditor.IncludeWhitespaces.All);
base.WrapLines = PropertyService.Get ("WrapLines", false);
@@ -412,6 +413,20 @@ void LoadAllPrefs ()
}
}
+
+ bool generateFormattingUndoStep;
+ public bool GenerateFormattingUndoStep {
+ get {
+ return generateFormattingUndoStep;
+ }
+ set {
+ if (value != this.generateFormattingUndoStep) {
+ this.generateFormattingUndoStep = value;
+ PropertyService.Set ("GenerateFormattingUndoStep", value);
+ OnChanged (EventArgs.Empty);
+ }
+ }
+ }
#endregion
bool useViModes = false;
Modified: main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs
===================================================================
@@ -861,6 +861,8 @@ public void ShowFileChangedWarning (bool multiple)
internal bool UseIncorrectMarkers { get; set; }
internal bool HasIncorrectEolMarker {
get {
+ if (Document.HasLineEndingMismatchOnTextSet)
+ return true;
string eol = DetectedEolMarker;
if (eol == null)
return false;
@@ -869,6 +871,8 @@ public void ShowFileChangedWarning (bool multiple)
}
string DetectedEolMarker {
get {
+ if (Document.HasLineEndingMismatchOnTextSet)
+ return "?";
if (textEditor.IsDisposed) {
LoggingService.LogWarning ("SourceEditorWidget.cs: HasIncorrectEolMarker was called on disposed source editor widget." + Environment.NewLine + Environment.StackTrace);
return null;
@@ -882,6 +886,11 @@ public void ShowFileChangedWarning (bool multiple)
}
}
+ internal void UpdateEolMarkerMessage (bool multiple)
+ {
+ ShowIncorretEolMarkers (Document.FileName, multiple);
+ }
+
internal bool EnsureCorrectEolMarker (string fileName)
{
if (UseIncorrectMarkers)
@@ -890,7 +899,11 @@ internal bool EnsureCorrectEolMarker (string fileName)
if (HasIncorrectEolMarker) {
switch (DefaultSourceEditorOptions.Instance.LineEndingConversion) {
case LineEndingConversion.Ask:
- ShowIncorretEolMarkers (fileName, FileRegistry.HasMultipleIncorretEolMarkers);
+ var hasMultipleIncorretEolMarkers = FileRegistry.HasMultipleIncorretEolMarkers;
+ ShowIncorretEolMarkers (fileName, hasMultipleIncorretEolMarkers);
+ if (hasMultipleIncorretEolMarkers) {
+ FileRegistry.UpdateEolMessages ();
+ }
return false;
case LineEndingConversion.ConvertAlways:
ConvertLineEndings ();
@@ -914,72 +927,114 @@ internal void ConvertLineEndings ()
newText.Append (correctEol);
}
view.StoreSettings ();
- TextEditor.Text = newText.ToString ();
+ view.ReplaceContent (Document.FileName, newText.ToString (), null);
+ Document.HasLineEndingMismatchOnTextSet = false;
view.LoadSettings ();
}
+ static string GetEolString (string detectedEol)
+ {
+ switch (detectedEol) {
+ case "\n":
+ return "UNIX";
+ case "\r\n":
+ return "Windows";
+ case "\r":
+ return "Mac";
+ case "?":
+ return "mixed";
+ }
+ return "Unknown";
+ }
+
+ OverlayMessageWindow messageOverlayWindow;
+
void ShowIncorretEolMarkers (string fileName, bool multiple)
{
RemoveMessageBar ();
-
- if (messageBar == null) {
- messageBar = new MonoDevelop.Components.InfoBar (MessageType.Warning);
- string detectedEol = DetectedEolMarker.Replace ("\n", "NL").Replace ("\r", "CR");
- string defaultEol = textEditor.Options.DefaultEolMarker.Replace ("\n", "NL").Replace ("\r", "CR");
- messageBar.SetMessageLabel (GettextCatalog.GetString (
- "<b>The file \"{0}\" has line endings (" + detectedEol + ") which differ from the policy settings(" + defaultEol + ").</b>\n" +
- "Do you want to convert the line endings?",
- EllipsizeMiddle (Document.FileName, 50)));
-
- Button b1 = new Button (GettextCatalog.GetString ("_Convert"));
- b1.Image = ImageService.GetImage (Gtk.Stock.Refresh, IconSize.Button);
- b1.Clicked += delegate(object sender, EventArgs e) {
- ConvertLineEndings ();
- view.WorkbenchWindow.ShowNotification = false;
- RemoveMessageBar ();
- view.Save (fileName, view.SourceEncoding);
- };
- messageBar.ActionArea.Add (b1);
-
- Button b2 = new Button (GettextCatalog.GetString ("_Keep line endings"));
- b2.Image = ImageService.GetImage (Gtk.Stock.Cancel, IconSize.Button);
- b2.Clicked += delegate(object sender, EventArgs e) {
- UseIncorrectMarkers = true;
- view.WorkbenchWindow.ShowNotification = false;
- RemoveMessageBar ();
- view.Save (fileName, view.SourceEncoding);
- };
- messageBar.ActionArea.Add (b2);
-
+ messageOverlayWindow = new OverlayMessageWindow ();
+
+ var hbox = new HBox ();
+ hbox.Spacing = 8;
+
+ var image = new HoverCloseButton ();
+ hbox.PackStart (image, false, false, 0);
+ var label = new Label (string.Format ("This file has line endings ({0}) which differ from the policy settings ({1}).", GetEolString (DetectedEolMarker), GetEolString (textEditor.Options.DefaultEolMarker)));
+ var color = (Mono.TextEditor.HslColor)textEditor.ColorStyle.NotificationText.Foreground;
+ label.ModifyFg (StateType.Normal, color);
+
+ int w, h;
+ label.Layout.GetPixelSize (out w, out h);
+ label.Ellipsize = Pango.EllipsizeMode.End;
+
+ hbox.PackStart (label, true, true, 0);
+ var okButton = new Button (Gtk.Stock.Ok);
+ okButton.WidthRequest = 60;
+ hbox.PackEnd (okButton, false, false, 0);
+
+ var list = new List<string> ();
+ list.Add (string.Format ("Convert to {0} line endings", GetEolString (textEditor.Options.DefaultEolMarker)));
+ if (multiple)
+ list.Add (string.Format ("Convert all files to {0} line endings", GetEolString (textEditor.Options.DefaultEolMarker)));
+ list.Add (string.Format ("Keep {0} line endings", GetEolString (DetectedEolMarker)));
+ if (multiple)
+ list.Add (string.Format ("Keep {0} line endings in all files", GetEolString (DetectedEolMarker)));
+ var combo = new ComboBox (list.ToArray ());
+ combo.Active = 0;
+ hbox.PackEnd (combo, false, false, 0);
+ var container = new HBox ();
+ const int containerPadding = 8;
+ container.PackStart (hbox, true, true, containerPadding);
+ messageOverlayWindow.Child = container;
+ messageOverlayWindow.ShowOverlay (this.TextEditor);
+
+ messageOverlayWindow.SizeFunc = () => {
+ return okButton.SizeRequest ().Width +
+ combo.SizeRequest ().Width +
+ image.SizeRequest ().Width +
+ w +
+ hbox.Spacing * 4 +
+ containerPadding * 2;
+ };
+ image.Clicked += delegate {
+ UseIncorrectMarkers = true;
+ view.WorkbenchWindow.ShowNotification = false;
+ RemoveMessageBar ();
+ };
+ okButton.Clicked += delegate {
if (multiple) {
- var b3 = new Button (GettextCatalog.GetString ("_Convert all files"));
- b3.Image = ImageService.GetImage (Gtk.Stock.Cancel, IconSize.Button);
- b3.Clicked += delegate {
+ switch (combo.Active) {
+ case 0:
+ ConvertLineEndings ();
+ view.WorkbenchWindow.ShowNotification = false;
+ view.Save (fileName, view.SourceEncoding);
+ break;
+ case 1:
FileRegistry.ConvertLineEndingsInAllFiles ();
- };
- messageBar.ActionArea.Add (b3);
-
- var b4 = new Button (GettextCatalog.GetString ("_Keep in all files"));
- b4.Image = ImageService.GetImage (Gtk.Stock.Cancel, IconSize.Button);
- b4.Clicked += delegate {
+ break;
+ case 2:
+ UseIncorrectMarkers = true;
+ view.WorkbenchWindow.ShowNotification = false;
+ break;
+ case 3:
FileRegistry.IgnoreLineEndingsInAllFiles ();
- };
- messageBar.ActionArea.Add (b4);
+ break;
+ }
+ } else {
+ switch (combo.Active) {
+ case 0:
+ ConvertLineEndings ();
+ view.WorkbenchWindow.ShowNotification = false;
+ view.Save (fileName, view.SourceEncoding);
+ break;
+ case 1:
+ UseIncorrectMarkers = true;
+ view.WorkbenchWindow.ShowNotification = false;
+ break;
+ }
}
-
- }
-
- vbox.PackStart (messageBar, false, false, CHILD_PADDING);
- vbox.ReorderChild (messageBar, 0);
- messageBar.ShowAll ();
-
- messageBar.QueueDraw ();
-// view.WorkbenchWindow.ShowNotification = true;
-//
-// // Ensure that one file with incorret EOL markers is shown.
-// var currentView = IdeApp.Workbench.ActiveDocument.PrimaryView.GetContent<SourceEditorView> ();
-// if (currentView == null || !currentView.IsDirty || !currentView.SourceEditorWidget.HasIncorrectEolMarker || currentView.SourceEditorWidget.UseIncorrectMarkers)
-// view.WorkbenchWindow.SelectWindow ();
+ RemoveMessageBar ();
+ };
}
#endregion
public void ShowAutoSaveWarning (string fileName)
@@ -1053,6 +1108,10 @@ public void RemoveMessageBar ()
}
if (!TextEditor.Visible)
TextEditor.Visible = true;
+ if (messageOverlayWindow != null) {
+ messageOverlayWindow.Destroy ();
+ messageOverlayWindow = null;
+ }
}
public void Reload ()
Modified: main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/MonoDevelop.SourceEditor.OptionPanels.BehaviorPanel.cs
===================================================================
@@ -15,6 +15,7 @@ public partial class BehaviorPanel
private global::Gtk.CheckButton checkbuttonOnTheFlyFormatting;
private global::Gtk.CheckButton checkbuttonFormatOnSave;
private global::Gtk.CheckButton checkbuttonAutoSetSearchPatternCasing;
+ private global::Gtk.CheckButton checkbuttonGenerateFormattingUndoStep;
private global::Gtk.Label GtkLabel6;
private global::Gtk.Alignment GtkAlignment;
private global::Gtk.VBox vbox2;
@@ -29,7 +30,7 @@ public partial class BehaviorPanel
private global::Gtk.HBox hbox3;
private global::Gtk.Label label2;
private global::Gtk.ComboBox controlLeftRightCombobox;
-
+
protected virtual void Build ()
{
global::Stetic.Gui.Initialize (this);
@@ -136,12 +137,24 @@ protected virtual void Build ()
w8.Position = 4;
w8.Expand = false;
w8.Fill = false;
+ // Container child vbox4.Gtk.Box+BoxChild
+ this.checkbuttonGenerateFormattingUndoStep = new global::Gtk.CheckButton ();
+ this.checkbuttonGenerateFormattingUndoStep.CanFocus = true;
+ this.checkbuttonGenerateFormattingUndoStep.Name = "checkbuttonGenerateFormattingUndoStep";
+ this.checkbuttonGenerateFormattingUndoStep.Label = global::Mono.Unix.Catalog.GetString ("_Generate additional undo steps for formatting");
+ this.checkbuttonGenerateFormattingUndoStep.DrawIndicator = true;
+ this.checkbuttonGenerateFormattingUndoStep.UseUnderline = true;
+ this.vbox4.Add (this.checkbuttonGenerateFormattingUndoStep);
+ global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.checkbuttonGenerateFormattingUndoStep]));
+ w9.Position = 5;
+ w9.Expand = false;
+ w9.Fill = false;
this.alignment3.Add (this.vbox4);
this.vbox1.Add (this.alignment3);
- global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.alignment3]));
- w10.Position = 1;
- w10.Expand = false;
- w10.Fill = false;
+ global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.alignment3]));
+ w11.Position = 1;
+ w11.Expand = false;
+ w11.Fill = false;
// Container child vbox1.Gtk.Box+BoxChild
this.GtkLabel6 = new global::Gtk.Label ();
this.GtkLabel6.Name = "GtkLabel6";
@@ -149,10 +162,10 @@ protected virtual void Build ()
this.GtkLabel6.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>Indentation</b>");
this.GtkLabel6.UseMarkup = true;
this.vbox1.Add (this.GtkLabel6);
- global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.GtkLabel6]));
- w11.Position = 2;
- w11.Expand = false;
- w11.Fill = false;
+ global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.GtkLabel6]));
+ w12.Position = 2;
+ w12.Expand = false;
+ w12.Fill = false;
// Container child vbox1.Gtk.Box+BoxChild
this.GtkAlignment = new global::Gtk.Alignment (0F, 0F, 1F, 1F);
this.GtkAlignment.Name = "GtkAlignment";
@@ -171,23 +184,23 @@ protected virtual void Build ()
this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("_Indentation mode:");
this.label1.UseUnderline = true;
this.hbox1.Add (this.label1);
- global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.label1]));
- w12.Position = 0;
- w12.Expand = false;
- w12.Fill = false;
+ global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.label1]));
+ w13.Position = 0;
+ w13.Expand = false;
+ w13.Fill = false;
// Container child hbox1.Gtk.Box+BoxChild
this.indentationCombobox = global::Gtk.ComboBox.NewText ();
this.indentationCombobox.Name = "indentationCombobox";
this.hbox1.Add (this.indentationCombobox);
- global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.indentationCombobox]));
- w13.Position = 1;
- w13.Expand = false;
- w13.Fill = false;
- this.vbox2.Add (this.hbox1);
- global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1]));
- w14.Position = 0;
+ global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.indentationCombobox]));
+ w14.Position = 1;
w14.Expand = false;
w14.Fill = false;
+ this.vbox2.Add (this.hbox1);
+ global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1]));
+ w15.Position = 0;
+ w15.Expand = false;
+ w15.Fill = false;
// Container child vbox2.Gtk.Box+BoxChild
this.tabAsReindentCheckbutton = new global::Gtk.CheckButton ();
this.tabAsReindentCheckbutton.CanFocus = true;
@@ -196,16 +209,16 @@ protected virtual void Build ()
this.tabAsReindentCheckbutton.DrawIndicator = true;
this.tabAsReindentCheckbutton.UseUnderline = true;
this.vbox2.Add (this.tabAsReindentCheckbutton);
- global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.tabAsReindentCheckbutton]));
- w15.Position = 1;
- w15.Expand = false;
- w15.Fill = false;
+ global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.tabAsReindentCheckbutton]));
+ w16.Position = 1;
+ w16.Expand = false;
+ w16.Fill = false;
this.GtkAlignment.Add (this.vbox2);
this.vbox1.Add (this.GtkAlignment);
- global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.GtkAlignment]));
- w17.Position = 3;
- w17.Expand = false;
- w17.Fill = false;
+ global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.GtkAlignment]));
+ w18.Position = 3;
+ w18.Expand = false;
+ w18.Fill = false;
// Container child vbox1.Gtk.Box+BoxChild
this.GtkLabel8 = new global::Gtk.Label ();
this.GtkLabel8.Name = "GtkLabel8";
@@ -213,10 +226,10 @@ protected virtual void Build ()
this.GtkLabel8.LabelProp = global::Mono.Unix.Catalog.GetString ("<b>Navigation</b>");
this.GtkLabel8.UseMarkup = true;
this.vbox1.Add (this.GtkLabel8);
- global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.GtkLabel8]));
- w18.Position = 4;
- w18.Expand = false;
- w18.Fill = false;
+ global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.GtkLabel8]));
+ w19.Position = 4;
+ w19.Expand = false;
+ w19.Fill = false;
// Container child vbox1.Gtk.Box+BoxChild
this.alignment4 = new global::Gtk.Alignment (0.5F, 0.5F, 1F, 1F);
this.alignment4.Name = "alignment4";
@@ -233,10 +246,10 @@ protected virtual void Build ()
this.useViModesCheck.DrawIndicator = true;
this.useViModesCheck.UseUnderline = true;
this.vbox5.Add (this.useViModesCheck);
- global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.useViModesCheck]));
- w19.Position = 0;
- w19.Expand = false;
- w19.Fill = false;
+ global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.useViModesCheck]));
+ w20.Position = 0;
+ w20.Expand = false;
+ w20.Fill = false;
// Container child vbox5.Gtk.Box+BoxChild
this.hbox3 = new global::Gtk.HBox ();
this.hbox3.Name = "hbox3";
@@ -247,29 +260,29 @@ protected virtual void Build ()
this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("Word _break mode:");
this.label2.UseUnderline = true;
this.hbox3.Add (this.label2);
- global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.label2]));
- w20.Position = 0;
- w20.Expand = false;
- w20.Fill = false;
+ global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.label2]));
+ w21.Position = 0;
+ w21.Expand = false;
+ w21.Fill = false;
// Container child hbox3.Gtk.Box+BoxChild
this.controlLeftRightCombobox = global::Gtk.ComboBox.NewText ();
this.controlLeftRightCombobox.Name = "controlLeftRightCombobox";
this.hbox3.Add (this.controlLeftRightCombobox);
- global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.controlLeftRightCombobox]));
- w21.Position = 1;
- w21.Expand = false;
- w21.Fill = false;
- this.vbox5.Add (this.hbox3);
- global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hbox3]));
+ global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.controlLeftRightCombobox]));
w22.Position = 1;
w22.Expand = false;
w22.Fill = false;
+ this.vbox5.Add (this.hbox3);
+ global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hbox3]));
+ w23.Position = 1;
+ w23.Expand = false;
+ w23.Fill = false;
this.alignment4.Add (this.vbox5);
this.vbox1.Add (this.alignment4);
- global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.alignment4]));
- w24.Position = 5;
- w24.Expand = false;
- w24.Fill = false;
+ global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.vbox1 [this.alignment4]));
+ w25.Position = 5;
+ w25.Expand = false;
+ w25.Fill = false;
this.Add (this.vbox1);
if ((this.Child != null)) {
this.Child.ShowAll ();
Modified: main/src/addins/MonoDevelop.SourceEditor2/gtk-gui/gui.stetic
===================================================================
@@ -7,6 +7,7 @@
<import>
<widget-library name="../../../../build/bin/MonoDevelop.Ide.dll" />
<widget-library name="../../../../build/AddIns/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.dll" />
+ <widget-library name="../../../../build/AddIns/MonoDevelop.Debugger/MonoDevelop.Debugger.dll" />
<widget-library name="../../../../build/bin/Mono.TextEditor.dll" />
<widget-library name="../../../../build/AddIns/DisplayBindings/SourceEditor/MonoDevelop.SourceEditor2.dll" internal="true" />
</import>
@@ -717,6 +718,22 @@
<property name="Fill">False</property>
</packing>
</child>
+ <child>
+ <widget class="Gtk.CheckButton" id="checkbuttonGenerateFormattingUndoStep">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Label" translatable="yes">_Generate additional undo steps for formatting</property>
+ <property name="DrawIndicator">True</property>
+ <property name="HasLabel">True</property>
+ <property name="UseUnderline">True</property>
+ </widget>
+ <packing>
+ <property name="Position">5</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
</widget>
</child>
</widget>
Added: main/src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor.Gui/XmlSchemasPanel.cs
===================================================================
Added: main/src/addins/MonoDevelop.XmlEditor/MonoDevelop.XmlEditor/OpenStylesheetCommand.cs
===================================================================
Modified: main/src/addins/NUnit/Gui/TestNodeBuilder.cs
===================================================================
@@ -92,6 +92,8 @@ public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, Nod
UnitTestResult res = test.GetLastResult ();
if (res == null)
nodeInfo.Icon = CircleImage.None;
+ else if (res.Status == ResultStatus.Ignored)
+ nodeInfo.Icon = CircleImage.NotRun;
else if (res.ErrorsAndFailures > 0 && res.Passed > 0)
nodeInfo.Icon = test.IsHistoricResult ? CircleImage.OldSuccessAndFailure : CircleImage.SuccessAndFailure;
else if (res.IsInconclusive)
@@ -100,7 +102,7 @@ public override void BuildNode (ITreeBuilder treeBuilder, object dataObject, Nod
nodeInfo.Icon = test.IsHistoricResult ? CircleImage.OldFailure : CircleImage.Failure;
else if (res.IsSuccess)
nodeInfo.Icon = test.IsHistoricResult ? CircleImage.OldSuccess : CircleImage.Success;
- else if (res.IsNotRun)
+ else if (res.IsNotRun || res.Ignored > 0)
nodeInfo.Icon = CircleImage.NotRun;
else
nodeInfo.Icon = CircleImage.None;
Modified: main/src/addins/NUnit/Services/NUnitAssemblyTestSuite.cs
===================================================================
@@ -477,7 +477,7 @@ UnitTestResult RunWithConsoleRunner (ProcessExecutionCommand cmd, UnitTest test,
else if (!string.IsNullOrEmpty (suiteName))
cmd.Arguments += " -run=" + suiteName;
if (automaticUpdates) {
- var tcpListener = new MonoDevelop.NUnit.External.TcpTestListener (localMonitor);
+ var tcpListener = new MonoDevelop.NUnit.External.TcpTestListener (localMonitor, suiteName);
cmd.Arguments += " -port=" + tcpListener.Port;
}
var p = testContext.ExecutionContext.Execute (cmd, cons);
@@ -489,16 +489,16 @@ UnitTestResult RunWithConsoleRunner (ProcessExecutionCommand cmd, UnitTest test,
if (new FileInfo (outFile).Length == 0)
throw new Exception ("Command failed");
-
+
+ if (automaticUpdates) {
+ if (testName != null)
+ return localMonitor.SingleTestResult;
+ return test.GetLastResult ();
+ }
+
XDocument doc = XDocument.Load (outFile);
if (doc.Root != null) {
- if (automaticUpdates) {
- DispatchService.GuiDispatch (delegate {
- testContext.ResultsPad.InitializeTestRun (test);
- });
- }
-
var root = doc.Root.Elements ("test-suite").FirstOrDefault ();
if (root != null) {
cons.SetDone ();
@@ -511,7 +511,10 @@ UnitTestResult RunWithConsoleRunner (ProcessExecutionCommand cmd, UnitTest test,
}
bool macunitStyle = doc.Root.Element ("environment") != null && doc.Root.Element ("environment").Attribute ("macunit-version") != null;
- return ReportXmlResult (localMonitor, root, "", macunitStyle);
+ var result = ReportXmlResult (localMonitor, root, "", macunitStyle);
+ if (testName != null)
+ result = localMonitor.SingleTestResult;
+ return result;
}
}
throw new Exception ("Test results could not be parsed.");
Modified: main/src/addins/NUnit/Services/TcpTestListener.cs
===================================================================
@@ -34,11 +34,18 @@
using System.Xml.Linq;
using System.Collections.Generic;
using System.Linq;
+using MonoDevelop.Core;
namespace MonoDevelop.NUnit.External
{
class TcpTestListener
{
+ string testSuiteName;
+ string rootTestName;
+
+ List<Tuple<string,UnitTestResult>> suiteStack = new List<Tuple<string, UnitTestResult>> ();
+ IRemoteEventListener listener;
+
TcpListener TcpListener {
get; set;
}
@@ -48,8 +55,12 @@ class TcpTestListener
}
- public TcpTestListener (IRemoteEventListener listener)
+ public TcpTestListener (IRemoteEventListener listener, string suiteName)
{
+ this.testSuiteName = suiteName;
+ this.listener = listener;
+ bool rootSuiteStarted = false;
+
TcpListener = new TcpListener (new IPEndPoint (IPAddress.Loopback, 0));
TcpListener.Start ();
Task.Factory.StartNew (() => {
@@ -61,29 +72,115 @@ public TcpTestListener (IRemoteEventListener listener)
string line = null;
while ((line = reader.ReadLine ()) != null) {
var element = XElement.Parse (line);
+ string testName = element.Attribute ("name").Value;
+ var action = element.Name.LocalName;
+
+ if (testSuiteName.Length == 0 && !rootSuiteStarted) {
+ // Running the whole assembly
+ rootTestName = testName;
+ rootSuiteStarted = true;
+ continue;
+ }
+ if (testSuiteName == testName && !rootSuiteStarted) {
+ // Running a test suite
+ rootTestName = testName;
+ rootSuiteStarted = true;
+ listener.SuiteStarted ("<root>");
+ continue;
+ }
- Gtk.Application.Invoke (delegate {
- var testName = element.Attribute ("name").Value;
- if (element.Name.LocalName == "suite-started") {
- listener.SuiteStarted (testName);
- } else if (element.Name.LocalName == "test-started") {
- listener.TestStarted (testName);
- } else if (element.Name.LocalName == "test-finished") {
- listener.TestFinished (testName, CreateResult (element));
- } else if (element.Name.LocalName == "suite-finished") {
- listener.SuiteFinished (testName, CreateResult (element));
+ if (!rootSuiteStarted)
+ continue;
+
+ switch (action) {
+ case "suite-started":
+ UpdateTestSuiteStatus (testName, false); break;
+ case "test-started":
+ UpdateTestSuiteStatus (testName, true);
+ listener.TestStarted (testName); break;
+ case "test-finished":
+ var res = CreateResult (element);
+ AddTestResult (res);
+ listener.TestFinished (testName, res); break;
+ case "suite-finished":
+ if (testName == rootTestName) {
+ FinishSuites (0);
+ listener.SuiteFinished ("<root>", CreateResult (element));
+ rootSuiteStarted = false;
}
- });
+ break;
+ }
}
}
- } catch {
-
+ } catch (Exception ex) {
+ LoggingService.LogError ("Exception in test listener", ex);
} finally {
TcpListener.Stop ();
}
});
}
+ void UpdateTestSuiteStatus (string name, bool isTest)
+ {
+ if (testSuiteName.Length > 0)
+ name = name.Substring (testSuiteName.Length + 1);
+ string[] parts = name.Split ('.');
+ int len = isTest ? parts.Length - 1 : parts.Length;
+ for (int n = 0; n < len; n++) {
+ if (n >= suiteStack.Count) {
+ StartSuite (parts[n]);
+ } else if (parts [n] != suiteStack [n].Item1) {
+ FinishSuites (n);
+ StartSuite (parts[n]);
+ }
+ }
+ }
+
+ void FinishSuites (int stackLevel)
+ {
+ if (stackLevel + 1 < suiteStack.Count)
+ FinishSuites (stackLevel + 1);
+
+ if (stackLevel >= suiteStack.Count)
+ return;
+
+ var tname = GetTestSuiteName (stackLevel);
+ var res = suiteStack [stackLevel].Item2;
+
+ suiteStack.RemoveAt (stackLevel);
+
+ listener.SuiteFinished (tname, res);
+ }
+
+ void StartSuite (string name)
+ {
+ suiteStack.Add (new Tuple<string, UnitTestResult> (name, new UnitTestResult ()));
+ name = GetTestSuiteName (suiteStack.Count - 1);
+ listener.SuiteStarted (name);
+ }
+
+ void AddTestResult (UnitTestResult res)
+ {
+ foreach (var r in suiteStack)
+ r.Item2.Add (res);
+ }
+
+ string GetTestSuiteName (int stackLevel)
+ {
+ var info = suiteStack [stackLevel];
+
+ string name;
+ if (stackLevel > 0) {
+ var prefix = string.Join (".", suiteStack.Select (s => s.Item1).Take (stackLevel));
+ name = prefix + "." + info.Item1;
+ } else
+ name = info.Item1;
+
+ if (testSuiteName.Length > 0)
+ name = testSuiteName + "." + name;
+ return name;
+ }
+
UnitTestResult CreateResult (XElement element)
{
var result = (ResultStatus)Enum.Parse (typeof(ResultStatus), element.Attribute ("result").Value);
@@ -92,12 +189,17 @@ UnitTestResult CreateResult (XElement element)
var ignored = int.Parse (element.Attribute ("ignored").Value);
var inconclusive = int.Parse (element.Attribute ("inconclusive").Value);
+ var message = (string)element.Attribute ("message");
+ var stackTrace = (string)element.Attribute ("stack-trace");
+
return new UnitTestResult {
Status = result,
Passed = passed,
Failures = failures,
Ignored = ignored,
- Inconclusive = inconclusive
+ Inconclusive = inconclusive,
+ Message = message,
+ StackTrace = stackTrace
};
}
}
Modified: main/src/addins/NUnit/Services/TestContext.cs
===================================================================
@@ -44,7 +44,6 @@ public class TestContext
public TestContext (ITestProgressMonitor monitor, TestResultsPad resultsPad, IExecutionHandler executionContext, DateTime testDate)
{
this.monitor = monitor;
- ResultsPad = resultsPad;
if (executionContext == null)
executionContext = Runtime.ProcessService.DefaultExecutionHandler;
this.executionContext = executionContext;
@@ -68,10 +67,6 @@ public TestContext (ITestProgressMonitor monitor, TestResultsPad resultsPad, IEx
public IExecutionHandler ExecutionContext {
get { return executionContext; }
}
-
- internal TestResultsPad ResultsPad {
- get; private set;
- }
}
}
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git.csproj
===================================================================
@@ -85,6 +85,7 @@
<Compile Include="MonoDevelop.VersionControl.Git\UserGitConfigDialog.cs" />
<Compile Include="gtk-gui\MonoDevelop.VersionControl.Git.UserGitConfigDialog.cs" />
<Compile Include="MonoDevelop.VersionControl.Git\MyersDiff.cs" />
+ <Compile Include="MonoDevelop.VersionControl.Git\GitSelectRevisionDialog.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\core\Mono.Texteditor\Mono.TextEditor.csproj">
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditBranchDialog.cs
===================================================================
@@ -45,10 +45,10 @@ public EditBranchDialog (GitRepository repo, Branch branch, bool isNew)
comboStore = new ListStore (typeof(string), typeof(Gdk.Pixbuf), typeof (string));
comboSources.Model = comboStore;
- CellRendererPixbuf crp = new CellRendererPixbuf ();
+ var crp = new CellRendererPixbuf ();
comboSources.PackStart (crp, false);
comboSources.AddAttribute (crp, "pixbuf", 1);
- CellRendererText crt = new CellRendererText ();
+ var crt = new CellRendererText ();
comboSources.PackStart (crt, true);
comboSources.AddAttribute (crt, "text", 2);
@@ -57,8 +57,7 @@ public EditBranchDialog (GitRepository repo, Branch branch, bool isNew)
oldName = branch.Name;
currentTracking = branch.Tracking;
entryName.Text = branch.Name;
- if (currentTracking != null)
- checkTrack.Active = true;
+ checkTrack.Active = currentTracking != null;
}
foreach (Branch b in repo.GetBranches ()) {
@@ -106,7 +105,7 @@ void UpdateStatus ()
labelError.Markup = "<span color='red'>" + GettextCatalog.GetString ("A branch with this name already exists") + "</span>";
labelError.Show ();
buttonOk.Sensitive = false;
- } else if (!IsValidBranchName (entryName.Text)) {
+ } else if (!GitUtil.IsValidBranchName (entryName.Text)) {
labelError.Markup = "<span color='red'>" + GettextCatalog.GetString (@"A branch name can not:
Start with '.' or end with '/' or '.lock'
Contain a ' ', '..', '~', '^', ':', '\', '?', '['") + "</span>";
@@ -116,19 +115,6 @@ void UpdateStatus ()
labelError.Hide ();
}
- static bool IsValidBranchName (string name)
- {
- // List from: https://github.com/git/git/blob/master/refs.c#L21
- if (name.StartsWith (".", System.StringComparison.Ordinal) ||
- name.EndsWith ("/", System.StringComparison.Ordinal) ||
- name.EndsWith (".lock", System.StringComparison.Ordinal))
- return false;
-
- if (name.Contains (" ") || name.Contains ("~") || name.Contains ("..") || name.Contains ("^") || name.Contains (":") || name.Contains ("\\") || name.Contains ("?") || name.Contains ("["))
- return false;
- return true;
- }
-
protected virtual void OnCheckTrackToggled (object sender, System.EventArgs e)
{
UpdateStatus ();
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitConfigurationDialog.cs
===================================================================
@@ -36,6 +36,7 @@ public partial class GitConfigurationDialog : Dialog
{
readonly GitRepository repo;
readonly ListStore storeBranches;
+ readonly ListStore storeTags;
readonly TreeStore storeRemotes;
public GitConfigurationDialog (GitRepository repo)
@@ -61,11 +62,20 @@ public GitConfigurationDialog (GitRepository repo)
treeRemotes.AppendColumn ("Remote Source / Branch", new CellRendererText (), "markup", 1);
treeRemotes.AppendColumn ("Url", new CellRendererText (), "text", 2);
+
+ // Tags list
+ storeTags = new ListStore (typeof(string));
+ listTags.Model = storeTags;
+ listTags.HeadersVisible = true;
+
+ listTags.AppendColumn (GettextCatalog.GetString ("Tag"), new CellRendererText (), "text", 0);
+
// Fill data
FillBranches ();
FillRemotes ();
+ FillTags ();
}
void FillBranches ()
@@ -100,6 +110,17 @@ void FillRemotes ()
}
state.Load ();
}
+
+ void FillTags ()
+ {
+ TreeViewState state = new TreeViewState (listTags, 1);
+ state.Save ();
+ storeTags.Clear ();
+ foreach (string tag in repo.GetTags ()) {
+ storeTags.AppendValues (tag);
+ }
+ state.Load ();
+ }
protected virtual void OnButtonAddBranchClicked (object sender, EventArgs e)
{
@@ -260,6 +281,37 @@ protected virtual void OnButtonTrackRemoteClicked (object sender, EventArgs e)
dlg.Destroy ();
}
}
+
+ protected void OnButtonNewTagClicked (object sender, EventArgs e)
+ {
+ // Create dialog with revisions of current branch.
+ // Select revision to tag at.
+ // Create tag.
+
+ using (var dlg = new GitSelectRevisionDialog (repo)) {
+ if (dlg.Run () != Xwt.Command.Ok)
+ return;
+
+ repo.AddTag (dlg.TagName, dlg.SelectedRevision, dlg.TagMessage);
+ FillTags ();
+ }
+ }
+
+ protected void OnButtonRemoveTagClicked (object sender, EventArgs e)
+ {
+ TreeIter it;
+ if (!listTags.Selection.GetSelected (out it))
+ return;
+
+ string tagName = (string) storeTags.GetValue (it, 0);
+ repo.RemoveTag (tagName);
+ FillTags ();
+ }
+
+ protected virtual void OnButtonPushTagClicked (object sender, EventArgs e)
+ {
+ repo.PushAllTags ();
+ }
}
}
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs
===================================================================
@@ -1418,6 +1418,28 @@ public IEnumerable<string> GetTags ()
}
}
+ public void AddTag (string name, Revision rev, string message)
+ {
+ var addTag = new NGit.Api.Git (RootRepository).Tag ();
+ var gitRev = (GitRevision)rev;
+
+ addTag.SetName (name).SetMessage (message).SetObjectId (gitRev.Commit);
+ addTag.SetObjectId (gitRev.Commit).SetTagger (new PersonIdent (RootRepository));
+ addTag.Call ();
+ }
+
+ public void RemoveTag (string name)
+ {
+ var deleteTag = new NGit.Api.Git (RootRepository).TagDelete ();
+ deleteTag.SetTags (name).Call ();
+ }
+
+ public void PushAllTags ()
+ {
+ var pushTags = new NGit.Api.Git (RootRepository).Push ();
+ pushTags.SetPushTags ().Call ();
+ }
+
public IEnumerable<string> GetRemoteBranches (string remoteName)
{
var list = new NGit.Api.Git (RootRepository).BranchList ().SetListMode (ListBranchCommand.ListMode.REMOTE);
Added: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitSelectRevisionDialog.cs
===================================================================
@@ -0,0 +1,151 @@
+//
+// GitSelectRevisionDialog.cs
+//
+// Author:
+// Therzok <[email protected]>
+//
+// Copyright (c) 2013 Therzok
+//
+// 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 System.Text;
+
+namespace MonoDevelop.VersionControl.Git
+{
+ class GitSelectRevisionDialog : Xwt.Dialog
+ {
+ readonly Xwt.TextEntry tagNameEntry;
+ readonly Xwt.TextEntry tagMessageEntry;
+
+ readonly Xwt.ListView revisionList;
+
+ readonly Xwt.ListStore revisionStore;
+ readonly Xwt.DataField<string> messageField;
+ readonly Xwt.ListViewColumn messageColumn;
+ readonly Xwt.DataField<string> dateField;
+ readonly Xwt.ListViewColumn dateColumn;
+ readonly Xwt.DataField<string> authorField;
+ readonly Xwt.ListViewColumn authorColumn;
+ readonly Xwt.DataField<string> shaField;
+ readonly Xwt.ListViewColumn shaColumn;
+ readonly Xwt.DataField<Revision> revisionField;
+ readonly Xwt.DialogButton buttonOk;
+
+ public GitSelectRevisionDialog (GitRepository repo)
+ {
+ Title = GettextCatalog.GetString ("Select a revision");
+
+ var vbox = new Xwt.VBox ();
+ vbox.MinHeight = 400;
+ vbox.MinWidth = 600;
+
+ vbox.PackStart(new Xwt.Label (GettextCatalog.GetString ("Tag Name")));
+
+ tagNameEntry = new Xwt.TextEntry ();
+ tagNameEntry.Changed += delegate {
+ CheckSensitive ();
+ };
+ vbox.PackStart (tagNameEntry);
+
+ vbox.PackStart (new Xwt.Label (GettextCatalog.GetString ("Tag Message")));
+
+ tagMessageEntry = new Xwt.TextEntry ();
+ vbox.PackStart (tagMessageEntry);
+
+ revisionList = new Xwt.ListView ();
+ messageField = new Xwt.DataField<string> ();
+ dateField = new Xwt.DataField<string> ();
+ authorField = new Xwt.DataField<string> ();
+ shaField = new Xwt.DataField<string> ();
+ revisionField = new Xwt.DataField<Revision> ();
+
+ revisionStore = new Xwt.ListStore (messageField, dateField, authorField, shaField, revisionField);
+ revisionList.DataSource = revisionStore;
+
+ messageColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Message"), new Xwt.TextCellView (messageField) { Ellipsize = Xwt.EllipsizeMode.End });
+ revisionList.Columns.Add (messageColumn);
+ dateColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Date"), new Xwt.TextCellView (dateField));
+ revisionList.Columns.Add (dateColumn);
+ authorColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Author"), new Xwt.TextCellView (authorField));
+ revisionList.Columns.Add (authorColumn);
+ shaColumn = new Xwt.ListViewColumn (GettextCatalog.GetString ("Revision"), new Xwt.TextCellView (shaField));
+ revisionList.Columns.Add (shaColumn);
+
+ var history = repo.GetHistory (repo.RootPath, null);
+ var min = Math.Min (history.Length, 150);
+ for (int i = 0; i < min; ++i) {
+ var rev = history [i];
+
+ // Convert to foreach and use i = AddRow ();
+ revisionStore.AddRow ();
+ revisionStore.SetValue (i, messageField, rev.ShortMessage);
+ revisionStore.SetValue (i, dateField, ParseDate (rev.Time));
+ revisionStore.SetValue (i, authorField, rev.Author);
+ revisionStore.SetValue (i, shaField, ((GitRevision)rev).ShortName);
+ revisionStore.SetValue (i, revisionField, rev);
+ }
+
+ revisionList.SelectionChanged += delegate {
+ CheckSensitive ();
+ };
+
+ vbox.PackStart (revisionList, true, true);
+
+ Content = vbox;
+
+ buttonOk = new Xwt.DialogButton (Xwt.Command.Ok) {
+ Sensitive = false
+ };
+ Buttons.Add (buttonOk);
+ Buttons.Add (new Xwt.DialogButton (Xwt.Command.Cancel));
+ }
+
+ void CheckSensitive ()
+ {
+ if (!String.IsNullOrWhiteSpace (tagNameEntry.Text) && GitUtil.IsValidBranchName (tagNameEntry.Text) &&
+ revisionList.SelectedRow != -1) {
+ buttonOk.Sensitive = true;
+ return;
+ }
+ buttonOk.Sensitive = false;
+ }
+
+ static string ParseDate (DateTime date)
+ {
+ var sb = new StringBuilder (date.ToShortDateString ());
+ sb.AppendFormat (" {0}", date.ToString ("HH:MM"));
+
+ return sb.ToString ();
+ }
+
+ internal string TagName {
+ get { return tagNameEntry.Text; }
+ }
+
+ internal string TagMessage {
+ get { return tagMessageEntry.Text; }
+ }
+
+ internal Revision SelectedRevision {
+ get { return revisionStore.GetValue (revisionList.SelectedRow, revisionField); }
+ }
+ }
+}
+
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitUtil.cs
===================================================================
@@ -37,6 +37,7 @@
using NGit.Transport;
using NGit.Diff;
using NGit.Internal;
+using System;
namespace MonoDevelop.VersionControl.Git
{
@@ -372,6 +373,20 @@ internal static bool IsGitRepository (this FilePath path)
var newPath = path.Combine (".git");
return Directory.Exists (newPath) && Directory.Exists (newPath.Combine ("objects")) && Directory.Exists (newPath.Combine ("refs"));
}
+
+ public static bool IsValidBranchName (string name)
+ {
+ // List from: https://github.com/git/git/blob/master/refs.c#L21
+ if (name.StartsWith (".", StringComparison.Ordinal) ||
+ name.EndsWith ("/", StringComparison.Ordinal) ||
+ name.EndsWith (".lock", StringComparison.Ordinal))
+ return false;
+
+ if (name.Contains (" ") || name.Contains ("~") || name.Contains ("..") || name.Contains ("^") ||
+ name.Contains (":") || name.Contains ("\\") || name.Contains ("?") || name.Contains ("["))
+ return false;
+ return true;
+ }
}
}
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/MonoDevelop.VersionControl.Git.GitConfigurationDialog.cs
===================================================================
@@ -15,6 +15,15 @@ public partial class GitConfigurationDialog
private global::Gtk.Button buttonRemoveBranch;
private global::Gtk.Button buttonSetDefaultBranch;
private global::Gtk.Label label1;
+ private global::Gtk.VBox vbox6;
+ private global::Gtk.HBox hbox3;
+ private global::Gtk.ScrolledWindow GtkScrolledWindow2;
+ private global::Gtk.TreeView listTags;
+ private global::Gtk.VBox vbox7;
+ private global::Gtk.Button buttonAddTag;
+ private global::Gtk.Button buttonPushTag;
+ private global::Gtk.Button buttonRemoveTag;
+ private global::Gtk.Label label5;
private global::Gtk.VBox vbox4;
private global::Gtk.HBox hbox2;
private global::Gtk.ScrolledWindow GtkScrolledWindow1;
@@ -27,7 +36,7 @@ public partial class GitConfigurationDialog
private global::Gtk.Button buttonTrackRemote;
private global::Gtk.Label label2;
private global::Gtk.Button buttonOk;
-
+
protected virtual void Build ()
{
global::Stetic.Gui.Initialize (this);
@@ -133,6 +142,83 @@ protected virtual void Build ()
this.notebook1.SetTabLabel (this.vbox2, this.label1);
this.label1.ShowAll ();
// Container child notebook1.Gtk.Notebook+NotebookChild
+ this.vbox6 = new global::Gtk.VBox ();
+ this.vbox6.Name = "vbox6";
+ this.vbox6.Spacing = 6;
+ this.vbox6.BorderWidth = ((uint)(9));
+ // Container child vbox6.Gtk.Box+BoxChild
+ this.hbox3 = new global::Gtk.HBox ();
+ this.hbox3.Name = "hbox3";
+ this.hbox3.Spacing = 6;
+ // Container child hbox3.Gtk.Box+BoxChild
+ this.GtkScrolledWindow2 = new global::Gtk.ScrolledWindow ();
+ this.GtkScrolledWindow2.Name = "GtkScrolledWindow2";
+ this.GtkScrolledWindow2.ShadowType = ((global::Gtk.ShadowType)(1));
+ // Container child GtkScrolledWindow2.Gtk.Container+ContainerChild
+ this.listTags = new global::Gtk.TreeView ();
+ this.listTags.CanFocus = true;
+ this.listTags.Name = "listTags";
+ this.GtkScrolledWindow2.Add (this.listTags);
+ this.hbox3.Add (this.GtkScrolledWindow2);
+ global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.GtkScrolledWindow2]));
+ w12.Position = 0;
+ // Container child hbox3.Gtk.Box+BoxChild
+ this.vbox7 = new global::Gtk.VBox ();
+ this.vbox7.Name = "vbox7";
+ this.vbox7.Spacing = 6;
+ // Container child vbox7.Gtk.Box+BoxChild
+ this.buttonAddTag = new global::Gtk.Button ();
+ this.buttonAddTag.CanFocus = true;
+ this.buttonAddTag.Name = "buttonAddTag";
+ this.buttonAddTag.UseStock = true;
+ this.buttonAddTag.UseUnderline = true;
+ this.buttonAddTag.Label = "gtk-new";
+ this.vbox7.Add (this.buttonAddTag);
+ global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox7 [this.buttonAddTag]));
+ w13.Position = 0;
+ w13.Expand = false;
+ w13.Fill = false;
+ // Container child vbox7.Gtk.Box+BoxChild
+ this.buttonPushTag = new global::Gtk.Button ();
+ this.buttonPushTag.CanFocus = true;
+ this.buttonPushTag.Name = "buttonPushTag";
+ this.buttonPushTag.UseUnderline = true;
+ this.buttonPushTag.Label = global::Mono.Unix.Catalog.GetString ("_Push");
+ this.vbox7.Add (this.buttonPushTag);
+ global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox7 [this.buttonPushTag]));
+ w14.Position = 1;
+ w14.Expand = false;
+ w14.Fill = false;
+ // Container child vbox7.Gtk.Box+BoxChild
+ this.buttonRemoveTag = new global::Gtk.Button ();
+ this.buttonRemoveTag.CanFocus = true;
+ this.buttonRemoveTag.Name = "buttonRemoveTag";
+ this.buttonRemoveTag.UseStock = true;
+ this.buttonRemoveTag.UseUnderline = true;
+ this.buttonRemoveTag.Label = "gtk-delete";
+ this.vbox7.Add (this.buttonRemoveTag);
+ global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox7 [this.buttonRemoveTag]));
+ w15.Position = 2;
+ w15.Expand = false;
+ w15.Fill = false;
+ this.hbox3.Add (this.vbox7);
+ global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.hbox3 [this.vbox7]));
+ w16.Position = 1;
+ w16.Expand = false;
+ w16.Fill = false;
+ this.vbox6.Add (this.hbox3);
+ global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox6 [this.hbox3]));
+ w17.Position = 0;
+ this.notebook1.Add (this.vbox6);
+ global::Gtk.Notebook.NotebookChild w18 = ((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.vbox6]));
+ w18.Position = 1;
+ // Notebook tab
+ this.label5 = new global::Gtk.Label ();
+ this.label5.Name = "label5";
+ this.label5.LabelProp = global::Mono.Unix.Catalog.GetString ("Tags");
+ this.notebook1.SetTabLabel (this.vbox6, this.label5);
+ this.label5.ShowAll ();
+ // Container child notebook1.Gtk.Notebook+NotebookChild
this.vbox4 = new global::Gtk.VBox ();
this.vbox4.Name = "vbox4";
this.vbox4.Spacing = 6;
@@ -151,8 +237,8 @@ protected virtual void Build ()
this.treeRemotes.Name = "treeRemotes";
this.GtkScrolledWindow1.Add (this.treeRemotes);
this.hbox2.Add (this.GtkScrolledWindow1);
- global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.GtkScrolledWindow1]));
- w12.Position = 0;
+ global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.GtkScrolledWindow1]));
+ w20.Position = 0;
// Container child hbox2.Gtk.Box+BoxChild
this.vbox5 = new global::Gtk.VBox ();
this.vbox5.Name = "vbox5";
@@ -165,10 +251,10 @@ protected virtual void Build ()
this.buttonAddRemote.UseUnderline = true;
this.buttonAddRemote.Label = "gtk-add";
this.vbox5.Add (this.buttonAddRemote);
- global::Gtk.Box.BoxChild w13 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.buttonAddRemote]));
- w13.Position = 0;
- w13.Expand = false;
- w13.Fill = false;
+ global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.buttonAddRemote]));
+ w21.Position = 0;
+ w21.Expand = false;
+ w21.Fill = false;
// Container child vbox5.Gtk.Box+BoxChild
this.buttonEditRemote = new global::Gtk.Button ();
this.buttonEditRemote.CanFocus = true;
@@ -177,10 +263,10 @@ protected virtual void Build ()
this.buttonEditRemote.UseUnderline = true;
this.buttonEditRemote.Label = "gtk-edit";
this.vbox5.Add (this.buttonEditRemote);
- global::Gtk.Box.BoxChild w14 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.buttonEditRemote]));
- w14.Position = 1;
- w14.Expand = false;
- w14.Fill = false;
+ global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.buttonEditRemote]));
+ w22.Position = 1;
+ w22.Expand = false;
+ w22.Fill = false;
// Container child vbox5.Gtk.Box+BoxChild
this.buttonRemoveRemote = new global::Gtk.Button ();
this.buttonRemoveRemote.CanFocus = true;
@@ -189,18 +275,18 @@ protected virtual void Build ()
this.buttonRemoveRemote.UseUnderline = true;
this.buttonRemoveRemote.Label = "gtk-remove";
this.vbox5.Add (this.buttonRemoveRemote);
- global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.buttonRemoveRemote]));
- w15.Position = 2;
- w15.Expand = false;
- w15.Fill = false;
+ global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.buttonRemoveRemote]));
+ w23.Position = 2;
+ w23.Expand = false;
+ w23.Fill = false;
// Container child vbox5.Gtk.Box+BoxChild
this.hseparator2 = new global::Gtk.HSeparator ();
this.hseparator2.Name = "hseparator2";
this.vbox5.Add (this.hseparator2);
- global::Gtk.Box.BoxChild w16 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hseparator2]));
- w16.Position = 3;
- w16.Expand = false;
- w16.Fill = false;
+ global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.hseparator2]));
+ w24.Position = 3;
+ w24.Expand = false;
+ w24.Fill = false;
// Container child vbox5.Gtk.Box+BoxChild
this.buttonTrackRemote = new global::Gtk.Button ();
this.buttonTrackRemote.CanFocus = true;
@@ -208,21 +294,21 @@ protected virtual void Build ()
this.buttonTrackRemote.UseUnderline = true;
this.buttonTrackRemote.Label = global::Mono.Unix.Catalog.GetString ("Track in Local Branch");
this.vbox5.Add (this.buttonTrackRemote);
- global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.buttonTrackRemote]));
- w17.Position = 4;
- w17.Expand = false;
- w17.Fill = false;
+ global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.vbox5 [this.buttonTrackRemote]));
+ w25.Position = 4;
+ w25.Expand = false;
+ w25.Fill = false;
this.hbox2.Add (this.vbox5);
- global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.vbox5]));
- w18.Position = 1;
- w18.Expand = false;
- w18.Fill = false;
+ global::Gtk.Box.BoxChild w26 = ((global::Gtk.Box.BoxChild)(this.hbox2 [this.vbox5]));
+ w26.Position = 1;
+ w26.Expand = false;
+ w26.Fill = false;
this.vbox4.Add (this.hbox2);
- global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.hbox2]));
- w19.Position = 0;
+ global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(this.vbox4 [this.hbox2]));
+ w27.Position = 0;
this.notebook1.Add (this.vbox4);
- global::Gtk.Notebook.NotebookChild w20 = ((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.vbox4]));
- w20.Position = 1;
+ global::Gtk.Notebook.NotebookChild w28 = ((global::Gtk.Notebook.NotebookChild)(this.notebook1 [this.vbox4]));
+ w28.Position = 2;
// Notebook tab
this.label2 = new global::Gtk.Label ();
this.label2.Name = "label2";
@@ -230,14 +316,14 @@ protected virtual void Build ()
this.notebook1.SetTabLabel (this.vbox4, this.label2);
this.label2.ShowAll ();
w1.Add (this.notebook1);
- global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(w1 [this.notebook1]));
- w21.Position = 0;
+ global::Gtk.Box.BoxChild w29 = ((global::Gtk.Box.BoxChild)(w1 [this.notebook1]));
+ w29.Position = 0;
// Internal child MonoDevelop.VersionControl.Git.GitConfigurationDialog.ActionArea
- global::Gtk.HButtonBox w22 = this.ActionArea;
- w22.Name = "dialog1_ActionArea";
- w22.Spacing = 10;
- w22.BorderWidth = ((uint)(5));
- w22.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
+ global::Gtk.HButtonBox w30 = this.ActionArea;
+ w30.Name = "dialog1_ActionArea";
+ w30.Spacing = 10;
+ w30.BorderWidth = ((uint)(5));
+ w30.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
this.buttonOk = new global::Gtk.Button ();
this.buttonOk.CanDefault = true;
@@ -247,9 +333,9 @@ protected virtual void Build ()
this.buttonOk.UseUnderline = true;
this.buttonOk.Label = "gtk-close";
this.AddActionWidget (this.buttonOk, -7);
- global::Gtk.ButtonBox.ButtonBoxChild w23 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w22 [this.buttonOk]));
- w23.Expand = false;
- w23.Fill = false;
+ global::Gtk.ButtonBox.ButtonBoxChild w31 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w30 [this.buttonOk]));
+ w31.Expand = false;
+ w31.Fill = false;
if ((this.Child != null)) {
this.Child.ShowAll ();
}
@@ -260,6 +346,9 @@ protected virtual void Build ()
this.buttonEditBranch.Clicked += new global::System.EventHandler (this.OnButtonEditBranchClicked);
this.buttonRemoveBranch.Clicked += new global::System.EventHandler (this.OnButtonRemoveBranchClicked);
this.buttonSetDefaultBranch.Clicked += new global::System.EventHandler (this.OnButtonSetDefaultBranchClicked);
+ this.buttonAddTag.Clicked += new global::System.EventHandler (this.OnButtonNewTagClicked);
+ this.buttonPushTag.Clicked += new global::System.EventHandler (this.OnButtonPushTagClicked);
+ this.buttonRemoveTag.Clicked += new global::System.EventHandler (this.OnButtonRemoveTagClicked);
this.buttonAddRemote.Clicked += new global::System.EventHandler (this.OnButtonAddRemoteClicked);
this.buttonEditRemote.Clicked += new global::System.EventHandler (this.OnButtonEditRemoteClicked);
this.buttonRemoveRemote.Clicked += new global::System.EventHandler (this.OnButtonRemoveRemoteClicked);
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/gtk-gui/gui.stetic
===================================================================
@@ -571,6 +571,112 @@
</packing>
</child>
<child>
+ <widget class="Gtk.VBox" id="vbox6">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <property name="BorderWidth">9</property>
+ <child>
+ <widget class="Gtk.HBox" id="hbox3">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow2">
+ <property name="MemberName" />
+ <property name="ShadowType">In</property>
+ <child>
+ <widget class="Gtk.TreeView" id="listTags">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="ShowScrollbars">True</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.VBox" id="vbox7">
+ <property name="MemberName" />
+ <property name="Spacing">6</property>
+ <child>
+ <widget class="Gtk.Button" id="buttonAddTag">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="UseStock">True</property>
+ <property name="Type">StockItem</property>
+ <property name="StockId">gtk-new</property>
+ <signal name="Clicked" handler="OnButtonNewTagClicked" />
+ <property name="label">gtk-new</property>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="buttonPushTag">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="Type">TextOnly</property>
+ <property name="Label" translatable="yes">_Push All Tags</property>
+ <property name="UseUnderline">True</property>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Button" id="buttonRemoveTag">
+ <property name="MemberName" />
+ <property name="CanFocus">True</property>
+ <property name="UseStock">True</property>
+ <property name="Type">StockItem</property>
+ <property name="StockId">gtk-delete</property>
+ <property name="label">gtk-delete</property>
+ </widget>
+ <packing>
+ <property name="Position">2</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ <property name="AutoSize">True</property>
+ <property name="Expand">False</property>
+ <property name="Fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">0</property>
+ <property name="AutoSize">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="Position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="Gtk.Label" id="label5">
+ <property name="MemberName" />
+ <property name="LabelProp" translatable="yes">Tags</property>
+ </widget>
+ <packing>
+ <property name="type">tab</property>
+ </packing>
+ </child>
+ <child>
<widget class="Gtk.VBox" id="vbox4">
<property name="MemberName" />
<property name="Spacing">6</property>
@@ -694,7 +800,7 @@
</child>
</widget>
<packing>
- <property name="Position">1</property>
+ <property name="Position">2</property>
</packing>
</child>
<child>
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/SubviewAttachmentHandler.cs
===================================================================
@@ -29,7 +29,7 @@
using Mono.Addins;
using MonoDevelop.VersionControl;
using MonoDevelop.Ide.Gui;
-using MonoDevelop.Core.LogReporting;
+using MonoDevelop.Core;
using MonoDevelop.Projects;
namespace MonoDevelop.VersionControl.Views
@@ -79,7 +79,7 @@ void HandleDocumentChanged (object sender, EventArgs e)
// If a user is hitting this, it will show a dialog box every time they
// switch to a document or open a document, so suppress the crash dialog
// This bug *should* be fixed already, but it's hard to tell.
- LogReportingService.ReportUnhandledException (ex, false, true);
+ LoggingService.LogInternalError (ex);
}
}
Modified: main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UrlBasedRepository.cs
===================================================================
@@ -40,11 +40,7 @@ void ICustomDataItem.Deserialize (ITypeSerializer handler, DataCollection data)
void CreateUri ()
{
- try {
- uri = new Uri (url);
- } catch {
- uri = null;
- }
+ uri = url != null ? new Uri (url) : null;
}
public override void CopyConfigurationFrom (Repository other)
Modified: main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/ColorScheme.cs
===================================================================
@@ -83,6 +83,9 @@ public class ColorScheme
[ColorDescription("Tooltip Pager Text")]
public AmbientColor TooltipPagerText { get; private set; }
+ [ColorDescription("Notification Border")]
+ public AmbientColor NotificationBorder { get; private set; }
+
[ColorDescription("Bookmarks")]
public AmbientColor Bookmarks { get; private set; }
@@ -281,6 +284,9 @@ public class ColorScheme
[ColorDescription("Tooltip Text")] // not defined in vs.net
public ChunkStyle TooltipText { get; private set; }
+ [ColorDescription("Notification Text")] // not defined in vs.net
+ public ChunkStyle NotificationText { get; private set; }
+
[ColorDescription("Completion Text")] //not defined in vs.net
public ChunkStyle CompletionText { get; private set; }
Modified: main/src/core/Mono.Texteditor/Mono.TextEditor/Actions/ClipboardActions.cs
===================================================================
@@ -312,7 +312,7 @@ static int PasteFrom (Clipboard clipboard, TextEditorData data, bool preserveSel
if (delimiter.IsInvalid)
break;
- int delimiterEndOffset = delimiter.Offset + delimiter.Length;
+ int delimiterEndOffset = delimiter.EndOffset;
lines.Add (text.Substring (offset, delimiter.Offset - offset));
offset = delimiterEndOffset;
}
Modified: main/src/core/Mono.Texteditor/Mono.TextEditor/Document/ILineSplitter.cs
===================================================================
@@ -8,6 +8,14 @@ public interface ILineSplitter
{
int Count { get; }
+ /// <summary>
+ /// True if during initialization a line ending mismatch was encountered.
+ /// </summary>
+ bool LineEndingMismatch {
+ get;
+ set;
+ }
+
IEnumerable<DocumentLine> Lines { get; }
void Clear ();
Modified: main/src/core/Mono.Texteditor/Mono.TextEditor/Document/LineSplitter.cs
===================================================================
@@ -131,23 +131,31 @@ public void TextRemove (int offset, int length)
ChangeLength (startNode, startNode.LengthIncludingDelimiter - charsRemoved + charsLeft, endNode.DelimiterLength);
}
+ public bool LineEndingMismatch {
+ get;
+ set;
+ }
+
//bool inInit;
public void Initalize (string text)
{
+ LineEndingMismatch = false;
Clear ();
if (string.IsNullOrEmpty (text))
return;
var nodes = new List<TreeNode> ();
+ var delimiterType = UnicodeNewline.Unknown;
int offset = 0;
while (true) {
var delimiter = NextDelimiter (text, offset);
if (delimiter.IsInvalid)
break;
-
int delimiterEndOffset = delimiter.Offset + delimiter.Length;
var newLine = new TreeNode (delimiterEndOffset - offset, delimiter.Length);
nodes.Add (newLine);
+ if (offset > 0 && delimiterType != delimiter.UnicodeNewline)
+ LineEndingMismatch = true;
offset = delimiterEndOffset;
}
var lastLine = new TreeNode (text.Length - offset, 0);
@@ -219,7 +227,13 @@ internal struct Delimiter
public static readonly Delimiter Invalid = new Delimiter (-1, 0);
public readonly int Offset;
- public readonly int Length;
+ public readonly UnicodeNewline UnicodeNewline;
+
+ public int Length {
+ get {
+ return UnicodeNewline == UnicodeNewline.CRLF ? 2 : 1;
+ }
+ }
public int EndOffset {
get { return Offset + Length; }
@@ -231,10 +245,10 @@ internal struct Delimiter
}
}
- public Delimiter (int offset, int length)
+ public Delimiter (int offset, UnicodeNewline unicodeNewline)
{
Offset = offset;
- Length = length;
+ UnicodeNewline = unicodeNewline;
}
}
@@ -243,12 +257,13 @@ static unsafe internal Delimiter NextDelimiter (string text, int offset)
fixed (char* start = text) {
char* p = start + offset;
char* endPtr = start + text.Length;
+
while (p < endPtr) {
char* nextp = p + 1;
char nextChar = nextp < endPtr ? *nextp : '\0';
- var nl = NewLine.GetDelimiterLength (*p, nextChar);
- if (nl > 0)
- return new Delimiter ((int)(p - start), nl);
+ var type = NewLine.GetDelimiterType (*p, nextChar);
+ if (type != UnicodeNewline.Unknown)
+ return new Delimiter ((int)(p - start), type);
p++;
}
return Delimiter.Invalid;
Modified: main/src/core/Mono.Texteditor/Mono.TextEditor/Document/PrimitiveLineSplitter.cs
===================================================================
@@ -45,6 +45,11 @@ public PrimitiveLineSegment (PrimitiveLineSplitter splitter, int lineNumber, int
}
}
+ public bool LineEndingMismatch {
+ get;
+ set;
+ }
+
public int Count {
get { return delimiters.Count + 1; }
}
Modified: main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs
===================================================================
@@ -125,6 +125,15 @@ protected virtual void OnSyntaxModeChanged (Mono.TextEditor.SyntaxModeChangeEven
get;
set;
}
+
+ public bool HasLineEndingMismatchOnTextSet {
+ get {
+ return splitter.LineEndingMismatch;
+ }
+ set {
+ splitter.LineEndingMismatch = value;
+ }
+ }
protected TextDocument (IBuffer buffer,ILineSplitter splitter)
{
@@ -755,7 +764,7 @@ public void OptimizeTypedUndo ()
undoStack.Push (keyUndo);
keyUndo = new KeyboardStackUndo ();
}
- if (keyUndo.Args != null && keyUndo.Args.Offset + 1 != top.Args.Offset) {
+ if (keyUndo.Args != null && keyUndo.Args.Offset + 1 != top.Args.Offset || !char.IsLetterOrDigit (top.Args.InsertedText.GetCharAt (0))) {
keyUndo.IsClosed = true;
undoStack.Push (keyUndo);
keyUndo = new KeyboardStackUndo ();
Modified: main/src/core/Mono.Texteditor/Mono.TextEditor/UrlMarker.cs
===================================================================
@@ -27,6 +27,7 @@
using System;
using Gdk;
using Mono.TextEditor.Highlighting;
+using Gtk;
namespace Mono.TextEditor
{
@@ -121,11 +122,13 @@ public override void Draw (TextEditor editor, Cairo.Context cr, double y, LineMe
} else {
int start = startOffset < markerStart ? markerStart : startOffset;
int end = endOffset < markerEnd ? endOffset : markerEnd;
- int x_pos = layout.IndexToPos (start - startOffset).X;
-
+
+ uint curIndex = 0, byteIndex = 0;
+ int x_pos = layout.IndexToPos ((int)metrics.Layout.TranslateToUTF8Index ((uint)(start - startOffset), ref curIndex, ref byteIndex)).X;
+
@from = startXPos + (int)(x_pos / Pango.Scale.PangoScale);
- x_pos = layout.IndexToPos (end - startOffset).X;
+ x_pos = layout.IndexToPos ((int)metrics.Layout.TranslateToUTF8Index ((uint)(end - startOffset), ref curIndex, ref byteIndex)).X;
to = startXPos + (int)(x_pos / Pango.Scale.PangoScale);
}
Modified: main/src/core/Mono.Texteditor/Styles/DefaultStyle.json
===================================================================
@@ -57,6 +57,8 @@
{ "name": "Tooltip Pager Triangle", "color":"#737373" },
{ "name": "Tooltip Pager Text", "color":"#828282" },
+ { "name": "Notification Border", "color":"#D2B457" },
+
{ "name": "Completion Matching Substring", "color":"#BA3373" },
{ "name": "Completion Border", "color":"#C9C9C9" },
{ "name": "Completion Border(Inactive)", "color":"#666666" },
@@ -153,6 +155,7 @@
{ "name": "Razor Code", "fore":"text-black", "back":"#fdfaed" },
{ "name": "Tooltip Text", "fore":"text-black", "back":"#feffe9" },
+ { "name": "Notification Text", "fore":"text-black", "back":"#feffe9" },
{ "name": "Completion Text", "fore":"#434343", "back":"#F0F6F8" },
{ "name": "Completion Selected Text", "fore":"#f8fcfc", "back":"#dff4f0" },
Modified: main/src/core/Mono.Texteditor/Styles/MonokaiStyle.json
===================================================================
@@ -45,6 +45,7 @@
{ "name": "Tooltip Pager Triangle", "color":"#C8C8C2" },
{ "name": "Tooltip Pager Text", "color":"#C8C8C2" },
+ { "name": "Notification Border", "color":"#989892" },
{ "name": "Completion Matching Substring", "color":"#BA3373" },
{ "name": "Completion Border", "color":"#C9C9C9" },
@@ -141,7 +142,8 @@
{ "name": "Html Tag Delimiter", "fore":"monokai-white" },
{ "name": "Razor Code", "fore":"monokai-white", "back":"#373832" },
- { "name": "Tooltip Text", "fore":"black", "back":"#272725" },
+ { "name": "Tooltip Text", "fore":"monokai-white", "back":"#272725" },
+ { "name": "Notification Text", "fore":"monokai-white", "back":"#272725" },
{ "name": "Completion Text", "fore":"#434343", "back":"#F0F6F8" },
{ "name": "Completion Selected Text", "fore":"#f8fcfc", "back":"#dff4f0" },
Modified: main/src/core/Mono.Texteditor/Styles/NightshadeStyle.json
===================================================================
@@ -82,6 +82,8 @@
{ "name": "Tooltip Pager Triangle", "color":"NormalVim" },
{ "name": "Tooltip Pager Text", "color":"NormalVim" },
+ { "name": "Notification Border", "color":"#989892" },
+
{ "name": "Completion Matching Substring", "color":"#BA3373" },
{ "name": "Completion Border", "color":"#C9C9C9" },
{ "name": "Completion Border(Inactive)", "color":"#666666" },
@@ -179,6 +181,7 @@
{ "name": "Razor Code", "fore":"NormalVim", "back":"aluminium6" },
{ "name": "Tooltip Text", "fore":"NormalVim", "back":"#0a0a0a" },
+ { "name": "Notification Text", "fore":"NormalVim", "back":"#0a0a0a" },
{ "name": "Completion Text", "fore":"#434343", "back":"#F0F6F8" },
{ "name": "Completion Selected Text", "fore":"#f8fcfc", "back":"#dff4f0" },
Modified: main/src/core/Mono.Texteditor/Styles/OblivionStyle.json
===================================================================
@@ -57,6 +57,8 @@
{ "name": "Tooltip Pager Triangle", "color":"aluminium2" },
{ "name": "Tooltip Pager Text", "color":"aluminium2" },
+ { "name": "Notification Border", "color":"aluminium1" },
+
{ "name": "Completion Matching Substring", "color":"#BA3373" },
{ "name": "Completion Border", "color":"#C9C9C9" },
{ "name": "Completion Border(Inactive)", "color":"#bebebe" },
@@ -153,6 +155,7 @@
{ "name": "Razor Code", "fore":"aluminium2", "back":"aluminium7" },
{ "name": "Tooltip Text", "fore":"aluminium2", "back":"aluminium5" },
+ { "name": "Notification Text", "fore":"aluminium2", "back":"aluminium5" },
{ "name": "Completion Text", "fore":"#434343", "back":"#F0F6F8" },
{ "name": "Completion Selected Text", "fore":"#f8fcfc", "back":"#dff4f0" },
Modified: main/src/core/Mono.Texteditor/Styles/SolarizedDarkStyle.json
===================================================================
@@ -46,6 +46,8 @@
{ "name": "Tooltip Pager Triangle", "color":"base00" },
{ "name": "Tooltip Pager Text", "color":"base00" },
+ { "name": "Notification Border", "color":"base1" },
+
{ "name": "Completion Matching Substring", "color":"#BA3373" },
{ "name": "Completion Border", "color":"#C9C9C9" },
{ "name": "Completion Border(Inactive)", "color":"#bebebe" },
@@ -142,6 +144,7 @@
{ "name": "Razor Code", "fore":"black", "back":"base02" },
{ "name": "Tooltip Text", "fore":"black", "back":"#feffe9" },
+ { "name": "Notification Text", "fore":"black", "back":"#feffe9" },
{ "name": "Completion Text", "fore":"#434343", "back":"#F0F6F8" },
{ "name": "Completion Selected Text", "fore":"#f8fcfc", "back":"#dff4f0" },
Modified: main/src/core/Mono.Texteditor/Styles/SolarizedLightStyle.json
===================================================================
@@ -46,6 +46,8 @@
{ "name": "Tooltip Pager Triangle", "color":"base00" },
{ "name": "Tooltip Pager Text", "color":"base00" },
+ { "name": "Notification Border", "color":"base1" },
+
{ "name": "Completion Matching Substring", "color":"#BA3373" },
{ "name": "Completion Border", "color":"#C9C9C9" },
{ "name": "Completion Border(Inactive)", "color":"#bebebe" },
@@ -142,6 +144,7 @@
{ "name": "Razor Code", "fore":"black", "back":"base2" },
{ "name": "Tooltip Text", "fore":"black", "back":"#feffe9" },
+ { "name": "Notification Text", "fore":"black", "back":"#feffe9" },
{ "name": "Completion Text", "fore":"#434343", "back":"#F0F6F8" },
{ "name": "Completion Selected Text", "fore":"#f8fcfc", "back":"#dff4f0" },
Modified: main/src/core/Mono.Texteditor/Styles/TangoStyle.json
===================================================================
@@ -57,6 +57,7 @@
{ "name": "Tooltip Pager Triangle", "color":"#737373" },
{ "name": "Tooltip Pager Text", "color":"#828282" },
+ { "name": "Notification Border", "color":"#b2b2b2" },
{ "name": "Completion Matching Substring", "color":"#BA3373" },
{ "name": "Completion Border", "color":"#C9C9C9" },
@@ -140,6 +141,7 @@
{ "name": "Razor Code", "fore":"black", "back":"#fdfaed" },
{ "name": "Tooltip Text", "fore":"black", "back":"#feffe9" },
+ { "name": "Notification Text", "fore":"black", "back":"#feffe9" },
{ "name": "Completion Text", "fore":"#434343", "back":"#F0F6F8" },
{ "name": "Completion Selected Text", "fore":"#f8fcfc", "back":"#dff4f0" },
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/TargetRuntime.cs
===================================================================
@@ -388,7 +388,6 @@ void BackgroundInitialize (object state)
try {
RunInitialization ();
} catch (Exception ex) {
- LogReporting.LogReportingService.ReportUnhandledException (ex, false);
LoggingService.LogFatalError ("Unhandled exception in SystemAssemblyService background initialisation thread.", ex);
} finally {
lock (initEventLock) {
@@ -621,4 +620,4 @@ static TargetFramework ReadTargetFramework (TargetFrameworkMoniker moniker, File
return null;
}
}
-}
\ No newline at end of file
+}
Removed: main/src/core/MonoDevelop.Core/MonoDevelop.Core.LogReporting/LogReportingService.cs
===================================================================
@@ -1,196 +0,0 @@
-//
-// LogReportingService.cs
-//
-// Author:
-// Alan McGovern <[email protected]>
-//
-// Copyright (c) 2011 Alan McGovern
-//
-// 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 System.IO;
-using System.Threading;
-using System.Net;
-using System.Web;
-using System.IO.Compression;
-
-namespace MonoDevelop.Core.LogReporting
-{
- public static class LogReportingService
- {
- const string ServiceVersion = "1";
- public static readonly FilePath CrashLogDirectory = UserProfile.Current.LogDir.Combine ("LogAgent");
-
- const string ReportCrashesKey = "MonoDevelop.LogAgent.ReportCrashes";
- const string ReportUsageKey = "MonoDevelop.LogAgent.ReportUsage";
-
- static int CrashId;
- static int Processing;
-
- // Return value is the new value for 'ReportCrashes'
- // First parameter is the current value of 'ReportCrashes
- // Second parameter is the exception
- // Thirdparameter shows if the exception is fatal or not
- public static Func<bool?, Exception, bool, bool?> UnhandledErrorOccured;
-
- public static bool? ReportCrashes {
- get { return PropertyService.Get<bool?> (ReportCrashesKey); }
- set { PropertyService.Set (ReportCrashesKey, value); }
- }
-
- public static bool? ReportUsage {
- get { return PropertyService.Get<bool?> (ReportUsageKey); }
- set { PropertyService.Set (ReportUsageKey, value); }
- }
-
- public static void ReportUnhandledException (Exception ex, bool willShutDown)
- {
- ReportUnhandledException (ex, willShutDown, false);
- }
-
- static bool reporting;
-
- public static void ReportUnhandledException (Exception ex, bool willShutDown, bool silently)
- {
- if (reporting)
- return;
-
- reporting = true;
- try {
- var oldReportCrashes = ReportCrashes;
-
- if (UnhandledErrorOccured != null && !silently)
- ReportCrashes = UnhandledErrorOccured (ReportCrashes, ex, willShutDown);
-
- // If crash reporting has been explicitly disabled, disregard this crash
- if (ReportCrashes.HasValue && !ReportCrashes.Value)
- return;
-
- byte[] data;
- using (var stream = new MemoryStream ()) {
- using (var writer = System.Xml.XmlWriter.Create (stream)) {
- writer.WriteStartElement ("CrashLog");
- writer.WriteAttributeString ("version", ServiceVersion);
-
- writer.WriteElementString ("SystemInformation", SystemInformation.GetTextDescription ());
- writer.WriteElementString ("Exception", ex.ToString ());
-
- writer.WriteEndElement ();
- }
- data = stream.ToArray ();
- }
-
- // Log to disk only if uploading fails.
- var filename = string.Format ("{0}.{1}.{2}.crashlog", DateTime.UtcNow.ToString ("yyyy-MM-dd__HH-mm-ss"), SystemInformation.SessionUuid, Interlocked.Increment (ref CrashId));
- ThreadPool.QueueUserWorkItem (delegate {
- if (!TryUploadReport (filename, data)) {
- if (!Directory.Exists (CrashLogDirectory))
- Directory.CreateDirectory (CrashLogDirectory);
-
- File.WriteAllBytes (CrashLogDirectory.Combine (filename), data);
- }
- });
-
- //ensure we don't lose the setting
- if (ReportCrashes != oldReportCrashes) {
- PropertyService.SaveProperties ();
- }
-
- } finally {
- reporting = false;
- }
- }
-
- public static void ProcessCache ()
- {
- int origValue = -1;
- try {
- // Ensure only 1 thread at a time attempts to upload cached reports
- origValue = Interlocked.CompareExchange (ref Processing, 1, 0);
- if (origValue != 0)
- return;
-
- // Uploading is not enabled, so bail out
- if (!ReportCrashes.GetValueOrDefault ())
- return;
-
- // Definitely no crash reports if this doesn't exist
- if (!Directory.Exists (CrashLogDirectory))
- return;
-
- foreach (var file in Directory.GetFiles (CrashLogDirectory)) {
- if (TryUploadReport (file, File.ReadAllBytes (file)))
- File.Delete (file);
- }
- } catch (Exception ex) {
- LoggingService.LogError ("Exception processing cached crashes", ex);
- } finally {
- if (origValue == 0)
- Interlocked.CompareExchange (ref Processing, 0, 1);
- }
- }
-
- static bool TryUploadReport (string filename, byte[] data)
- {
- try {
- // Empty files won't be accepted by the server as it thinks 'ContentLength' has not been set as it's
- // zero. We don't need empty files anyway.
- if (data.Length == 0)
- return true;
-
- var server = Environment.GetEnvironmentVariable ("MONODEVELOP_CRASHREPORT_SERVER");
- if (string.IsNullOrEmpty (server))
- server = "monodevlog.xamarin.com:35162";
-
- var request = (HttpWebRequest) WebRequest.Create (string.Format ("http://{0}/logagentreport/", server));
- request.Headers.Add ("LogAgentVersion", ServiceVersion);
- request.Headers.Add ("LogAgent_Filename", Path.GetFileName (filename));
- request.Headers.Add ("Content-Encoding", "gzip");
- request.Method = "POST";
-
- // Compress the data and then use the compressed length in ContentLength
- var compressed = new MemoryStream ();
- using (var zipper = new GZipStream (compressed, CompressionMode.Compress))
- zipper.Write (data, 0, data.Length);
- data = compressed.ToArray ();
-
- request.ContentLength = data.Length;
- using (var requestStream = request.GetRequestStream ())
- requestStream.Write (data, 0, data.Length);
-
- LoggingService.LogDebug ("CrashReport sent to server, awaiting response...");
-
- // Ensure the server has correctly processed everything.
- using (var response = (HttpWebResponse) request.GetResponse ()) {
- if (response.StatusCode != HttpStatusCode.OK) {
- LoggingService.LogError ("Server responded with status code {1} and error: {0}", response.StatusDescription, response.StatusCode);
- return false;
- }
- }
- } catch (Exception ex) {
- LoggingService.LogError ("Failed to upload report to the server", ex);
- return false;
- }
-
- LoggingService.LogDebug ("Successfully uploaded crash report");
- return true;
- }
- }
-}
-
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Core.csproj
===================================================================
@@ -427,7 +427,6 @@
<Compile Include="MonoDevelop.Core\UnixSystemInformation.cs" />
<Compile Include="MonoDevelop.Core\ISystemInformationProvider.cs" />
<Compile Include="MonoDevelop.Core.FileSystem\UnixFileSystemExtension.cs" />
- <Compile Include="MonoDevelop.Core.LogReporting\LogReportingService.cs" />
<Compile Include="MonoDevelop.Core.LogReporting\CrashEventArgs.cs" />
<Compile Include="MonoDevelop.Core.LogReporting\CrashMonitor.cs" />
<Compile Include="MonoDevelop.Core.LogReporting\ICrashMonitor.cs" />
@@ -556,6 +555,10 @@
<Project>{2B8F4F83-C2B3-4E84-A27B-8DEE1BE0E006}</Project>
<Name>ICSharpCode.NRefactory.Cecil</Name>
</ProjectReference>
+ <ProjectReference Include="..\..\..\external\raygun4net\Mindscape.Raygun4Net\Mindscape.Raygun4Net.csproj">
+ <Project>{495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}</Project>
+ <Name>Mindscape.Raygun4Net</Name>
+ </ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="MonoDevelop.Core.dll.config">
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Core/FileService.cs
===================================================================
@@ -77,7 +77,7 @@ static void UpdateExtensions ()
return;
}
- FileSystemExtension[] extensions = (FileSystemExtension[]) AddinManager.GetExtensionObjects (addinFileSystemExtensionPath, typeof(FileSystemExtension));
+ var extensions = AddinManager.GetExtensionObjects (addinFileSystemExtensionPath, typeof(FileSystemExtension)).Cast<FileSystemExtension> ().ToArray ();
for (int n=0; n<extensions.Length - 1; n++) {
extensions [n].Next = extensions [n + 1];
}
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Core/LoggingService.cs
===================================================================
@@ -29,20 +29,42 @@
using System;
using System.Collections.Generic;
using System.IO;
+using System.Net;
+using System.Web;
using System.Linq;
+using System.Diagnostics;
+using System.Threading;
+using System.IO.Compression;
+using Mindscape.Raygun4Net;
+using Mindscape.Raygun4Net.Messages;
using MonoDevelop.Core.Logging;
namespace MonoDevelop.Core
{
-
public static class LoggingService
{
+ const string ServiceVersion = "1";
+ const string ReportCrashesKey = "MonoDevelop.LogAgent.ReportCrashes";
+ const string ReportUsageKey = "MonoDevelop.LogAgent.ReportUsage";
+
+ public static readonly FilePath CrashLogDirectory = UserProfile.Current.LogDir.Combine ("LogAgent");
+
+ static RaygunClient raygunClient;
static List<ILogger> loggers = new List<ILogger> ();
static RemoteLogger remoteLogger;
static DateTime timestamp;
static TextWriter defaultError;
static TextWriter defaultOut;
+ static bool reporting;
+ static int CrashId;
+ static int Processing;
+
+ // Return value is the new value for 'ReportCrashes'
+ // First parameter is the current value of 'ReportCrashes
+ // Second parameter is the exception
+ // Thirdparameter shows if the exception is fatal or not
+ public static Func<bool?, Exception, bool, bool?> UnhandledErrorOccured;
static LoggingService ()
{
@@ -78,6 +100,11 @@ static LoggingService ()
timestamp = DateTime.Now;
+ string raygunKey = BrandingService.GetString ("RaygunApiKey");
+ if (raygunKey != null) {
+ raygunClient = new RaygunClient (raygunKey);
+ }
+
//remove the default trace listener on .NET, it throws up horrible dialog boxes for asserts
System.Diagnostics.Debug.Listeners.Clear ();
@@ -85,6 +112,16 @@ static LoggingService ()
System.Diagnostics.Debug.Listeners.Add (new AssertLoggingTraceListener ());
}
+ public static bool? ReportCrashes {
+ get { return PropertyService.Get<bool?> (ReportCrashesKey); }
+ set { PropertyService.Set (ReportCrashesKey, value); }
+ }
+
+ public static bool? ReportUsage {
+ get { return PropertyService.Get<bool?> (ReportUsageKey); }
+ set { PropertyService.Set (ReportUsageKey, value); }
+ }
+
static string GenericLogFile {
get { return "Ide.log"; }
}
@@ -113,6 +150,148 @@ public static void Shutdown ()
RestoreOutputRedirection ();
}
+ internal static void ReportUnhandledException (Exception ex, bool willShutDown)
+ {
+ ReportUnhandledException (ex, willShutDown, false, null);
+ }
+
+ internal static void ReportUnhandledException (Exception ex, bool willShutDown, bool silently)
+ {
+ ReportUnhandledException (ex, willShutDown, silently);
+ }
+
+ internal static void ReportUnhandledException (Exception ex, bool willShutDown, bool silently, string tag)
+ {
+ var tags = new List<string> { tag };
+
+ if (reporting)
+ return;
+
+ reporting = true;
+ try {
+ var oldReportCrashes = ReportCrashes;
+
+ if (UnhandledErrorOccured != null && !silently)
+ ReportCrashes = UnhandledErrorOccured (ReportCrashes, ex, willShutDown);
+
+ // If crash reporting has been explicitly disabled, disregard this crash
+ if (ReportCrashes.HasValue && !ReportCrashes.Value)
+ return;
+
+ byte[] data;
+ using (var stream = new MemoryStream ()) {
+ using (var writer = System.Xml.XmlWriter.Create (stream)) {
+ writer.WriteStartElement ("CrashLog");
+ writer.WriteAttributeString ("version", ServiceVersion);
+
+ writer.WriteElementString ("SystemInformation", SystemInformation.GetTextDescription ());
+ writer.WriteElementString ("Exception", ex.ToString ());
+
+ writer.WriteEndElement ();
+ }
+ data = stream.ToArray ();
+ }
+
+ if (raygunClient != null) {
+ raygunClient.Send (ex, tags);
+ }
+
+ // Log to disk only if uploading fails.
+ var filename = string.Format ("{0}.{1}.{2}.crashlog", DateTime.UtcNow.ToString ("yyyy-MM-dd__HH-mm-ss"), SystemInformation.SessionUuid, Interlocked.Increment (ref CrashId));
+ ThreadPool.QueueUserWorkItem (delegate {
+ if (!TryUploadReport (filename, data)) {
+ if (!Directory.Exists (CrashLogDirectory))
+ Directory.CreateDirectory (CrashLogDirectory);
+
+ File.WriteAllBytes (CrashLogDirectory.Combine (filename), data);
+ }
+ });
+
+ //ensure we don't lose the setting
+ if (ReportCrashes != oldReportCrashes) {
+ PropertyService.SaveProperties ();
+ }
+
+ } finally {
+ reporting = false;
+ }
+ }
+
+ public static void ProcessCache ()
+ {
+ int origValue = -1;
+ try {
+ // Ensure only 1 thread at a time attempts to upload cached reports
+ origValue = Interlocked.CompareExchange (ref Processing, 1, 0);
+ if (origValue != 0)
+ return;
+
+ // Uploading is not enabled, so bail out
+ if (!ReportCrashes.GetValueOrDefault ())
+ return;
+
+ // Definitely no crash reports if this doesn't exist
+ if (!Directory.Exists (CrashLogDirectory))
+ return;
+
+ foreach (var file in Directory.GetFiles (CrashLogDirectory)) {
+ if (TryUploadReport (file, File.ReadAllBytes (file)))
+ File.Delete (file);
+ }
+ } catch (Exception ex) {
+ LoggingService.LogError ("Exception processing cached crashes", ex);
+ } finally {
+ if (origValue == 0)
+ Interlocked.CompareExchange (ref Processing, 0, 1);
+ }
+ }
+
+ static bool TryUploadReport (string filename, byte[] data)
+ {
+ try {
+ // Empty files won't be accepted by the server as it thinks 'ContentLength' has not been set as it's
+ // zero. We don't need empty files anyway.
+ if (data.Length == 0)
+ return true;
+
+ var server = Environment.GetEnvironmentVariable ("MONODEVELOP_CRASHREPORT_SERVER");
+ if (string.IsNullOrEmpty (server))
+ server = "monodevlog.xamarin.com:35162";
+
+ var request = (HttpWebRequest) WebRequest.Create (string.Format ("http://{0}/logagentreport/", server));
+ request.Headers.Add ("LogAgentVersion", ServiceVersion);
+ request.Headers.Add ("LogAgent_Filename", Path.GetFileName (filename));
+ request.Headers.Add ("Content-Encoding", "gzip");
+ request.Method = "POST";
+
+ // Compress the data and then use the compressed length in ContentLength
+ var compressed = new MemoryStream ();
+ using (var zipper = new GZipStream (compressed, CompressionMode.Compress))
+ zipper.Write (data, 0, data.Length);
+ data = compressed.ToArray ();
+
+ request.ContentLength = data.Length;
+ using (var requestStream = request.GetRequestStream ())
+ requestStream.Write (data, 0, data.Length);
+
+ LoggingService.LogDebug ("CrashReport sent to server, awaiting response...");
+
+ // Ensure the server has correctly processed everything.
+ using (var response = (HttpWebResponse) request.GetResponse ()) {
+ if (response.StatusCode != HttpStatusCode.OK) {
+ LoggingService.LogError ("Server responded with status code {1} and error: {0}", response.StatusDescription, response.StatusCode);
+ return false;
+ }
+ }
+ } catch (Exception ex) {
+ LoggingService.LogError ("Failed to upload report to the server", ex);
+ return false;
+ }
+
+ LoggingService.LogDebug ("Successfully uploaded crash report");
+ return true;
+ }
+
static void PurgeOldLogs ()
{
// Delete all logs older than a week
@@ -220,7 +399,7 @@ static void RestoreOutputRedirection ()
return remoteLogger;
}
}
-
+
#region the core service
public static bool IsLevelEnabled (LogLevel level)
@@ -295,7 +474,7 @@ public static void LogFatalError (string message)
{
Log (LogLevel.Fatal, message);
}
-
+
#endregion
#region convenience methods (string messageFormat, params object[] args)
@@ -314,12 +493,17 @@ public static void LogWarning (string messageFormat, params object[] args)
{
Log (LogLevel.Warn, string.Format (messageFormat, args));
}
-
- public static void LogError (string messageFormat, params object[] args)
+
+ public static void LogUserError (string messageFormat, params object[] args)
{
Log (LogLevel.Error, string.Format (messageFormat, args));
}
+ public static void LogError (string messageFormat, params object[] args)
+ {
+ LogUserError (messageFormat, args);
+ }
+
public static void LogFatalError (string messageFormat, params object[] args)
{
Log (LogLevel.Fatal, string.Format (messageFormat, args));
@@ -346,12 +530,42 @@ public static void LogWarning (string message, Exception ex)
public static void LogError (string message, Exception ex)
{
+ LogUserError (message, ex);
+ }
+
+ public static void LogUserError (string message, Exception ex)
+ {
Log (LogLevel.Error, message + (ex != null? System.Environment.NewLine + ex.ToString () : string.Empty));
}
-
+
+ public static void LogInternalError (Exception ex)
+ {
+ if (ex != null) {
+ Log (LogLevel.Error, System.Environment.NewLine + ex.ToString ());
+ }
+
+ ReportUnhandledException (ex, false, true, "internal");
+ }
+
+ public static void LogInternalError (string message, Exception ex)
+ {
+ Log (LogLevel.Error, message + (ex != null? System.Environment.NewLine + ex.ToString () : string.Empty));
+
+ ReportUnhandledException (ex, false, true, "internal");
+ }
+
+ public static void LogCriticalError (string message, Exception ex)
+ {
+ Log (LogLevel.Error, message + (ex != null? System.Environment.NewLine + ex.ToString () : string.Empty));
+
+ ReportUnhandledException (ex, false, false, "critical");
+ }
+
public static void LogFatalError (string message, Exception ex)
{
- Log (LogLevel.Fatal, message + (ex != null? System.Environment.NewLine + ex.ToString () : string.Empty));
+ Log (LogLevel.Error, message + (ex != null? System.Environment.NewLine + ex.ToString () : string.Empty));
+
+ ReportUnhandledException (ex, true, false, "fatal");
}
#endregion
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Core/Runtime.cs
===================================================================
@@ -198,7 +198,6 @@ static void SetupInstrumentation ()
static void OnLoadError (object s, AddinErrorEventArgs args)
{
string msg = "Add-in error (" + args.AddinId + "): " + args.Message;
- LogReporting.LogReportingService.ReportUnhandledException (args.Exception, false, true);
LoggingService.LogError (msg, args.Exception);
}
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProject.cs
===================================================================
@@ -34,12 +34,14 @@
using MonoDevelop.Projects.Utility;
using MonoDevelop.Projects.Text;
+using Microsoft.Build.BuildEngine;
namespace MonoDevelop.Projects.Formats.MSBuild
{
public class MSBuildProject
{
public XmlDocument doc;
+ string file;
Dictionary<XmlElement,MSBuildObject> elemCache = new Dictionary<XmlElement,MSBuildObject> ();
Dictionary<string, MSBuildItemGroup> bestGroups;
@@ -59,6 +61,10 @@ public class MSBuildProject
return manager;
}
}
+
+ public string FileName {
+ get { return file; }
+ }
public MSBuildProject ()
{
@@ -66,9 +72,10 @@ public MSBuildProject ()
doc.PreserveWhitespace = false;
doc.AppendChild (doc.CreateElement (null, "Project", Schema));
}
-
+
public void Load (string file)
{
+ this.file = file;
using (FileStream fs = File.OpenRead (file)) {
byte[] buf = new byte [1024];
int nread, i;
@@ -118,6 +125,7 @@ public void Load (string file)
string xml = File.ReadAllText (file);
doc.LoadXml (xml);
+ Evaluate ();
}
class ProjectWriter : StringWriter
@@ -160,6 +168,15 @@ public string SaveToString ()
return content;
}
+ public void Evaluate ()
+ {
+ MSBuildEvaluationContext context = new MSBuildEvaluationContext (this);
+ foreach (var pg in PropertyGroups)
+ pg.Evaluate (context);
+ foreach (var pg in ItemGroups)
+ pg.Evaluate (context);
+ }
+
public string DefaultTargets {
get { return doc.DocumentElement.GetAttribute ("DefaultTargets"); }
set { doc.DocumentElement.SetAttribute ("DefaultTargets", value); }
@@ -395,7 +412,8 @@ public void RemoveGroup (MSBuildPropertyGroup grp)
public class MSBuildObject
{
XmlElement elem;
-
+ XmlElement evaluatedElem;
+
public MSBuildObject (XmlElement elem)
{
this.elem = elem;
@@ -404,6 +422,15 @@ public MSBuildObject (XmlElement elem)
public XmlElement Element {
get { return elem; }
}
+
+ public XmlElement EvaluatedElement {
+ get { return evaluatedElem ?? elem; }
+ protected set { evaluatedElem = value; }
+ }
+
+ public bool IsEvaluated {
+ get { return evaluatedElem != null; }
+ }
protected XmlElement AddChildElement (string name)
{
@@ -423,6 +450,10 @@ protected XmlElement AddChildElement (string name)
Element.SetAttribute ("Condition", value);
}
}
+
+ internal virtual void Evaluate (MSBuildEvaluationContext context)
+ {
+ }
}
public class MSBuildProperty: MSBuildObject
@@ -435,10 +466,12 @@ public MSBuildProperty (XmlElement elem): base (elem)
get { return Element.Name; }
}
+ internal bool Overwritten { get; set; }
+
[Obsolete]
public string Value {
get {
- return Element.InnerText;
+ return EvaluatedElement.InnerText;
}
set {
Element.InnerText = value;
@@ -448,8 +481,8 @@ public MSBuildProperty (XmlElement elem): base (elem)
public string GetValue (bool isXml = false)
{
if (isXml)
- return Element.InnerXml;
- return Element.InnerText;
+ return EvaluatedElement.InnerXml;
+ return EvaluatedElement.InnerText;
}
public void SetValue (string value, bool isXml = false)
@@ -459,6 +492,32 @@ public void SetValue (string value, bool isXml = false)
else
Element.InnerText = value;
}
+
+ internal override void Evaluate (MSBuildEvaluationContext context)
+ {
+ EvaluatedElement = null;
+
+ if (!string.IsNullOrEmpty (Condition)) {
+ string cond;
+ if (!context.Evaluate (Condition, out cond)) {
+ // The value could not be evaluated, so if there is an existing value, it is not valid anymore
+ context.ClearPropertyValue (Name);
+ return;
+ }
+ if (!ConditionParser.ParseAndEvaluate (cond, context))
+ return;
+ }
+
+ XmlElement elem;
+
+ if (context.Evaluate (Element, out elem)) {
+ EvaluatedElement = elem;
+ context.SetPropertyValue (Name, GetValue ());
+ } else {
+ // The value could not be evaluated, so if there is an existing value, it is not valid anymore
+ context.ClearPropertyValue (Name);
+ }
+ }
}
public interface MSBuildPropertySet
@@ -564,11 +623,22 @@ void Prune (MSBuildPropertyGroup g)
public class MSBuildPropertyGroup: MSBuildObject, MSBuildPropertySet
{
Dictionary<string,MSBuildProperty> properties = new Dictionary<string,MSBuildProperty> ();
+ List<MSBuildProperty> propertyList = new List<MSBuildProperty> ();
MSBuildProject parent;
public MSBuildPropertyGroup (MSBuildProject parent, XmlElement elem): base (elem)
{
this.parent = parent;
+
+ foreach (var pelem in Element.ChildNodes.OfType<XmlElement> ()) {
+ MSBuildProperty prevSameName;
+ if (properties.TryGetValue (pelem.Name, out prevSameName))
+ prevSameName.Overwritten = true;
+
+ var prop = new MSBuildProperty (pelem);
+ propertyList.Add (prop);
+ properties [pelem.Name] = prop; // If a property is defined more than once, we only care about the last registered value
+ }
}
public MSBuildProject Parent {
@@ -580,33 +650,13 @@ public MSBuildPropertyGroup (MSBuildProject parent, XmlElement elem): base (elem
public MSBuildProperty GetProperty (string name)
{
MSBuildProperty prop;
- if (properties.TryGetValue (name, out prop))
- return prop;
- XmlElement propElem = Element [name, MSBuildProject.Schema];
- if (propElem != null) {
- prop = new MSBuildProperty (propElem);
- properties [name] = prop;
- return prop;
- }
- else
- return null;
+ properties.TryGetValue (name, out prop);
+ return prop;
}
public IEnumerable<MSBuildProperty> Properties {
get {
- foreach (XmlNode node in Element.ChildNodes) {
- XmlElement pelem = node as XmlElement;
- if (pelem == null)
- continue;
- MSBuildProperty prop;
- if (properties.TryGetValue (pelem.Name, out prop))
- yield return prop;
- else {
- prop = new MSBuildProperty (pelem);
- properties [pelem.Name] = prop;
- yield return prop;
- }
- }
+ return propertyList.Where (p => !p.Overwritten);
}
}
@@ -617,6 +667,7 @@ public MSBuildProperty SetPropertyValue (string name, string value, bool preserv
XmlElement pelem = AddChildElement (name);
prop = new MSBuildProperty (pelem);
properties [name] = prop;
+ propertyList.Add (prop);
prop.SetValue (value, isXml);
} else if (!preserveExistingCase || !string.Equals (value, prop.GetValue (isXml), StringComparison.OrdinalIgnoreCase)) {
prop.SetValue (value, isXml);
@@ -638,6 +689,7 @@ public bool RemoveProperty (string name)
MSBuildProperty prop = GetProperty (name);
if (prop != null) {
properties.Remove (name);
+ propertyList.Remove (prop);
Element.RemoveChild (prop.Element);
return true;
}
@@ -654,6 +706,7 @@ public void RemoveAllProperties ()
foreach (XmlNode node in toDelete)
Element.RemoveChild (node);
properties.Clear ();
+ propertyList.Clear ();
}
public void UnMerge (MSBuildPropertySet baseGrp, ISet<string> propsToExclude)
@@ -667,6 +720,25 @@ public void UnMerge (MSBuildPropertySet baseGrp, ISet<string> propsToExclude)
}
}
+ internal override void Evaluate (MSBuildEvaluationContext context)
+ {
+ if (!string.IsNullOrEmpty (Condition)) {
+ string cond;
+ if (!context.Evaluate (Condition, out cond)) {
+ // The condition could not be evaluated. Clear all properties that this group defines
+ // since we don't know if they will have a value or not
+ foreach (var prop in Properties)
+ context.ClearPropertyValue (prop.Name);
+ return;
+ }
+ if (!ConditionParser.ParseAndEvaluate (cond, context))
+ return;
+ }
+
+ foreach (var prop in propertyList)
+ prop.Evaluate (context);
+ }
+
public override string ToString()
{
string s = "[MSBuildPropertyGroup:";
@@ -684,7 +756,7 @@ public MSBuildItem (XmlElement elem): base (elem)
}
public string Include {
- get { return Element.GetAttribute ("Include"); }
+ get { return EvaluatedElement.GetAttribute ("Include"); }
set { Element.SetAttribute ("Include", value); }
}
@@ -694,11 +766,16 @@ public MSBuildItem (XmlElement elem): base (elem)
public bool HasMetadata (string name)
{
- return Element [name, MSBuildProject.Schema] != null;
+ return EvaluatedElement [name, MSBuildProject.Schema] != null;
}
public void SetMetadata (string name, string value, bool isXml = false)
{
+ // Don't overwrite the metadata value if the new value is the same as the old
+ // This will keep the old metadata string, which can contain property references
+ if (GetMetadata (name, isXml) == value)
+ return;
+
XmlElement elem = Element [name, MSBuildProject.Schema];
if (elem == null) {
elem = AddChildElement (name);
@@ -722,7 +799,7 @@ public void UnsetMetadata (string name)
public string GetMetadata (string name, bool isXml = false)
{
- XmlElement elem = Element [name, MSBuildProject.Schema];
+ XmlElement elem = EvaluatedElement [name, MSBuildProject.Schema];
if (elem != null)
return isXml ? elem.InnerXml : elem.InnerText;
else
@@ -741,6 +818,15 @@ public void MergeFrom (MSBuildItem other)
SetMetadata (node.LocalName, node.InnerXml, true);
}
}
+
+ internal override void Evaluate (MSBuildEvaluationContext context)
+ {
+ XmlElement elem;
+ if (context.Evaluate (Element, out elem))
+ EvaluatedElement = elem;
+ else
+ EvaluatedElement = null;
+ }
}
public class MSBuildItemGroup: MSBuildObject
@@ -769,5 +855,140 @@ public MSBuildItem AddNewItem (string name, string include)
}
}
}
+
+ internal override void Evaluate (MSBuildEvaluationContext context)
+ {
+ foreach (var item in Items)
+ item.Evaluate (context);
+ }
+ }
+
+ internal class MSBuildEvaluationContext: IExpressionContext
+ {
+ Dictionary<string,string> properties = new Dictionary<string, string> ();
+ bool allResolved;
+ MSBuildProject project;
+
+ public MSBuildEvaluationContext (MSBuildProject project)
+ {
+ this.project = project;
+ }
+
+ public string GetPropertyValue (string name)
+ {
+ string val;
+ if (properties.TryGetValue (name, out val))
+ return val;
+ else
+ return Environment.GetEnvironmentVariable (name);
+ }
+
+ public void SetPropertyValue (string name, string value)
+ {
+ properties [name] = value;
+ }
+
+ public void ClearPropertyValue (string name)
+ {
+ properties.Remove (name);
+ }
+
+ public bool Evaluate (XmlElement source, out XmlElement result)
+ {
+ allResolved = true;
+ result = (XmlElement) EvaluateNode (source);
+ return allResolved;
+ }
+
+ XmlNode EvaluateNode (XmlNode source)
+ {
+ var elemSource = source as XmlElement;
+ if (elemSource != null) {
+ var elem = source.OwnerDocument.CreateElement (elemSource.Prefix, elemSource.LocalName, elemSource.NamespaceURI);
+ foreach (XmlAttribute attr in elemSource.Attributes)
+ elem.Attributes.Append ((XmlAttribute)EvaluateNode (attr));
+ foreach (XmlNode child in elemSource.ChildNodes)
+ elem.AppendChild (EvaluateNode (child));
+ return elem;
+ }
+
+ var attSource = source as XmlAttribute;
+ if (attSource != null) {
+ bool oldResolved = allResolved;
+ var att = source.OwnerDocument.CreateAttribute (attSource.Prefix, attSource.LocalName, attSource.NamespaceURI);
+ att.Value = Evaluate (attSource.Value);
+
+ // Condition attributes don't change the resolution status. Conditions are handled in the property and item objects
+ if (attSource.Name == "Condition")
+ allResolved = oldResolved;
+
+ return att;
+ }
+ var textSource = source as XmlText;
+ if (textSource != null) {
+ return source.OwnerDocument.CreateTextNode (Evaluate (textSource.InnerText));
+ }
+ return source.Clone ();
+ }
+
+ public bool Evaluate (string str, out string result)
+ {
+ allResolved = true;
+ result = Evaluate (str);
+ return allResolved;
+ }
+
+ string Evaluate (string str)
+ {
+ int i = str.IndexOf ("$(");
+ if (i == -1)
+ return str;
+
+ int last = 0;
+
+ StringBuilder sb = new StringBuilder ();
+ do {
+ sb.Append (str, last, i - last);
+ i += 2;
+ int j = str.IndexOf (")", i);
+ if (j == -1) {
+ allResolved = false;
+ return "";
+ }
+
+ string prop = str.Substring (i, j - i);
+ string val = GetPropertyValue (prop);
+ if (val == null) {
+ allResolved = false;
+ return "";
+ }
+
+ sb.Append (val);
+ last = j + 1;
+ i = str.IndexOf ("$(", last);
+ }
+ while (i != -1);
+
+ sb.Append (str, last, str.Length - last);
+ return sb.ToString ();
+ }
+
+ #region IExpressionContext implementation
+
+ public string EvaluateString (string value)
+ {
+ if (value.StartsWith ("$(") && value.EndsWith (")"))
+ return GetPropertyValue (value.Substring (2, value.Length - 3)) ?? value;
+ else
+ return value;
+ }
+
+ public string FullFileName {
+ get {
+ return project.FileName;
+ }
+ }
+
+ #endregion
}
}
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectHandler.cs
===================================================================
@@ -320,7 +320,7 @@ public SolutionEntityItem Load (IProgressMonitor monitor, string fileName, MSBui
try {
timer.Trace ("Create item instance");
ProjectExtensionUtil.BeginLoadOperation ();
- Item = CreateSolutionItem (monitor, p, fileName, language, projectTypeGuids, itemType, itemClass);
+ Item = CreateSolutionItem (monitor, p, fileName, language, itemType, itemClass);
Item.SetItemHandler (this);
MSBuildProjectService.SetId (Item, itemGuid);
@@ -354,13 +354,13 @@ internal bool UseMSBuildEngineForItem (SolutionItem item)
internal bool RequireMSBuildEngine { get; set; }
// All of the last 4 parameters are optional, but at least one must be provided.
- SolutionItem CreateSolutionItem (IProgressMonitor monitor, MSBuildProject p, string fileName, string language, string typeGuids,
+ SolutionItem CreateSolutionItem (IProgressMonitor monitor, MSBuildProject p, string fileName, string language,
string itemType, Type itemClass)
{
SolutionItem item = null;
- if (!string.IsNullOrEmpty (typeGuids)) {
- DotNetProjectSubtypeNode st = MSBuildProjectService.GetDotNetProjectSubtype (typeGuids);
+ if (subtypeGuids.Any ()) {
+ DotNetProjectSubtypeNode st = MSBuildProjectService.GetDotNetProjectSubtype (subtypeGuids);
if (st != null) {
UseMSBuildEngineByDefault = st.UseXBuild;
RequireMSBuildEngine = st.RequireXBuild;
@@ -389,7 +389,7 @@ internal bool UseMSBuildEngineForItem (SolutionItem item)
item = st.CreateInstance (language);
st.UpdateImports ((SolutionEntityItem)item, targetImports);
} else
- throw new UnknownSolutionItemTypeException (typeGuids);
+ throw new UnknownSolutionItemTypeException (string.Join (";", subtypeGuids));
}
if (item == null && itemClass != null)
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectService.cs
===================================================================
@@ -58,6 +58,8 @@ public static class MSBuildProjectService
static Dictionary<string,RemoteBuildEngine> builders = new Dictionary<string, RemoteBuildEngine> ();
static GenericItemTypeNode genericItemTypeNode = new GenericItemTypeNode ();
+
+ internal static bool ShutDown { get; private set; }
public static DataContext DataContext {
get {
@@ -84,6 +86,11 @@ static MSBuildProjectService ()
PropertyService.PropertyChanged += HandlePropertyChanged;
DefaultMSBuildVerbosity = PropertyService.Get ("MonoDevelop.Ide.MSBuildVerbosity", MSBuildVerbosity.Normal);
+
+ Runtime.ShuttingDown += delegate {
+ ShutDown = true;
+ CleanProjectBuilders ();
+ };
}
static void HandlePropertyChanged (object sender, PropertyChangedEventArgs e)
@@ -192,25 +199,29 @@ public static void CheckHandlerUsesMSBuildEngine (SolutionItem item, out bool us
internal static DotNetProjectSubtypeNode GetDotNetProjectSubtype (string typeGuids)
{
- if (!string.IsNullOrEmpty (typeGuids)) {
- Type ptype = null;
- DotNetProjectSubtypeNode foundNode = null;
- foreach (string guid in typeGuids.Split (';')) {
- string tguid = guid.Trim ();
- foreach (DotNetProjectSubtypeNode st in GetItemSubtypeNodes ()) {
- if (st.SupportsType (tguid)) {
- if (ptype == null || ptype.IsAssignableFrom (st.Type)) {
- ptype = st.Type;
- foundNode = st;
- }
+ if (!string.IsNullOrEmpty (typeGuids))
+ return GetDotNetProjectSubtype (typeGuids.Split (';').Select (t => t.Trim ()));
+ else
+ return null;
+ }
+
+ internal static DotNetProjectSubtypeNode GetDotNetProjectSubtype (IEnumerable<string> typeGuids)
+ {
+ Type ptype = null;
+ DotNetProjectSubtypeNode foundNode = null;
+ foreach (string guid in typeGuids) {
+ foreach (DotNetProjectSubtypeNode st in GetItemSubtypeNodes ()) {
+ if (st.SupportsType (guid)) {
+ if (ptype == null || ptype.IsAssignableFrom (st.Type)) {
+ ptype = st.Type;
+ foundNode = st;
}
}
}
- return foundNode;
}
- return null;
+ return foundNode;
}
-
+
static IEnumerable<ItemTypeNode> GetItemTypeNodes ()
{
foreach (ExtensionNode node in AddinManager.GetExtensionNodes (ItemTypesExtensionPath)) {
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/RemoteProjectBuilder.cs
===================================================================
@@ -103,10 +103,14 @@ public void RefreshWithContent (string projectContent)
public void Dispose ()
{
- if (engine != null) {
- if (builder != null)
- engine.UnloadProject (builder);
- MSBuildProjectService.ReleaseProjectBuilder (engine);
+ if (!MSBuildProjectService.ShutDown && engine != null) {
+ try {
+ if (builder != null)
+ engine.UnloadProject (builder);
+ MSBuildProjectService.ReleaseProjectBuilder (engine);
+ } catch {
+ // Ignore
+ }
GC.SuppressFinalize (this);
engine = null;
builder = null;
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Projects/BuildTool.cs
===================================================================
@@ -128,14 +128,26 @@ public int Run (string[] arguments)
if (config == null && configTarget != null)
config = configTarget.DefaultConfigurationId;
- ConfigurationSelector configuration;
- if (item is SolutionEntityItem)
- configuration = new ItemConfigurationSelector (config);
- else
- configuration = new SolutionConfigurationSelector (config);
-
monitor = new ConsoleProgressMonitor ();
- BuildResult res = item.RunTarget (monitor, command, configuration);
+ BuildResult res = null;
+ if (item is SolutionEntityItem && ((SolutionEntityItem)item).ParentSolution == null) {
+ ConfigurationSelector configuration = new ItemConfigurationSelector (config);
+ res = item.RunTarget (monitor, command, configuration);
+ } else {
+ ConfigurationSelector configuration = new SolutionConfigurationSelector (config);
+ SolutionEntityItem solutionEntityItem = item as SolutionEntityItem;
+ if (solutionEntityItem != null) {
+ if (command == ProjectService.BuildTarget)
+ res = solutionEntityItem.Build (monitor, configuration, true);
+ else if (command == ProjectService.CleanTarget)
+ solutionEntityItem.Clean (monitor, configuration);
+ else
+ res = item.RunTarget (monitor, command, configuration);
+ } else {
+ res = item.RunTarget (monitor, command, configuration);
+ }
+ }
+
if (targetRuntime != null)
{
Modified: main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs
===================================================================
@@ -46,6 +46,7 @@
using MonoDevelop.Projects.Extensions;
using Mono.Unix;
using MonoDevelop.Core.StringParsing;
+using System.Linq;
namespace MonoDevelop.Projects
{
@@ -120,7 +121,7 @@ public ProjectServiceExtension GetExtensionChain (IBuildTarget target)
einfo.ItemTypeCondition.ObjType = target.GetType ();
einfo.ProjectLanguageCondition.TargetProject = target;
}
- ProjectServiceExtension[] extensions = (ProjectServiceExtension[]) einfo.ExtensionContext.GetExtensionObjects ("/MonoDevelop/ProjectModel/ProjectServiceExtensions", typeof(ProjectServiceExtension));
+ ProjectServiceExtension[] extensions = einfo.ExtensionContext.GetExtensionObjects ("/MonoDevelop/ProjectModel/ProjectServiceExtensions", typeof(ProjectServiceExtension)).Cast<ProjectServiceExtension> ().ToArray ();
chain = CreateExtensionChain (extensions);
}
else {
@@ -128,7 +129,7 @@ public ProjectServiceExtension GetExtensionChain (IBuildTarget target)
ExtensionContext ctx = AddinManager.CreateExtensionContext ();
ctx.RegisterCondition ("ItemType", new ItemTypeCondition (typeof(UnknownItem)));
ctx.RegisterCondition ("ProjectLanguage", new ProjectLanguageCondition (UnknownItem.Instance));
- ProjectServiceExtension[] extensions = (ProjectServiceExtension[]) ctx.GetExtensionObjects ("/MonoDevelop/ProjectModel/ProjectServiceExtensions", typeof(ProjectServiceExtension));
+ ProjectServiceExtension[] extensions = ctx.GetExtensionObjects ("/MonoDevelop/ProjectModel/ProjectServiceExtensions", typeof(ProjectServiceExtension)).Cast<ProjectServiceExtension> ().ToArray ();
defaultExtensionChain = CreateExtensionChain (extensions);
}
chain = defaultExtensionChain;
Modified: main/src/core/MonoDevelop.Ide/AssemblyInfo.cs
===================================================================
@@ -13,3 +13,4 @@
[assembly: InternalsVisibleTo("MonoDevelop.Debugger")]
[assembly: InternalsVisibleTo("MonoDevelop.DesignerSupport")]
[assembly: InternalsVisibleTo("Ide.Tests")]
+[assembly: InternalsVisibleTo("UnitTests")]
Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Components/InfoBar.cs
===================================================================
@@ -140,10 +140,10 @@ public void SetMessageLabel (string markup)
protected override bool OnExposeEvent (Gdk.EventExpose evnt)
{
Style.PaintFlatBox (Style, evnt.Window, StateType.Normal, ShadowType.Out, evnt.Area, this, "tooltip",
- Allocation.X + 1, Allocation.Y + 1, Allocation.Width - 2, Allocation.Height - 2);
+ Allocation.X + 1, Allocation.Y + 1, Allocation.Width - 2, Allocation.Height - 2);
return base.OnExposeEvent (evnt);
}
-
+
protected override void OnSizeAllocated (Gdk.Rectangle allocation)
{
var rect = Allocation.Union (allocation);
Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplateService.cs
===================================================================
@@ -155,7 +155,7 @@ public static void SaveTemplates ()
}
foreach (CodeTemplate template in templates) {
if (string.IsNullOrEmpty (template.Shortcut)) {
- LoggingService.LogError ("CodeTemplateService: Can't save unnamed template " + template);
+ LoggingService.LogUserError ("CodeTemplateService: Can't save unnamed template " + template);
continue;
}
SaveTemplate (template, Path.Combine (TemplatePath, template.Shortcut + ".template.xml"));
Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/SearchResultWidget.cs
===================================================================
@@ -491,7 +491,7 @@ void ResultTextDataFunc (TreeViewColumn column, CellRenderer cell, TreeModel mod
uint end;
try {
start = (uint)TextViewMargin.TranslateIndexToUTF8 (lineText, col);
- end = (uint)TextViewMargin.TranslateIndexToUTF8 (lineText, col + searchResult.Length);
+ end = (uint)TextViewMargin.TranslateIndexToUTF8 (lineText, Math.Min (lineText.Length, col + searchResult.Length));
} catch (Exception e) {
LoggingService.LogError ("Exception while translating index to utf8 (column was:" +col + " search result length:" + searchResult.Length + " line text:" + lineText + ")", e);
return;
Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.OptionPanels/LogAgentOptionsPanel.cs
===================================================================
@@ -60,13 +60,13 @@ public LogAgentPanelWidget ()
{
global::Stetic.BinContainer.Attach (this);
- var value = LogReportingService.ReportCrashes;
+ var value = LoggingService.ReportCrashes;
chkCrash = new CheckButton (GettextCatalog.GetString ("Automatically submit error diagnostic information"));
if (value.HasValue)
chkCrash.Active = value.Value;
chkCrash.Toggled += (sender, e) => reportCrash = chkCrash.Active;
- value = LogReportingService.ReportUsage;
+ value = LoggingService.ReportUsage;
chkUsage = new CheckButton (GettextCatalog.GetString ("Automatically submit usage information"));
if (value.HasValue)
chkUsage.Active = value.Value;
@@ -83,9 +83,9 @@ public LogAgentPanelWidget ()
public void Store ()
{
if (reportCrash.HasValue)
- LogReportingService.ReportCrashes = reportCrash.Value;
+ LoggingService.ReportCrashes = reportCrash.Value;
if (reportUsage.HasValue)
- LogReportingService.ReportUsage = reportUsage.Value;
+ LoggingService.ReportUsage = reportUsage.Value;
}
}
}
Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs
===================================================================
@@ -769,7 +769,7 @@ public ParsedDocument UpdateParseDocument ()
try {
string currentParseFile = FileName;
var editor = Editor;
- if (editor == null)
+ if (editor == null || string.IsNullOrEmpty (currentParseFile))
return null;
TypeSystemService.AddSkippedFile (currentParseFile);
string currentParseText = editor.Text;
Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/NewProjectDialog.cs
===================================================================
@@ -430,7 +430,7 @@ bool CreateProject ()
try {
if (Directory.Exists (ProjectLocation)) {
- var btn = MessageService.AskQuestion (GettextCatalog.GetString ("Directory {0} already exists.\nDo you want to coninue the Project creation?", ProjectLocation), AlertButton.No, AlertButton.Yes);
+ var btn = MessageService.AskQuestion (GettextCatalog.GetString ("Directory {0} already exists.\nDo you want to continue the Project creation?", ProjectLocation), AlertButton.No, AlertButton.Yes);
if (btn != AlertButton.Yes)
return false;
}
Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs
===================================================================
@@ -1280,11 +1280,17 @@ static IProjectContent LoadProjectCache (Project project)
var cacheFile = Path.Combine (cacheDir, "completion.cache");
if (!File.Exists (cacheFile))
return null;
- var cache = DeserializeObject<IProjectContent> (cacheFile);
- var monoDevelopProjectContent = cache as MonoDevelopProjectContent;
- if (monoDevelopProjectContent != null)
- monoDevelopProjectContent.Project = project;
- return cache;
+ try {
+ var cache = DeserializeObject<IProjectContent> (cacheFile);
+ var monoDevelopProjectContent = cache as MonoDevelopProjectContent;
+ if (monoDevelopProjectContent != null)
+ monoDevelopProjectContent.Project = project;
+ return cache;
+ } catch (Exception e) {
+ LoggingService.LogWarning ("Error while reading completion cache, regenerating", e);
+ Directory.Delete (cacheDir, true);
+ return null;
+ }
}
#region IAssemblyReference implementation
@@ -1645,6 +1651,10 @@ static void OnFileRenamed (object sender, ProjectFileRenamedEventArgs args)
content.UpdateContent (c => c.RemoveFiles (fargs.OldName));
content.InformFileRemoved (new ParsedFileEventArgs (file));
+ var tags = content.GetExtensionObject <ProjectCommentTags> ();
+ if (tags != null)
+ tags.RemoveFile (project, fargs.OldName);
+
QueueParseJob (content, new [] { fargs.ProjectFile });
}
}
@@ -2117,7 +2127,7 @@ IAssembly IAssemblyReference.Resolve (ITypeResolveContext context)
readonly string cache;
IUnresolvedAssembly assembly;
- object asmLocker = new object ();
+ readonly object asmLocker = new object ();
internal void EnsureAssemblyLoaded ()
{
lock (asmLocker) {
@@ -2176,8 +2186,13 @@ IUnresolvedAssembly LoadAssembly ()
if (cache != null) {
var writeTime = File.GetLastWriteTimeUtc (fileName);
SerializeObject (assemblyPath, result);
- if (File.Exists (assemblyPath))
- File.SetCreationTimeUtc (assemblyPath, writeTime);
+ if (File.Exists (assemblyPath)) {
+ try {
+ File.SetCreationTimeUtc (assemblyPath, writeTime);
+ } catch (Exception e) {
+ LoggingService.LogError ("Can't set creation time for: " + assemblyPath, e);
+ }
+ }
}
return result;
}
@@ -2373,14 +2388,16 @@ public static bool RecreateFrameworkLookup (DotNetProject netProject)
{
lock (frameworkLookup) {
FrameworkTask result;
- if (!frameworkLookup.TryGetValue (netProject.TargetFramework.Name, out result))
+ var frameworkName = netProject.TargetFramework.Name;
+ if (!frameworkLookup.TryGetValue (frameworkName, out result))
return false;
if (result.RetryCount > 5) {
- LoggingService.LogError ("Can't create framework lookup for:" + netProject.TargetFramework.Name);
+ LoggingService.LogError ("Can't create framework lookup for:" + frameworkName);
return false;
}
result.RetryCount++;
- LoggingService.LogInfo ("Trying to recreate framework lookup for {0}, try {1}.", netProject.TargetFramework.Name, result.RetryCount);
+ LoggingService.LogInfo ("Trying to recreate framework lookup for {0}, try {1}.", frameworkName, result.RetryCount);
+ result.Task = null;
StartFrameworkLookup (netProject);
return true;
}
@@ -2703,12 +2720,15 @@ static void CheckModifiedFiles (Project project, ProjectFile[] projectFiles, Pro
}
modifiedFiles.Add (file);
}
-
+ var tags = content.GetExtensionObject <ProjectCommentTags> ();
+
// check if file needs to be removed from project content
foreach (var file in cnt.Files) {
if (project.GetProjectFile (file.FileName) == null) {
content.UpdateContent (c => c.RemoveFiles (file.FileName));
content.InformFileRemoved (new ParsedFileEventArgs (file));
+ if (tags != null)
+ tags.RemoveFile (project, file.FileName);
}
}
Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs
===================================================================
@@ -123,7 +123,7 @@ int Run (MonoDevelopOptions options)
EndPoint ep = null;
DispatchService.Initialize ();
-
+
// Set a synchronization context for the main gtk thread
SynchronizationContext.SetSynchronizationContext (new GtkSynchronizationContext ());
@@ -502,10 +502,7 @@ void SetupExceptionManager ()
void HandleException (Exception ex, bool willShutdown)
{
// Log the crash to the MonoDevelop.log file first:
- LoggingService.LogError (string.Format ("An unhandled exception has occured. Terminating MonoDevelop? {0}", willShutdown), ex);
-
- // Pass it off to the reporting service now.
- LogReportingService.ReportUnhandledException (ex, willShutdown);
+ LoggingService.LogInternalError (string.Format ("An unhandled exception has occured. Terminating MonoDevelop? {0}", willShutdown), ex);
}
/// <summary>SDBM-style hash, bounded to a range of 1000.</summary>
Modified: main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/LogReportingStartup.cs
===================================================================
@@ -43,11 +43,11 @@ protected override void Run ()
{
System.Threading.ThreadPool.QueueUserWorkItem (delegate {
// Process cached crash reports if there are any and uploading is enabled
- LogReportingService.ProcessCache ();
+ LoggingService.ProcessCache ();
});
// Attach a handler for when exceptions need to be processed
- LogReportingService.UnhandledErrorOccured = (enabled, ex, willShutdown) => {
+ LoggingService.UnhandledErrorOccured = (enabled, ex, willShutdown) => {
var doNotSend = new AlertButton (GettextCatalog.GetString ("Do _Not Send"));
var sendOnce = new AlertButton (GettextCatalog.GetString ("_Send This Time"));
var alwaysSend = new AlertButton (GettextCatalog.GetString ("_Always Send"));
Modified: main/tests/UnitTests/MonoDevelop.CSharpBinding/CSharpTextEditorIndentationTests.cs
===================================================================
@@ -358,5 +358,18 @@ public void TestEnterSelectionBehavior ()
CheckOutput (data, "\tfirst\n\t$third");
}
+
+
+ /// <summary>
+ /// Bug 15335 - In a multiline comment, pressing Enter jumps way ahead
+ /// </summary>
+ [Test]
+ public void TestBug15335 ()
+ {
+ var data = Create ("namespace Foo\n{\n\tpublic class Bar\n\t{\n\t\tvoid Test()\r\n\t\t{\r\n\t\t\t/* foo$\n\t\t}\n\t}\n}\n");
+ MiscActions.InsertNewLine (data);
+
+ CheckOutput (data, "namespace aFoo\n{\n\tpublic class Bar\n\t{\n\t\tvoid Test()\r\n\t\t{\r\n\t\t\t/* foo\n\t\t\t * $\n\t\t}\n\t}\n}\n");
+ }
}
}
Modified: main/tests/UnitTests/MonoDevelop.Ide.FindInFiles/MemberCollectorTests.cs
===================================================================
@@ -32,6 +32,8 @@
using MonoDevelop.Ide.TypeSystem;
using ICSharpCode.NRefactory.CSharp;
using ICSharpCode.NRefactory.CSharp.TypeSystem;
+using Mono.CSharp.Nullable;
+using GLib;
namespace MonoDevelop.Ide.FindInFiles
{
@@ -40,9 +42,13 @@ public class MemberCollectorTests : UnitTests.TestBase
{
IAssembly GenerateAssembly(Project project, string code)
{
- var wrapper = TypeSystemService.LoadProject (project);
project.Files.Add (new ProjectFile ("test.cs", BuildAction.Compile));
- TypeSystemService.ParseFile (project, "test.cs", "text/x-csharp", code);
+ var wrapper = TypeSystemService.LoadProject (project);
+ TypeSystemService.ParseFile ("test.cs", "text/x-csharp", code, wrapper);
+ wrapper.RequestLoad ();
+ do {
+ System.Threading.Thread.Sleep (10);
+ } while (wrapper.InLoad);
return wrapper.Compilation.MainAssembly;
}
Modified: main/tests/UnitTests/MonoDevelop.Projects/LocalCopyTests.cs
===================================================================
@@ -40,7 +40,6 @@ namespace MonoDevelop.Projects
public class LocalCopyTests : TestBase
{
[Test]
- [Ignore ("We don't install the msbuild assemblies in the right place for this tests")]
public void CheckLocalCopy ()
{
string solFile = Util.GetSampleProject ("vs-local-copy", "VSLocalCopyTest.sln");
@@ -62,6 +61,8 @@ public void CheckLocalCopy ()
"VSLocalCopyTest.exe",
"VSLocalCopyTest.exe.mdb",
"TextFile1.txt",
+ "TextFile2.txt",
+ "app.config",
"folder/baz.txt",
"foo/bar.txt",
"quux.txt",
@@ -76,6 +77,8 @@ public void CheckLocalCopy ()
"ClassLibrary4.dll",
"VSLocalCopyTest.exe",
"TextFile1.txt",
+ "TextFile2.txt",
+ "app.config",
"folder/baz.txt",
"foo/bar.txt",
"quux.txt",
@@ -182,7 +185,16 @@ static void AssertCleanBuild (Solution sol, string configuration)
BuildResult cr = sol.Build (Util.GetMonitor (), configuration);
Assert.IsNotNull (cr);
Assert.AreEqual (0, cr.ErrorCount);
- Assert.AreEqual (0, cr.WarningCount);
+
+ // Warning check disabled due to bug #15121
+ // Assert.AreEqual (0, cr.WarningCount);
+ }
+
+ [Test]
+ [Ignore ("Check for build warnings disabled due to a bug in xbuild (BXC 15121)")]
+ public void CheckLocalCopyBuildWarnings ()
+ {
+ // See commented assert in AssertCleanBuild
}
}
}
Modified: main/tests/UnitTests/MonoDevelop.Projects/MSBuildTests.cs
===================================================================
@@ -42,7 +42,6 @@ namespace MonoDevelop.Projects
public class MSBuildTests: TestBase
{
[Test()]
- [Ignore ("We don't install the msbuild assemblies in the right place for this tests")]
public void LoadSaveBuildConsoleProject()
{
string solFile = Util.GetSampleProject ("console-project", "ConsoleProject.sln");
@@ -364,5 +363,32 @@ public void RoundtripPropertyWithXmlCharacters ()
Assert.AreEqual (value, conf.OutputAssembly);
}
+
+ [Test]
+ public void EvaluateProperties ()
+ {
+ string dir = Path.GetDirectoryName (typeof(Project).Assembly.Location);
+ Environment.SetEnvironmentVariable ("HHH", "EnvTest");
+ Environment.SetEnvironmentVariable ("SOME_PLACE", dir);
+
+ string solFile = Util.GetSampleProject ("property-evaluation-test", "property-evaluation-test.sln");
+ Solution sol = Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile) as Solution;
+ var p = (DotNetProject) sol.GetAllProjects ().First ();
+ Assert.AreEqual ("Program1_test1.cs", p.Files[0].FilePath.FileName, "Basic replacement");
+ Assert.AreEqual ("Program2_test1_test2.cs", p.Files[1].FilePath.FileName, "Property referencing same property");
+ Assert.AreEqual ("Program3_$(DebugType).cs", p.Files[2].FilePath.FileName, "Property inside group with non-evaluable condition");
+ Assert.AreEqual ("Program4_yes_value.cs", p.Files[3].FilePath.FileName, "Evaluation of group condition");
+ Assert.AreEqual ("Program5_yes_value.cs", p.Files[4].FilePath.FileName, "Evaluation of property condition");
+ Assert.AreEqual ("Program6_$(FFF).cs", p.Files[5].FilePath.FileName, "Evaluation of property with non-evaluable condition");
+ Assert.AreEqual ("Program7_test1.cs", p.Files[6].FilePath.FileName, "Item conditions are ignored");
+ Assert.AreEqual ("Program8_test1.cs", p.Files[7].FilePath.FileName, "Item group conditions are ignored");
+ Assert.AreEqual ("Program9_$(GGG).cs", p.Files[8].FilePath.FileName, "Non-evaluable property group clears properties");
+ Assert.AreEqual ("Program10_$(AAA", p.Files[9].FilePath.FileName, "Invalid property reference");
+ Assert.AreEqual ("Program11_EnvTest.cs", p.Files[10].FilePath.FileName, "Environment variable");
+
+ var testRef = Path.Combine (dir, "MonoDevelop.Core.dll");
+ var asms = p.GetReferencedAssemblies (sol.Configurations [0].Selector).ToArray ();
+ Assert.IsTrue (asms.Contains (testRef));
+ }
}
}
Modified: main/tests/UnitTests/MonoDevelop.Projects/ProjectTests.cs
===================================================================
@@ -62,7 +62,6 @@ public void ProjectFilePaths ()
}
[Test()]
- [Ignore ("We don't install the msbuild assemblies in the right place for this tests")]
public void Resources ()
{
string solFile = Util.GetSampleProject ("resources-tester", "ResourcesTester.sln");
@@ -79,7 +78,9 @@ public void Resources ()
sol.Clean (Util.GetMonitor (), "Debug");
Assert.IsFalse (File.Exists (spath), "Satellite assembly not removed");
- Assert.IsFalse (Directory.Exists (Path.GetDirectoryName (spath)), "Satellite assembly directory not removed");
+
+ // msbuild doesn't delete this directory
+ // Assert.IsFalse (Directory.Exists (Path.GetDirectoryName (spath)), "Satellite assembly directory not removed");
}
public static void CheckResourcesSolution (Solution sol)
Modified: main/tests/test-projects/ContactBook/ContactBook/ContactBook.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="ContactBook" />
<Build debugmode="True" target="Exe" />
<Execution consolepause="True" runwithwarnings="True" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="ContactBook" />
<Build debugmode="False" target="Exe" />
<Execution consolepause="True" runwithwarnings="True" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
@@ -34,4 +34,4 @@
<ProjectReference type="Gac" localcopy="True" refto="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<ProjectReference type="Gac" localcopy="True" refto="Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
</References>
-</Project>
\ No newline at end of file
+</Project>
Modified: main/tests/test-projects/ContactBook/CustomWidgets/CustomWidgets.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="CustomWidgets" />
<Build debugmode="True" target="Library" />
<Execution consolepause="False" runwithwarnings="True" runtime="MsNet" clr-version="Net_1_1" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="CustomWidgets" />
<Build debugmode="False" target="Library" />
<Execution consolepause="False" runwithwarnings="True" runtime="MsNet" clr-version="Net_1_1" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
@@ -28,4 +28,4 @@
<ProjectReference type="Gac" localcopy="True" refto="System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<ProjectReference type="Gac" localcopy="True" refto="Mono.Posix, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
</References>
-</Project>
\ No newline at end of file
+</Project>
Modified: main/tests/test-projects/console-with-libs-mdp/console-with-libs-mdp/console-with-libs-mdp.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="console-with-libs-mdp" />
<Build debugmode="True" target="Exe" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" definesymbols="DEBUG" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="console-with-libs-mdp" />
<Build debugmode="False" target="Exe" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Modified: main/tests/test-projects/console-with-libs-mdp/library1/library1.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="library1" />
<Build debugmode="True" target="Library" />
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" definesymbols="DEBUG" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="library1" />
<Build debugmode="False" target="Library" />
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Modified: main/tests/test-projects/console-with-libs-mdp/library2/library2.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="library2" />
<Build debugmode="True" target="Library" />
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" definesymbols="DEBUG" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="library2" />
<Build debugmode="False" target="Library" />
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Modified: main/tests/test-projects/csharp-console-mdp/csharp-console-mdp/csharp-console-mdp.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="csharp-console-mdp" />
<Build debugmode="True" target="Exe" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" definesymbols="DEBUG" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release2" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="csharp-console-mdp" />
<Build debugmode="False" target="Exe" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Modified: main/tests/test-projects/generated-console-project/TestProject.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="TestProject" />
<Build debugmode="True" target="Exe" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="TestProject" />
<Build debugmode="False" target="Exe" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Modified: main/tests/test-projects/nested-solutions-mdp/console-project/console-project.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="console-project" />
<Build debugmode="True" target="Exe" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="console-project" />
<Build debugmode="False" target="Exe" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Modified: main/tests/test-projects/nested-solutions-mdp/nested-solution1/library1/library1.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="library1" />
<Build debugmode="True" target="Library" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="library1" />
<Build debugmode="False" target="Library" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Modified: main/tests/test-projects/nested-solutions-mdp/nested-solution1/library2/library2.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="library2" />
<Build debugmode="True" target="Library" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="library2" />
<Build debugmode="False" target="Library" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Modified: main/tests/test-projects/nested-solutions-mdp/nested-solution2/console-project2/console-project2.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="console-project2" />
<Build debugmode="True" target="Exe" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="console-project2" />
<Build debugmode="False" target="Exe" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Modified: main/tests/test-projects/nested-solutions-mdp/nested-solution2/nested-solution3/library3/library3.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="library3" />
<Build debugmode="True" target="Library" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="library3" />
<Build debugmode="False" target="Library" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Modified: main/tests/test-projects/nested-solutions-mdp/nested-solution2/nested-solution3/library4/library4.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="library4" />
<Build debugmode="True" target="Library" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG;TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="library4" />
<Build debugmode="False" target="Library" />
<Execution runwithwarnings="True" consolepause="True" runtime="MsNet" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="TRACE" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Added: main/tests/test-projects/property-evaluation-test/property-evaluation-test.csproj
===================================================================
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+ <ProductVersion>10.0.0</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{8A067BDA-C60B-4B3E-85EC-743CF521ADD4}</ProjectGuid>
+ <ProjectTypeGuids>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <OutputType>Exe</OutputType>
+ <RootNamespace>propertyevaluationtest</RootNamespace>
+ <AssemblyName>property-evaluation-test</AssemblyName>
+ <AAA>test1</AAA>
+ <BBB>test2</BBB>
+ <BBB>$(AAA)_$(BBB)</BBB>
+ <CCC>yes</CCC>
+ <EEE>unknown</EEE>
+ <EEE Condition=" '$(CCC)' == 'yes' ">yes_value</EEE>
+ <FFF>unknown</FFF>
+ <FFF Condition=" '$(FOO)' == 'yes' ">yes_value</FFF>
+ <GGG>yes</GGG>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(CCC)' == 'yes' ">
+ <DDD>yes_value</DDD>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(CCC)' == 'no' ">
+ <DDD>no_value</DDD>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug</OutputPath>
+ <DefineConstants>DEBUG;</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <Externalconsole>true</Externalconsole>
+ <PlatformTarget>x86</PlatformTarget>
+ <GGG>yes</GGG>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+ <DebugType>full</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <Externalconsole>true</Externalconsole>
+ <PlatformTarget>x86</PlatformTarget>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="TestReference">
+ <HintPath>$(SOME_PLACE)\MonoDevelop.Core.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Program1_$(AAA).cs" />
+ <Compile Include="Program2_$(BBB).cs" />
+ <Compile Include="Program3_$(DebugType).cs" />
+ <Compile Include="Program4_$(DDD).cs" />
+ <Compile Include="Program5_$(EEE).cs" />
+ <Compile Include="Program6_$(FFF).cs" />
+ <Compile Include="Program7_$(AAA).cs" Condition=" '$(Foo)' == 'Bar' " />
+ </ItemGroup>
+ <ItemGroup Condition=" '$(Foo)' == 'Bar' ">
+ <Compile Include="Program8_$(AAA).cs" />
+ <Compile Include="Program9_$(GGG).cs" />
+ <Compile Include="Program10_$(AAA" />
+ <Compile Include="Program11_$(HHH).cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+</Project>
\ No newline at end of file
Added: main/tests/test-projects/property-evaluation-test/property-evaluation-test.sln
===================================================================
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "property-evaluation-test", "property-evaluation-test.csproj", "{8A067BDA-C60B-4B3E-85EC-743CF521ADD4}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x86 = Debug|x86
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {8A067BDA-C60B-4B3E-85EC-743CF521ADD4}.Debug|x86.ActiveCfg = Debug|x86
+ {8A067BDA-C60B-4B3E-85EC-743CF521ADD4}.Debug|x86.Build.0 = Debug|x86
+ {8A067BDA-C60B-4B3E-85EC-743CF521ADD4}.Release|x86.ActiveCfg = Release|x86
+ {8A067BDA-C60B-4B3E-85EC-743CF521ADD4}.Release|x86.Build.0 = Release|x86
+ EndGlobalSection
+ GlobalSection(MonoDevelopProperties) = preSolution
+ StartupItem = property-evaluation-test.csproj
+ EndGlobalSection
+EndGlobal
Modified: main/tests/test-projects/test-build-configs/Lib1/Lib1.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="Lib1" />
<Build debugmode="True" target="Library" />
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="Lib1" />
<Build debugmode="False" target="Library" />
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
@@ -23,4 +23,4 @@
<ProjectReference type="Project" localcopy="True" refto="Lib3" />
<ProjectReference type="Project" localcopy="True" refto="Lib4" />
</References>
-</Project>
\ No newline at end of file
+</Project>
Modified: main/tests/test-projects/test-build-configs/Lib2/Lib2.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="Lib2" />
<Build debugmode="True" target="Library" />
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="Lib2" />
<Build debugmode="False" target="Library" />
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Modified: main/tests/test-projects/test-build-configs/Lib3/Lib3.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/DebugExtra" assembly="Lib3" />
<Build debugmode="True" target="Library" />
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release+Extra" ctype="DotNetProjectConfiguration">
<Output directory="bin/ReleaseExtra" assembly="Lib3" />
<Build debugmode="False" target="Library" />
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Modified: main/tests/test-projects/test-build-configs/Lib4/Lib4.mdp
===================================================================
@@ -4,13 +4,13 @@
<Output directory="bin/Debug" assembly="Lib4" />
<Build debugmode="True" target="Library" />
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" definesymbols="DEBUG" ctype="CSharpCompilerParameters" />
</Configuration>
<Configuration name="Release" ctype="DotNetProjectConfiguration">
<Output directory="bin/Release" assembly="Lib4" />
<Build debugmode="False" target="Library" />
<Execution runwithwarnings="True" consolepause="False" runtime="MsNet" clr-version="Net_2_0" />
- <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" generatexmldocumentation="False" ctype="CSharpCompilerParameters" />
+ <CodeGeneration compiler="Mcs" warninglevel="4" optimize="False" unsafecodeallowed="False" generateoverflowchecks="False" ctype="CSharpCompilerParameters" />
</Configuration>
</Configurations>
<Contents>
Modified: main/tests/test-projects/vs-local-copy/ClassLibrary1/ClassLibrary1.csproj
===================================================================
@@ -23,7 +23,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
Modified: main/tests/test-projects/vs-local-copy/ClassLibrary2/ClassLibrary2.csproj
===================================================================
@@ -23,7 +23,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
Modified: main/tests/test-projects/vs-local-copy/ClassLibrary3/ClassLibrary3.csproj
===================================================================
@@ -23,7 +23,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
Modified: main/tests/test-projects/vs-local-copy/ClassLibrary4/ClassLibrary4.csproj
===================================================================
@@ -23,7 +23,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
Modified: main/tests/test-projects/vs-local-copy/ClassLibrary5/ClassLibrary5.csproj
===================================================================
@@ -23,7 +23,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
Modified: main/tests/test-projects/vs-local-copy/VSLocalCopyTest/VSLocalCopyTest.csproj
===================================================================
@@ -23,7 +23,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
Commit: d569180fd68660c0706f6e9d7cb1be9558a97ed5
Author: Lluis Sanchez <[email protected]> (slluis)
Date: 2013-10-14 08:14:46 GMT
URL: https://github.com/mono/monodevelop/commit/d569180fd68660c0706f6e9d7cb1be9558a97ed5
Bump md-addins
Changed paths:
M version-checks
Modified: version-checks
===================================================================
@@ -17,7 +17,7 @@ DEP[0]=md-addins
DEP_NAME[0]=MDADDINS
DEP_PATH[0]=${top_srcdir}/../md-addins
DEP_MODULE[0][email protected]:xamarin/md-addins.git
-DEP_NEEDED_VERSION[0]=e66686db01a26cbf5aa921a27f1e35def30df9ec
+DEP_NEEDED_VERSION[0]=1b9ce86d8348aeac5efa420d417317cf3c77bfaa
DEP_BRANCH_AND_REMOTE[0]="retina origin/retina"
# heap-shot
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.