-
Notifications
You must be signed in to change notification settings - Fork 764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed declaration type completions when extra whitespace is present #1107
Conversation
@@ -153,70 +153,54 @@ private static List<SyntaxBase> FindNodesMatchingOffset(ProgramSyntax syntax, in | |||
|
|||
private static BicepCompletionContextKind GetDeclarationTypeFlags(IList<SyntaxBase> matchingNodes, int offset) | |||
{ | |||
if (matchingNodes.Count < 2) | |||
// local function | |||
bool CheckTypeIsExpected(SyntaxBase name, SyntaxBase type) => name.Span.Length > 0 && offset > name.Span.Position + name.Span.Length && offset <= type.Span.Position; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix was to adjust the condition in this function (the commit called "fix" covers it... mostly). All other changes in this file are just a refactor to change this logic to use the tail matcher.
Codecov Report
@@ Coverage Diff @@
## main #1107 +/- ##
==========================================
- Coverage 94.27% 94.26% -0.01%
==========================================
Files 328 328
Lines 15856 15853 -3
Branches 12 12
==========================================
- Hits 14948 14944 -4
- Misses 908 909 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This fixes #718. Also refactored some of the completion logic to use the newer style.