diff options
author | Mikayla Hutchinson <m.j.hutchinson@gmail.com> | 2016-11-21 20:54:11 +0300 |
---|---|---|
committer | Mikayla Hutchinson <m.j.hutchinson@gmail.com> | 2016-11-21 20:54:11 +0300 |
commit | fb55a7cc85ef63c2073a11abf02fdda61e77cecd (patch) | |
tree | f56e0b1c45e2ed447cf581d6c971303dc3b2b052 /main/src/addins/MonoDevelop.DocFood | |
parent | 492b9d077b7ea69800f7f0f6966042073a899dcf (diff) | |
parent | b64d4a7b983bbb853c71d4b0dbfac168a5528f6c (diff) |
Merge remote-tracking branch 'origin/master' into vNext
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; |