5 changed files with 40 additions and 5 deletions
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
//
|
||||
using System; |
||||
using System.Linq; |
||||
using ICSharpCode.SharpDevelop; |
||||
using ICSharpCode.SharpDevelop.Editor.CodeCompletion; |
||||
|
||||
namespace CSharpBinding.Completion |
||||
{ |
||||
/// <summary>
|
||||
/// Completion item for XMLDoc tags.
|
||||
/// </summary>
|
||||
class XmlDocCompletionData : CompletionData |
||||
{ |
||||
public XmlDocCompletionData(string tag, string description, string tagInsertionText) : base(tag) |
||||
{ |
||||
this.Description = description; |
||||
this.CompletionText = tagInsertionText ?? tag; |
||||
this.Image = ClassBrowserIconService.CodeTemplate; |
||||
} |
||||
|
||||
public override void Complete(CompletionContext context) |
||||
{ |
||||
int index = CompletionText.IndexOf('|'); |
||||
if (index > -1) { |
||||
context.Editor.Document.Replace(context.StartOffset, context.Length, CompletionText.Remove(index, 1)); |
||||
context.Editor.Caret.Offset = context.StartOffset + index; |
||||
} else { |
||||
base.Complete(context); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
Loading…
Reference in new issue