Browse Source

Fixed forum-7126: Template RunCommand's only work on new solutions

Forum-7191: When NSvn.Client initialization fails, disable project browser overlays.
Exception handler in ParserService.ParserFile: show the name of the file that caused the exception.
AsynchronousAdvancedHighlighter: do not try to highlight deleted lines. This should fix the bug reported in forum-7175.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2793 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 18 years ago
parent
commit
9736ca6d4f
  1. 6
      src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/HistoryViewDisplayBinding.cs
  2. 18
      src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/ProjectBrowserVisitor/OverlayIconManager.cs
  3. 2
      src/Main/Base/Project/Src/Gui/Dialogs/NewProjectDialog.cs
  4. 2
      src/Main/Base/Project/Src/Services/ParserService/ParserService.cs
  5. 2
      src/Main/Base/Project/Src/TextEditor/Gui/Editor/AdvancedHighlighter.cs

6
src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/HistoryViewDisplayBinding/HistoryViewDisplayBinding.cs

@ -43,7 +43,11 @@ namespace ICSharpCode.Svn
{ {
if (client == null) { if (client == null) {
LoggingService.Info("SVN: HistoryViewDisplayBinding initializes client"); LoggingService.Info("SVN: HistoryViewDisplayBinding initializes client");
client = new Client(); try {
client = new Client();
} catch (Exception ex) {
LoggingService.Warn(ex);
}
} }
try { try {
Status status = client.SingleStatus(Path.GetFullPath(fileName)); Status status = client.SingleStatus(Path.GetFullPath(fileName));

18
src/AddIns/Misc/SubversionAddIn/Project/Src/Gui/ProjectBrowserVisitor/OverlayIconManager.cs

@ -88,6 +88,8 @@ namespace ICSharpCode.Svn
public static void Enqueue(AbstractProjectBrowserTreeNode node) public static void Enqueue(AbstractProjectBrowserTreeNode node)
{ {
if (subversionDisabled)
return;
lock (queue) { lock (queue) {
queue.Enqueue(node); queue.Enqueue(node);
if (queue.Count == 1) { if (queue.Count == 1) {
@ -98,6 +100,8 @@ namespace ICSharpCode.Svn
public static void EnqueueRecursive(AbstractProjectBrowserTreeNode node) public static void EnqueueRecursive(AbstractProjectBrowserTreeNode node)
{ {
if (subversionDisabled)
return;
lock (queue) { lock (queue) {
bool wasEmpty = queue.Count == 0; bool wasEmpty = queue.Count == 0;
@ -123,6 +127,7 @@ namespace ICSharpCode.Svn
} }
static Client client; static Client client;
static bool subversionDisabled;
static void Run(object state) static void Run(object state)
{ {
@ -153,9 +158,18 @@ namespace ICSharpCode.Svn
static void RunStep(AbstractProjectBrowserTreeNode node) static void RunStep(AbstractProjectBrowserTreeNode node)
{ {
if (node.IsDisposed) return; if (subversionDisabled || node.IsDisposed) return;
if (client == null) { if (client == null) {
client = new Client(); try {
client = new Client();
} catch (Exception ex) {
SharpDevelop.Gui.WorkbenchSingleton.SafeThreadAsyncCall(
MessageService.ShowWarning,
"Error initializing Subversion library:\n" + ex.ToString()
);
subversionDisabled = true;
return;
}
} }
FileNode fileNode = node as FileNode; FileNode fileNode = node as FileNode;
Status status; Status status;

2
src/Main/Base/Project/Src/Gui/Dialogs/NewProjectDialog.cs

@ -337,8 +337,8 @@ namespace ICSharpCode.SharpDevelop.Project.Dialogs
} }
if (createNewSolution) { if (createNewSolution) {
ProjectService.LoadSolution(NewSolutionLocation); ProjectService.LoadSolution(NewSolutionLocation);
item.Template.RunOpenActions(cinfo);
} }
item.Template.RunOpenActions(cinfo);
NewProjectLocation = cinfo.createdProjects.Count > 0 ? cinfo.createdProjects[0].FileName : ""; NewProjectLocation = cinfo.createdProjects.Count > 0 ? cinfo.createdProjects[0].FileName : "";
DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;

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

@ -588,7 +588,7 @@ namespace ICSharpCode.SharpDevelop
} }
return UpdateParseInformation(parserOutput, fileName, updateCommentTags); return UpdateParseInformation(parserOutput, fileName, updateCommentTags);
} catch (Exception e) { } catch (Exception e) {
MessageService.ShowError(e); MessageService.ShowError(e, "Error parsing " + fileName);
} }
return null; return null;
} }

2
src/Main/Base/Project/Src/TextEditor/Gui/Editor/AdvancedHighlighter.cs

@ -169,6 +169,8 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
// We cannot call MarkLine inside lock(lockObject) because then the main // We cannot call MarkLine inside lock(lockObject) because then the main
// thread could deadlock with the highlighter thread. // thread could deadlock with the highlighter thread.
foreach (KeyValuePair<LineSegment, List<TextWord>> pair in oldOutstanding) { foreach (KeyValuePair<LineSegment, List<TextWord>> pair in oldOutstanding) {
if (pair.Key.IsDeleted)
continue;
int offset = pair.Key.Offset; int offset = pair.Key.Offset;
if (offset < 0 || offset >= document.TextLength) if (offset < 0 || offset >= document.TextLength)
continue; continue;

Loading…
Cancel
Save