Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 0bb0d8d

Browse files
author
gumme
committed
Merge remote-tracking branch 'remotes/upstream/master'
Conflicts: src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlDocument.cs
2 parents 8849041 + 7aa8587 commit 0bb0d8d

5,879 files changed

Lines changed: 402340 additions & 326847 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ bin/
1515
/src/Tools/UpdateAssemblyInfo/bin
1616
/src/Setup/SharpDevelop.Setup.wixproj.user
1717
/src/Main/ICSharpCode.SharpDevelop.Sda/ICSharpCode.SharpDevelop.Sda.dll.config
18-
/src/Main/StartUp/Project/SharpDevelop.exe.config
18+
/src/Main/SharpDevelop/app.config
1919
/src/Main/GlobalAssemblyInfo.cs
20+
/src/Main/GlobalAssemblyInfo.vb
2021
/src/AddIns/Misc/UsageDataCollector/UsageDataCollector.AddIn/AnalyticsMonitor.AppProperties.cs
2122

2223
/src/AddIns/Misc/PackageManagement/Packages/AvalonEdit/lib

README.txt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,14 @@ How To Compile
2020
SharpDevelop can be compiled using the supplied .bat files, or in SharpDevelop itself.
2121

2222
System Requirements (running SharpDevelop)
23-
- Windows XP SP2 or higher.
24-
- .NET 4 prerequisites (might be already installed, e.g. by Windows Update):
25-
- Windows Installer 3.1: http://www.microsoft.com/downloads/details.aspx?familyid=889482FC-5F56-4A38-B838-DE776FD4138C&displaylang=en
26-
- Windows Imaging Component: http://www.microsoft.com/downloads/details.aspx?FamilyId=8E011506-6307-445B-B950-215DEF45DDD8&displaylang=en#filelist
27-
- .NET 4.0 Full (Extended, the "Client" portion is not sufficient)
23+
- Windows Vista or higher.
24+
- .NET 4.5
2825
- Visual C++ 2008 SP1 Runtime (http://www.microsoft.com/downloads/details.aspx?familyid=A5C84275-3B97-4AB7-A40D-3802B2AF5FC2&displaylang=en)
29-
26+
3027
Extended Requirements (building SharpDevelop)
3128
- .NET 3.5 SP1
32-
- Windows SDK 7.1
29+
- .NET 4.5 SDK (part of Windows SDK 8.0)
30+
- Windows SDK 7.1 (?? not sure if this still is necessary...)
3331
- Windows SDK 7.0 (optional; C++ compiler needed for profiler)
3432
- Windows PowerShell
3533
- if you have cloned the SD git repository: git must be available on your PATH
@@ -73,4 +71,4 @@ SharpDevelop Contributors:
7371
Siegfried Pammer
7472
Peter Forstmeier (SharpDevelop Reports)
7573

76-
(for a full list see http://wiki.sharpdevelop.net/Contributors.ashx)
74+
(for a full list see https://github.com/icsharpcode/SharpDevelop/wiki/Contributors)

SharpDevelop.Tests.sln

Lines changed: 471 additions & 1964 deletions
Large diffs are not rendered by default.

SharpDevelop.sln

Lines changed: 353 additions & 1494 deletions
Large diffs are not rendered by default.

TODOnewNR.txt

Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+

2+
Commented code, needs to be ported and re-enabled:
3+
ParseProjectContent
4+
Class Browser (removed from source tree; to be reimplemented using WPF)
5+
NRefactoryLanguageConverter
6+
Context Actions (EditorContext etc.)
7+
RefactoringService
8+
FindReferencesAndRenameHelper
9+
NamespaceRefactoringService
10+
RefactoringMenuBuilder
11+
TaskService.UpdateCommentTags
12+
CodeManipulation.cs (btw, I think this doesn't belong into AvalonEdit.AddIn - more a job for a language binding)
13+
14+
--> See TODO-list on Google Docs
15+
16+
Important features (self-hosting):
17+
Ctrl+Space Completion
18+
ctor snippet
19+
Rename refactoring
20+
Run unit test from icon bar margin
21+
"Add using" context action (and other resolve error MD context actions)
22+
ILSpy-AddIn
23+
24+
Stuff that was renamed/moved:
25+
ICSharpCode.SharpDevelop.Dom -> the type system and resolvers now are part of ICSharpCode.NRefactory
26+
IDocument -> moved to ICSharpCode.NRefactory.Editor
27+
IClass -> ITypeDefinition
28+
ICompilationUnit -> IUnresolvedFile
29+
ITextBuffer -> ITextSource (in ICSharpCode.NRefactory.Editor)
30+
IReturnType -> ITypeReference (unresolved) or IType (resolved)
31+
Location -> TextLocation in ICSharpCode.NRefactory
32+
TextLocation -> moved to ICSharpCode.NRefactory
33+
34+
Functionality changes:
35+
36+
SharpDevelop.Dom was replaced by NRefactory 5:
37+
Apart from plenty of API changes, there are also a couple of architectural changes
38+
to look out for.
39+
Most importantly, the type system has been split up into an unresolved and a resolved
40+
version. When porting code using SD.Dom, be careful which one of the two you choose.
41+
42+
If possible, try to avoid using the unresolved type system. The planned observable code model
43+
(will be implemented for the 5.0 class browser) might be a better alternative in some cases.
44+
Features related to the type system / refactorings should probably wait for this code model
45+
before they are ported to 5.0.
46+
47+
NRefactory 5 introduction: http://www.codeproject.com/Articles/408663/Using-NRefactory-for-analyzing-Csharp-code
48+
49+
50+
Static services replaced with interfaces:
51+
To make writing unit tests easier, the static services in SharpDevelop are getting
52+
replaced with interfaces. The class "SD" has static properties to get references
53+
to the services, so the call "ResourceService.GetString()" becomes "SD.ResourceService.GetString()".
54+
55+
In unit tests, Rhino.Mocks can be used to easily create mocks of the services:
56+
SD.InitializeForUnitTests(); // initialize container and remove services from previous test cases
57+
SD.Services.AddService(typeof(IParserService), MockRepository.GenerateStrictMock<IParserService>());
58+
SD.ParserService.Stub(p => p.GetCachedParseInformation(textEditor.FileName)).Return(parseInfo);
59+
SD.ParserService.Stub(p => p.GetCompilationForFile(textEditor.FileName)).Return(compilation);
60+
61+
It is possible to define a service interface in ICSharpCode.SharpDevelop.dll and have the implementation
62+
somewhere else (SD will find it using the AddInTree).
63+
This allows for AddIns to consume each other's functionality (e.g. debugger accessing the decompiler service)
64+
without having to define a custom AddIn tree path.
65+
The long-term goal is to have only interfaces and helper classes in ICSharpCode.SharpDevelop.dll (the API for AddIns)
66+
and have the implementation details in SharpDevelop.exe (which AddIns aren't supposed to reference).
67+
68+
69+
ICSharpCode.Core.WinForms hidden behind service interfaces:
70+
This is an extension of the previous point.
71+
The whole assembly ICSharpCode.Core.WinForms still exists and has the old static services,
72+
which makes porting old AddIns a bit easier.
73+
However, it should no longer be used in new code and AddIns should get rid of the reference
74+
to ICSharpCode.Core.WinForms if possible.
75+
The services in SD.WinForms provide the same functionality.
76+
77+
78+
Namespaces in ICSharpCode.SharpDevelop reorganized:
79+
I'm currently moving types around in ICSharpCode.SharpDevelop, so you'll have to update
80+
plenty of usings.
81+
The idea behind the new namespaces is that grouping the code into 'Gui' and 'Services'
82+
isn't very useful; so I'm getting rid of those namespaces and the old folder structure,
83+
and re-group the types into feature areas.
84+
85+
Within the ICSharpCode.SharpDevelop project, the 'Src' folder contains the old code
86+
that hasn't been cleaned up yet and may still be in an old namespace.
87+
88+
When I'm done cleaning up a code file, I'm moving to out of the 'Src' folder into one of
89+
the new folders corresponding to the new namespace.
90+
As part of this cleanup, I'm also replacing static services with service interfaces (see above).
91+
92+
93+
AddInTree paths reorganized
94+
Plenty of AddIn tree paths have been changed to better match the new namespace structure.
95+
96+
I used a global replace operation for renaming paths; so AddIns that are in the SharpDevelop
97+
repository but not in the SharpDevelop solution (because they haven't been ported yet)
98+
have been adjusted as well.
99+
100+
101+
SD.MainThread:
102+
The new best way to invoke a call on the main thread is:
103+
SD.MainThread.InvokeAsync(delegate { ... }).FireAndForget();
104+
105+
Note that InvokeAsync returns a Task (like all .NET 4.5 *Async APIs). If any exceptions occur while
106+
executing the delegate, they will get stored in the task object. This can cause the exception to get
107+
silently ignored if the task object isn't used later. The "FireAndForget()" extension method solves
108+
this problem by reporting any (future) errors to the message service.
109+
110+
It is also often possible to avoid explicit thread switches alltogether by using the C# 5 async/await feature.
111+
112+
113+
ICSharpCode.Core.ICommand replaced with WPF ICommand
114+
New menu commands should derive from 'SimpleCommand' instead of 'AbstractMenuCommand'.
115+
If 'IsEnabled'-handling is required, new commands should just implement ICommand directly without using any base class.
116+
117+
The old class AbstractMenuCommand still exist and simulates the old API, which makes porting AddIns a bit easier.
118+
I'm thinking about writing a tool that automatically ports AbstractMenuCommand-derived classes to SimpleCommand,
119+
so you don't need to bother updating your commands manually.
120+
121+
122+
SD.PropertyService:
123+
The Get()/Set() methods no longer support nested Properties objects or lists of elements -
124+
you will need to use the new dedicated GetList()/SetList()/NestedProperties() methods for that.
125+
126+
The Get() method no longer causes the default value to be stored in the container; and GetList()
127+
results in a read-only list - an explicit SetList() call is required to store the resulting value again.
128+
129+
However, a nested properties container still is connected with its parent, and any changes done
130+
to the nested container will get saves without having to call the SetNestedProperties() method.
131+
132+
The property service now uses XAML serialization instead of XML serialization. This might require
133+
some changes to your classes to ensure they get serialized correctly, for example
134+
you need to use public properties instead of public fields.
135+
136+
137+
SD.ParserService:
138+
The result of a parser run (ParseInformation) now may contain a fully parsed AST.
139+
The ParserService may cache such full ASTs, but may also drop them from memory at any time.
140+
This will be implemented by keeping the last N accessed files in the cache. (currently we just keep the caches around forever)
141+
Every parse information also contains an IUnresolvedFile instance with the type system information.
142+
The IUnresolvedFile is stored permanently (both in ParserService and in the IProjectContents).
143+
144+
145+
Solution model:
146+
The class 'Solution' has been replaced with the interface 'ISolution'.
147+
The static events that report changes to the solution (e.g. project added) no longer exist on IProjectService;
148+
instead the ISolution.Projects collection itself has a changed event.
149+
150+
151+
Text editor and document services:
152+
In SharpDevelop 4.x it was possible to use IDocument.GetService(typeof(ITextEditor)) to find the
153+
editor that presents the document.
154+
This is no longer possible in SharpDevelop 5, as the same IDocument may be used by
155+
multiple editors (e.g. split view).
156+
157+
ITextEditor and IDocument now use separate service containers.
158+
ITextEditor.GetService() will also return document services, but not the other way around.
159+
160+
The attributes [DocumentService] and [TextEditorService] are used to mark the service interfaces
161+
that are available in the document and in the editor respectively.
162+
The attributes exist purely for documentation, and some services may not use them
163+
(for example the service interfaces defined in AvalonEdit, where the attributes aren't referenced).
164+
165+
166+
View content services:
167+
Instead of casting a view content to an interface "var x = viewContent as IEditable;",
168+
code should use the viewContent.GetService() method.
169+
This allows the view content implementation to be flexible where the interface is implemented,
170+
it no longer is necessary to implement everything in the same class.
171+
172+
Interfaces that are supposed to be used as view content services are marked with the
173+
[ViewContentService] attribute.
174+
175+
In the case of the AvalonEditViewContent, all text editor and document services are
176+
also available via IViewContent.GetService().
177+
If split view is in use, the view content will return the services from the editor that has the focus.
178+
179+
180+
XML Forms:
181+
Classic .xfrm still exists and can be used in SD 5.0.
182+
However XML forms support should be considered a temporary feature for making AddIns easier to port,
183+
we still plan to get rid of all .xfrms and the associated infrastructure by the time SD 5.0 ships.
184+
185+
Simply porting an .xfrm to a regular WinForms control with InitializeComponents() is acceptable,
186+
but porting it to WPF is preferred.
187+
188+
189+
190+
What wasn't changed:
191+
192+
SD-1234 still makes implementing view contents difficult by preventing them from loading/saving
193+
files when they want to. I'd like to fix this, but this likely won't fit into 5.0 and will have to wait for 5.1.
194+
195+
196+
The IProject/ProjectItem model is mostly unchanged and still does not provide proper change notifications
197+
(apart from those in the static ProjectService).
198+
Lacking a good project model, we also haven't started moving the project browser to WPF.
199+
This is a major refactoring on top of the already existing major changes in 5.0, so it doesn't fit.
200+
But it's definitely a goal for 5.1.
201+
202+
203+
Context Actions vs. Member Context Menu:
204+
Members context menu should include refactoring options that can be applied from the outside,
205+
for example in the classes pad when the code file isn't open.
206+
Refactorings that don't make sense without opening the file shouldn't be in the member menu.
207+
208+
The context actions menu should show all refactorings (even those that are also in the members context menu).
209+
210+
Automatic Translation:
211+
WorkbenchSingleton.AssertMainThread() -> SD.MainThread.VerifyAccess()
212+
AbstractMenuCommand-derived classes that do not override IsEnabled -> SimpleCommand

data/options/SharpDevelopProperties.xml

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)