Browse Source

Fixed some problems reported in the forum.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2140 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 19 years ago
parent
commit
f5793ea348
  1. 6
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Document/MarkerStrategy/TextMarker.cs
  2. 23
      src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Lexer.cs
  3. 4
      src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs

6
src/Libraries/ICSharpCode.TextEditor/Project/Src/Document/MarkerStrategy/TextMarker.cs

@ -76,8 +76,7 @@ namespace ICSharpCode.TextEditor.Document @@ -76,8 +76,7 @@ namespace ICSharpCode.TextEditor.Document
public TextMarker(int offset, int length, TextMarkerType textMarkerType, Color color)
{
if (length < 1)
throw new ArgumentOutOfRangeException("length", length, "length must be >= 1");
if (length < 1) length = 1;
this.offset = offset;
this.length = length;
this.textMarkerType = textMarkerType;
@ -86,8 +85,7 @@ namespace ICSharpCode.TextEditor.Document @@ -86,8 +85,7 @@ namespace ICSharpCode.TextEditor.Document
public TextMarker(int offset, int length, TextMarkerType textMarkerType, Color color, Color foreColor)
{
if (length < 1)
throw new ArgumentOutOfRangeException("length", length, "length must be >= 1");
if (length < 1) length = 1;
this.offset = offset;
this.length = length;
this.textMarkerType = textMarkerType;

23
src/Libraries/NRefactory/Project/Src/Lexer/CSharp/Lexer.cs

@ -776,21 +776,44 @@ namespace ICSharpCode.NRefactory.Parser.CSharp @@ -776,21 +776,44 @@ namespace ICSharpCode.NRefactory.Parser.CSharp
}
} else {
specialTracker.StartComment(CommentType.Block, new Location(Col, Line));
// sc* = special comment handling (TO DO markers)
string scTag = null; // is set to non-null value when we are inside a comment marker
StringBuilder scCurWord = new StringBuilder(); // current word, (scTag == null) or comment (when scTag != null)
Location scStartLocation = Location.Empty;
while ((nextChar = ReaderRead()) != -1) {
char ch = (char)nextChar;
if (HandleLineEnd(ch)) {
if (scTag != null) {
this.TagComments.Add(new TagComment(scTag, scCurWord.ToString(), scStartLocation, new Location(Col, Line)));
scTag = null;
}
scCurWord.Length = 0;
specialTracker.AddString(Environment.NewLine);
continue;
}
// End of multiline comment reached ?
if (ch == '*' && ReaderPeek() == '/') {
if (scTag != null) {
this.TagComments.Add(new TagComment(scTag, scCurWord.ToString(), scStartLocation, new Location(Col, Line)));
}
ReaderRead();
specialTracker.FinishComment(new Location(Col, Line));
return;
}
specialTracker.AddChar(ch);
if (scTag != null || IsIdentifierPart(ch)) {
scCurWord.Append(ch);
} else {
if (specialCommentHash != null && specialCommentHash.ContainsKey(scCurWord.ToString())) {
scTag = scCurWord.ToString();
scStartLocation = new Location(Col, Line);
}
scCurWord.Length = 0;
}
}
specialTracker.FinishComment(new Location(Col, Line));
}

4
src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs

@ -262,6 +262,10 @@ namespace ICSharpCode.SharpDevelop.Project @@ -262,6 +262,10 @@ namespace ICSharpCode.SharpDevelop.Project
} else {
(openSolution.Preferences as IMementoCapable).SetMemento(new Properties());
}
} catch (Exception ex) {
MessageService.ShowError(ex);
}
try {
ApplyConfigurationAndReadPreferences();
} catch (Exception ex) {
MessageService.ShowError(ex);

Loading…
Cancel
Save