Browse Source

Small bug fixes (StatusBar, ProjectContent).

Also, GetCorLibProjectContent() is now called directly after startup (so the classes are loaded while the user chooses the project)
Fixed output path of some addins in release build.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@132 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
5ee7ff51e4
  1. 2
      src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin
  2. 2
      src/AddIns/BackendBindings/VBNetBinding/Project/VBNetBinding.addin
  3. 4
      src/AddIns/DisplayBindings/ResourceEditor/Project/ResourceEditor.csproj
  4. 2
      src/AddIns/Misc/AddinScout/Project/AddinScout.csproj
  5. 2
      src/AddIns/Misc/FiletypeRegisterer/Project/FiletypeRegisterer.csproj
  6. 4
      src/AddIns/Misc/RegExpTk/Project/RegExpTk.csproj
  7. 42
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/GutterMargin.cs
  8. 2
      src/Libraries/NRefactory/Project/NRefactory.csproj
  9. 13
      src/Main/Base/Project/Src/Gui/Components/StatusBar/SdStatusBar.cs
  10. 2
      src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/CompilerMessageView.cs
  11. 6
      src/Main/Base/Project/Src/Services/ParserService/CaseSensitiveProjectContent.cs
  12. 10
      src/Main/Base/Project/Src/Services/ParserService/ParserService.cs
  13. 70
      src/Main/Base/Project/Src/Services/ParserService/ProjectContentRegistry.cs

2
src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin

@ -59,7 +59,7 @@ @@ -59,7 +59,7 @@
</Path>
<Path name = "/AddIns/DefaultTextEditor/Formatter/C#">
<Class id ="CSharpFormatter" insertbefore="DefaultFormatter" class = "CSharpBinding.FormattingStrategy.CSharpFormattingStrategy"/>
<Class id ="CSharpFormatter" class = "CSharpBinding.FormattingStrategy.CSharpFormattingStrategy"/>
</Path>
<Path name = "/Workspace/Icons">

2
src/AddIns/BackendBindings/VBNetBinding/Project/VBNetBinding.addin

@ -59,7 +59,7 @@ @@ -59,7 +59,7 @@
</Path>
<Path name = "/AddIns/DefaultTextEditor/Formatter/VBNET">
<Class id ="VBNetFormatter" insertbefore="DefaultFormatter" class = "VBNetBinding.FormattingStrategy.VBFormattingStrategy"/>
<Class id ="VBNetFormatter" class = "VBNetBinding.FormattingStrategy.VBFormattingStrategy"/>
</Path>
<Path name = "/Workspace/Icons">

4
src/AddIns/DisplayBindings/ResourceEditor/Project/ResourceEditor.csproj

@ -22,8 +22,8 @@ @@ -22,8 +22,8 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>False</DebugSymbols>
<Optimize>True</Optimize>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<OutputPath>..\..\..\AddIns\DisplayBindings\</OutputPath>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<OutputPath>..\..\..\..\..\AddIns\AddIns\DisplayBindings\ResourceEditor\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />

2
src/AddIns/Misc/AddinScout/Project/AddinScout.csproj

@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>False</DebugSymbols>
<Optimize>True</Optimize>
<OutputPath>..\..\..\AddIns\Misc\AddinScout\</OutputPath>
<OutputPath>..\..\..\..\..\AddIns\AddIns\Misc\AddinScout\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />

2
src/AddIns/Misc/FiletypeRegisterer/Project/FiletypeRegisterer.csproj

@ -22,7 +22,7 @@ @@ -22,7 +22,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>False</DebugSymbols>
<Optimize>True</Optimize>
<OutputPath>..\..\..\AddIns\Misc\FiletypeRegisterer\</OutputPath>
<OutputPath>..\..\..\..\..\AddIns\AddIns\Misc\FiletypeRegisterer\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />

4
src/AddIns/Misc/RegExpTk/Project/RegExpTk.csproj

@ -26,8 +26,8 @@ @@ -26,8 +26,8 @@
<DebugSymbols>False</DebugSymbols>
<Optimize>True</Optimize>
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<OutputPath>..\..\..\AddIns\Misc\RegExpTk\</OutputPath>
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
<OutputPath>..\..\..\..\..\AddIns\AddIns\Misc\RegExpTk\</OutputPath>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>

42
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/GutterMargin.cs

