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

Commit 2b55aeb

Browse files
author
tbulle
committed
Merge branch 'master' of github.com:gumme/SharpDevelop
2 parents 6f7ebb5 + 3759d08 commit 2b55aeb

85 files changed

Lines changed: 1289 additions & 1049 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.
-17.9 KB
Binary file not shown.
-177 KB
Binary file not shown.

src/AddIns/Analysis/CodeQuality/Gui/MainView.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
using System;
2020
using System.Collections.Generic;
2121
using System.Collections.ObjectModel;
22+
using System.IO;
2223
using System.Windows;
2324
using System.Windows.Controls;
2425

@@ -72,7 +73,7 @@ void AddCurrentProjectAssemblyClick(object sender, RoutedEventArgs e)
7273
return;
7374

7475
string fileName = ProjectService.CurrentProject.OutputAssemblyFullPath;
75-
if (string.IsNullOrEmpty(fileName))
76+
if (!File.Exists(fileName))
7677
{
7778
MessageBox.Show("Project output assembly not found! Please build it first!");
7879
return;

src/AddIns/BackendBindings/CSharpBinding/Project/Src/CaretReferenceHighlightRenderer.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ public void Dispose()
7979
public void Draw(TextView textView, DrawingContext drawingContext)
8080
{
8181
if (currentReferences == null) {
82+
if (textView.VisualLines.Count == 0)
83+
return;
8284
var start = textView.VisualLines.First().FirstDocumentLine.LineNumber;
8385
var end = textView.VisualLines.Last().LastDocumentLine.LineNumber;
8486
currentReferences = new List<ISegment>();
@@ -188,7 +190,7 @@ void ColorizeMatch(AstNode node, ResolveResult result)
188190
{
189191
var identifierNode = FindReferences.GetNodeToReplace(node);
190192
TextLocation start, end;
191-
if (!identifierNode.IsNull) {
193+
if (identifierNode != null && !identifierNode.IsNull) {
192194
start = identifierNode.StartLocation;
193195
end = identifierNode.EndLocation;
194196
}

src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/EditorScript.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ void InsertWithCursorOnLayer(EditorScript currentScript, InsertionCursorLayer la
152152
if (doc != null) {
153153
doc.UndoStack.Push(op);
154154
}
155+
layer.ScrollToInsertionPoint();
155156
layer.Exited += delegate(object s, InsertionCursorEventArgs args) {
156157
doc.UndoStack.StartContinuedUndoGroup();
157158
try {

src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/InsertionCursorLayer.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ public InsertionCursorLayer(TextArea editor, string operation, IList<InsertionPo
6565
this.editor.TextView.InsertLayer(this, KnownLayer.Text, LayerInsertionPosition.Above);
6666
this.editor.TextView.ScrollOffsetChanged += TextViewScrollOffsetChanged;
6767
AddGroupBox();
68-
ScrollToInsertionPoint();
6968
}
7069

7170
static readonly Pen markerPen = new Pen(Brushes.Blue, 2);
@@ -246,7 +245,7 @@ void InsertCode(object sender, ExecutedRoutedEventArgs e)
246245
FireExited(true);
247246
}
248247

249-
void ScrollToInsertionPoint()
248+
internal void ScrollToInsertionPoint()
250249
{
251250
var location = insertionPoints[CurrentInsertionPoint].Location;
252251
editor.GetService<TextEditor>().ScrollTo(location.Line, location.Column);

src/AddIns/BackendBindings/CSharpBinding/Project/Src/Refactoring/IssueManager.cs

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,7 @@ Task<IContextAction[]> IContextActionProvider.GetAvailableActionsAsync(EditorRef
345345
result.AddRange(tag.Actions);
346346
string issueName;
347347
if (CanSuppress(tag, out issueName)) {
348-
result.Add(new SuppressIssueContextAction(issueName, SuppressType.Once));
349-
result.Add(new SuppressIssueContextAction(issueName, SuppressType.Always));
348+
result.Add(new SuppressIssueContextAction(issueName));
350349
}
351350
}
352351
}
@@ -363,21 +362,14 @@ bool CanSuppress(InspectionTag tag, out string issueName)
363362
return true;
364363
}
365364

366-
enum SuppressType {
367-
Once,
368-
Always
369-
}
370-
371365
[ContextAction("Suppress issue", Description = "Suppresses an issue.")]
372366
class SuppressIssueContextAction : ContextAction
373367
{
374368
string issueName;
375-
SuppressType type;
376369

377-
public SuppressIssueContextAction(string issueName, SuppressType type)
370+
public SuppressIssueContextAction(string issueName)
378371
{
379372
this.issueName = issueName;
380-
this.type = type;
381373
}
382374

383375
public override Task<bool> IsAvailableAsync(EditorRefactoringContext context, CancellationToken cancellationToken)
@@ -387,27 +379,21 @@ public override Task<bool> IsAvailableAsync(EditorRefactoringContext context, Ca
387379

388380
public override string DisplayName
389381
{
390-
get {
391-
string fmt;
392-
if (type == SuppressType.Once)
393-
fmt = "Suppress '{0}' once";
394-
else
395-
fmt = "Suppress '{0}'";
396-
return string.Format(fmt, issueName);
397-
}
382+
get { return string.Format("Suppress '{0}'", issueName); }
398383
}
399384

400385
public override void Execute(EditorRefactoringContext context)
401386
{
402-
var myContext = SDRefactoringContext.Create(context.Editor, default(CancellationToken));
403-
var currentNode = myContext.RootNode.GetNodeAt<Statement>(context.CaretLocation);
404-
if (currentNode == null)
405-
return;
406-
using (var script = myContext.StartScript()) {
407-
script.InsertBefore(currentNode, new Comment(string.Format(" disable{1}{0}", issueName, type == SuppressType.Once ? " once " : " ")));
408-
}
387+
SD.AnalyticsMonitor.TrackFeature(typeof(SuppressIssueContextAction), issueName);
388+
var lineNo = context.CaretLocation.Line;
389+
var document = context.Editor.Document;
390+
391+
var line = document.GetLineByNumber(lineNo);
392+
string indentation = DocumentUtilities.GetIndentation(document, lineNo);
393+
string newLine = DocumentUtilities.GetLineTerminator(document, lineNo);
394+
document.Insert(line.Offset, indentation + "// disable once " + issueName + newLine);
409395
}
410396
}
411-
#endregion
412397
}
398+
#endregion
413399
}

src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/ContextActions/ClipboardRingAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class ClipboardRingAction : IContextAction
2424

2525
public ClipboardRingAction(string text)
2626
{
27-
string entry = text.Trim();
27+
string entry = System.Text.RegularExpressions.Regex.Replace(text.Trim(), @"\s+", " ");
2828
if(entry.Length > maxLength)
2929
entry = entry.Substring(0, maxLength-endString.Length) + endString;
3030

src/AddIns/DisplayBindings/FormsDesigner/Project/Src/DesignerViewContent.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,7 @@ public void ShowHelp()
510510

511511
void LoadAndDisplayDesigner()
512512
{
513+
SD.AnalyticsMonitor.TrackFeature(typeof(FormsDesignerViewContent), "Load");
513514
try {
514515

515516
LoadDesigner();
@@ -627,6 +628,7 @@ static string FormatLoadErrors(DesignSurface designSurface)
627628

628629
public virtual void MergeFormChanges()
629630
{
631+
SD.AnalyticsMonitor.TrackFeature(typeof(FormsDesignerViewContent), "Save");
630632
if (this.HasLoadError || this.designSurface == null) {
631633
LoggingService.Debug("Forms designer: Cannot merge form changes because the designer is not loaded successfully or not loaded at all");
632634
return;

src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/WpfViewContent.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ protected override void LoadInternal(OpenedFile file, System.IO.Stream stream)
8484
{
8585
wasChangedInDesigner = false;
8686
Debug.Assert(file == this.PrimaryFile);
87+
SD.AnalyticsMonitor.TrackFeature(typeof(WpfViewContent), "Load");
8788

8889
_stream = new MemoryStream();
8990
stream.CopyTo(_stream);
@@ -137,6 +138,7 @@ protected override void LoadInternal(OpenedFile file, System.IO.Stream stream)
137138
protected override void SaveInternal(OpenedFile file, System.IO.Stream stream)
138139
{
139140
if (wasChangedInDesigner && designer.DesignContext != null) {
141+
SD.AnalyticsMonitor.TrackFeature(typeof(WpfViewContent), "Save");
140142
XmlWriterSettings settings = new XmlWriterSettings();
141143
settings.Indent = true;
142144
settings.IndentChars = SD.EditorControlService.GlobalOptions.IndentationString;

0 commit comments

Comments
 (0)