diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2016-11-21 13:24:06 +0300 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2016-11-21 13:24:21 +0300 |
commit | 3c3f06c765319024dbd0860a7a697a7f4a6c619f (patch) | |
tree | eb34f64f711afce5067285853e6901c93146e58a /main/src/addins/MonoDevelop.DocFood | |
parent | e640218edeb35723b4bd141ef21de7f112177f91 (diff) |
Fixed 'Bug 47193 - Typing a tripple forward slash inside a string
results in doc comment generation'
Diffstat (limited to 'main/src/addins/MonoDevelop.DocFood')
-rw-r--r-- | main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/DocFoodTextEditorExtension.cs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/DocFoodTextEditorExtension.cs b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/DocFoodTextEditorExtension.cs index 16a4d01097..1faa165d06 100644 --- a/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/DocFoodTextEditorExtension.cs +++ b/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/DocFoodTextEditorExtension.cs @@ -32,6 +32,7 @@ using MonoDevelop.CSharp.Completion; using MonoDevelop.Ide.Editor; using MonoDevelop.Ide.Editor.Extension; using System.Threading; +using Microsoft.CodeAnalysis.CSharp; namespace MonoDevelop.DocFood { @@ -173,8 +174,12 @@ namespace MonoDevelop.DocFood var caretOffset = Editor.CaretOffset; var offset = caretOffset; var root = semanticModel.SyntaxTree.GetRoot (); + var tokenAtCaret = root.FindTrivia (offset - 1, true); + if (!tokenAtCaret.IsKind (SyntaxKind.SingleLineCommentTrivia)) + return null; while (offset < Editor.Length) { var node = root.FindNode (TextSpan.FromBounds (offset, offset)); + if (node == null || node.GetLastToken ().SpanStart < caretOffset) { offset++; continue; |