@ -90,9 +90,11 @@ namespace ICSharpCode.TextEditor @@ -90,9 +90,11 @@ namespace ICSharpCode.TextEditor
Point selectionStartPos;
bool selectionComeFromGutter = false;
bool selectionGutterDirectionDown = false;
public override void HandleMouseDown(Point mousepos, MouseButtons mouseButtons)
{
selectionComeFromGutter = true;
selectionGutterDirectionDown = false;
int realline = textArea.TextView.GetLogicalLine(mousepos);
if (realline >= 0 && realline < textArea.Document.TotalNumberOfLines) {
selectionStartPos = new Point(0, realline);
@ -111,33 +113,39 @@ namespace ICSharpCode.TextEditor @@ -111,33 +113,39 @@ namespace ICSharpCode.TextEditor
{
if (mouseButtons == MouseButtons.Left) {
if (selectionComeFromGutter) {
//TODO: Fix handling of mouse moving off to the left of the gutter before moving the selection down. Behaviour of selection changes after mouse moves left of gutter while selecting lines
int realline = textArea.TextView.GetLogicalLine(mousepos);
Point realmousepos = new Point(0, realline);
if (realmousepos.Y < textArea.Document.TotalNumberOfLines) {
if (selectionStartPos.Y == realmousepos.Y) {
// this setselection defaults for an upward moving selection
// this setselection defaults for a downward moving selection
textArea.SelectionManager.SetSelection(new DefaultSelection(textArea.Document, realmousepos, new Point(textArea.Document.GetLineSegment(realmousepos.Y).Length + 1, realmousepos.Y)));
} else if (selectionStartPos.Y < realmousepos.Y && textArea.SelectionManager.HasSomethingSelected) {
selectionGutterDirectionDown = false;
} else if (selectionStartPos.Y < realmousepos.Y && textArea.SelectionManager.HasSomethingSelected) {
// this fixes the selection for moving the selection down
if (realmousepos.Y - selectionStartPos.Y == 1) { // only fix for first line movement
Point lastmousepos = realmousepos;
lastmousepos.Y -= 1;
textArea.SelectionManager.SetSelection(new DefaultSelection(textArea.Document, lastmousepos, new Point(0, lastmousepos.Y)));
if (! selectionGutterDirectionDown) { //realmousepos.Y - selectionStartPos.Y == 1) {
selectionGutterDirectionDown = true;
textArea.SelectionManager.SetSelection(new DefaultSelection(textArea.Document, selectionStartPos, new Point(0, selectionStartPos.Y)));
// this enforces the screen area update
textArea.SelectionManager.ExtendSelection(textArea.SelectionManager.SelectionCollection[0].EndPosition, new Point(textArea.Document.GetLineSegment(realmousepos.Y).Length + 1, realmousepos.Y));
} else {
// selection is extended to the end of the current line
textArea.SelectionManager.ExtendSelection(textArea.SelectionManager.SelectionCollection[0].EndPosition, new Point(textArea.Document.GetLineSegment(realmousepos.Y).Length + 1, realmousepos.Y));
}
textArea.SelectionManager.ExtendSelection(textArea.SelectionManager.SelectionCollection[0].EndPosition, realmousepos);
} else {
// this fixes the selection for moving the selection up
if (selectionStartPos.Y - realmousepos.Y == 1) { // only fix for first line movement
Point lastmousepos = realmousepos;
lastmousepos.Y += 1;
textArea.SelectionManager.SetSelection(new DefaultSelection(textArea.Document, lastmousepos, new Point(textArea.Document.GetLineSegment(lastmousepos.Y).Length + 1, lastmousepos.Y)));
// move the extendselection to here to fix textarea update issues
textArea.SelectionManager.ExtendSelection(lastmousepos, realmousepos);
} else {
textArea.SelectionManager.ExtendSelection(textArea.Caret.Position, realmousepos);
if(textArea.SelectionManager.HasSomethingSelected) {
// this fixes the selection for moving the selection up
if (selectionGutterDirectionDown) { // selectionStartPos.Y - realmousepos.Y == 1) { // only fix for first line movement
selectionGutterDirectionDown = false;
textArea.SelectionManager.SetSelection(new DefaultSelection(textArea.Document, selectionStartPos, new Point(textArea.Document.GetLineSegment(selectionStartPos.Y).Length + 1, selectionStartPos.Y)));
// move the extendselection to here to fix textarea update issues
textArea.SelectionManager.ExtendSelection(selectionStartPos, realmousepos);
} else {
textArea.SelectionManager.ExtendSelection(textArea.Caret.Position, realmousepos);
}
}
}
textArea.Caret.Position = realmousepos;
}
} else {

2
src/Libraries/NRefactory/Project/NRefactory.csproj

@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
<ProductVersion>8.0.41115</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{3A9AE6AA-BC07-4A2F-972C-581E3AE2F195}</ProjectGuid>
<RootNamespace>NewProject</RootNamespace>
<RootNamespace>ICSharpCode.NRefactory</RootNamespace>
<AssemblyName>ICSharpCode.NRefactory</AssemblyName>
<OutputTarget>Library</OutputTarget>
<WarningLevel>4</WarningLevel>

13
src/Main/Base/Project/Src/Gui/Components/StatusBar/SdStatusBar.cs

@ -19,6 +19,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -19,6 +19,7 @@ namespace ICSharpCode.SharpDevelop.Gui
ToolStripStatusLabel txtStatusBarPanel = new ToolStripStatusLabel();
ToolStripStatusLabel cursorStatusBarPanel = new ToolStripStatusLabel();
ToolStripStatusLabel modeStatusBarPanel = new ToolStripStatusLabel();
ToolStripStatusLabel springLabel = new ToolStripStatusLabel();
public ToolStripStatusLabel CursorStatusBarPanel {
get {
@ -67,11 +68,14 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -67,11 +68,14 @@ namespace ICSharpCode.SharpDevelop.Gui
// modeStatusBarPanel.AutoSize = StatusBarPanelAutoSize.None;
// modeStatusBarPanel.Alignment = HorizontalAlignment.Right;
// Panels.Add(modeStatusBarPanel);
ToolStripStatusLabel springLabel = new ToolStripStatusLabel();
springLabel.Spring = true;
jobNamePanel.Visible = false;
cursorStatusBarPanel.AutoSize = false;
cursorStatusBarPanel.Width = 160;
modeStatusBarPanel.AutoSize = false;
modeStatusBarPanel.Width = 35;
statusProgressBar.Visible = false;
statusProgressBar.Size = new Size(100, 20);
statusProgressBar.Width = 100;
Items.AddRange(new ToolStripItem[] { txtStatusBarPanel, springLabel, jobNamePanel, statusProgressBar, cursorStatusBarPanel, modeStatusBarPanel });
}
@ -132,7 +136,8 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -132,7 +136,8 @@ namespace ICSharpCode.SharpDevelop.Gui
void MakeInvisible()
{
jobNamePanel.Visible = false;
// Setting jobNamePanel.Visible = false will also hide the other labels to the right (WinForms Bug?)
jobNamePanel.Text = "";
statusProgressBar.Visible = false;
}

2
src/Main/Base/Project/Src/Gui/Pads/CompilerMessageView/CompilerMessageView.cs

@ -126,7 +126,7 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -126,7 +126,7 @@ namespace ICSharpCode.SharpDevelop.Gui
SetWordWrap();
myPanel.ResumeLayout(false);
WorkbenchSingleton.SafeThreadCall(this, "SetText", StringParser.Parse(messageCategories[selectedCategory].Text));
SetText(StringParser.Parse(messageCategories[selectedCategory].Text));
}
void SetWordWrap()

6
src/Main/Base/Project/Src/Services/ParserService/CaseSensitiveProjectContent.cs

@ -121,7 +121,9 @@ namespace ICSharpCode.Core @@ -121,7 +121,9 @@ namespace ICSharpCode.Core
public static IProjectContent Create(Assembly assembly)
{
DefaultProjectContent newProjectContent = new DefaultProjectContent();
if (typeof(object).Assembly != assembly) {
newProjectContent.referencedContents.Add(ProjectContentRegistry.GetMscorlibContent());
}
ICompilationUnit assemblyCompilationUnit = new DefaultCompilationUnit(newProjectContent);
foreach (Type type in assembly.GetTypes()) {
@ -253,8 +255,6 @@ namespace ICSharpCode.Core @@ -253,8 +255,6 @@ namespace ICSharpCode.Core
public void UpdateCompilationUnit(ICompilationUnit oldUnit, ICompilationUnit parserOutput, string fileName, bool updateCommentTags)
{
// TODO: UpdateCommentTags must run on the main thread
// (use fire+forget because main thread could be waiting on this thread to finish)
if (updateCommentTags) {
TaskService.UpdateCommentTags(fileName, parserOutput.TagComments);
}

10
src/Main/Base/Project/Src/Services/ParserService/ParserService.cs

@ -155,16 +155,22 @@ namespace ICSharpCode.Core @@ -155,16 +155,22 @@ namespace ICSharpCode.Core
parserThread.Start();
}
static bool doneParserThread = false;
static Dictionary<string, int> lastUpdateSize = new Dictionary<string, int>();
static void ParserUpdateThread()
{
while (!doneParserThread) {
// preload mscorlib, we're going to need it anyway
ProjectContentRegistry.GetMscorlibContent();
while (true) {
try {
ParserUpdateStep();
} catch (Exception e) {
ICSharpCode.Core.MessageService.ShowError(e);
// don't fire an exception every 2 seconds at the user, give him at least
// time to read the first :-)
Thread.Sleep(10000);
}
Thread.Sleep(2000);
}

70
src/Main/Base/Project/Src/Services/ParserService/ProjectContentRegistry.cs

@ -28,11 +28,22 @@ namespace ICSharpCode.Core @@ -28,11 +28,22 @@ namespace ICSharpCode.Core
public static IProjectContent GetMscorlibContent()
{
if (contents.ContainsKey("mscorlib")) {
lock (contents) {
if (contents.ContainsKey("mscorlib")) {
return contents["mscorlib"];
}
#if DEBUG
Console.WriteLine("Loading mscorlib...");
int time = Environment.TickCount;
#endif
contents["mscorlib"] = DefaultProjectContent.Create(typeof(object).Assembly);
#if DEBUG
Console.WriteLine("mscorlib loaded in {0} ms", Environment.TickCount - time);
#endif
return contents["mscorlib"];
}
contents["mscorlib"] = DefaultProjectContent.Create(typeof(object).Assembly);
return contents["mscorlib"];
}
public static IProjectContent GetProjectContentForReference(ReferenceProjectItem item)
@ -40,37 +51,42 @@ namespace ICSharpCode.Core @@ -40,37 +51,42 @@ namespace ICSharpCode.Core
if (item is ProjectReferenceProjectItem) {
return ParserService.GetProjectContent(((ProjectReferenceProjectItem)item).ReferencedProject);
}
if (contents.ContainsKey(item.FileName)) {
return contents[item.FileName];
}
if (contents.ContainsKey(item.Include)) {
return contents[item.Include];
}
StatusBarService.ProgressMonitor.BeginTask("Loading " + item.Include + "...", 100);
int time = Environment.TickCount;
Assembly assembly = null;
try {
assembly = Assembly.ReflectionOnlyLoadFrom(item.FileName);
if (assembly != null) {
contents[item.FileName] = DefaultProjectContent.Create(assembly);
lock (contents) {
if (contents.ContainsKey(item.FileName)) {
return contents[item.FileName];
}
} catch (Exception) {
if (contents.ContainsKey(item.Include)) {
return contents[item.Include];
}
StatusBarService.ProgressMonitor.BeginTask("Loading " + item.Include + "...", 100);
#if DEBUG
int time = Environment.TickCount;
#endif
Assembly assembly = null;
try {
assembly = LoadGACAssembly(item.Include, true);
assembly = Assembly.ReflectionOnlyLoadFrom(item.FileName);
if (assembly != null) {
contents[item.Include] = DefaultProjectContent.Create(assembly);
return contents[item.Include];
contents[item.FileName] = DefaultProjectContent.Create(assembly);
return contents[item.FileName];
}
} catch (Exception) {
try {
assembly = LoadGACAssembly(item.Include, true);
if (assembly != null) {
contents[item.Include] = DefaultProjectContent.Create(assembly);
return contents[item.Include];
}
} catch (Exception e) {
Console.WriteLine("Can't load assembly '{0}' : " + e.Message, item.Include);
}
} catch (Exception e) {
Console.WriteLine("Can't load assembly '{0}' : " + e.Message, item.Include);
} finally {
#if DEBUG
Console.WriteLine("Loaded {0} in {1}ms", item.Include, Environment.TickCount - time);
#endif
StatusBarService.ProgressMonitor.Done();
}
} finally {
Console.WriteLine("Loaded {0} in {1}ms", item.Include, Environment.TickCount - time);
StatusBarService.ProgressMonitor.Done();
}
return null;
}

Loading…
Cancel
Save