Comment defined as:
But parser works in different way, so some functions don't work. For example, this function
|
private bool IsStringOrComment() { |
|
TreeBuilder.Node root = AST.AST.GetASTRoot(); |
|
bool notStringOrComment = true; |
|
bool notReached = true; |
|
|
|
void Traverse(TreeBuilder.Node node) { |
|
if (node.children == null) { |
|
if (notReached && node.begin < point.Position && node.end >= point.Position) { |
|
if (node.name == "Comment" || (node.name == "String" && node.end != point.Position)) { |
|
notStringOrComment = false; |
|
} |
|
|
|
notReached = false; |
|
return; |
|
} |
|
|
|
return; |
|
} |
|
|
|
foreach (var child in node.children) { |
|
Traverse(child); |
|
} |
|
} |
|
|
|
Traverse(root); |
|
|
|
return !notStringOrComment; |
|
} |
will generate wrong result if caret placed like this:
| - the caret.
Comment defined as:
But parser works in different way, so some functions don't work. For example, this function
mpl-vs/MPL/Commands/BraceCompletionCommandHandler.cs
Lines 64 to 91 in 5c5868a
will generate wrong result if caret placed like this:
# ||- the caret.