Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Fixes queries for lsp #349
base: master
Are you sure you want to change the base?
Fixes queries for lsp #349
Changes from all commits
0e3b233
250402a
37305e8
250c228
ee52218
8cdce2d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
reqret
indicates if there is a surrounding expression that requires a return value of the current expression, what is the effect of checking this? I don't understand the comment.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.
So can I use
reqret==0
as an indicator that it is the last pass on this line?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.
this will attempt to do the query in all lines following..
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.
I meant to fix this behavior:
For example you need to know about
x
hereif you call ProcessQuery() on the first encounter of this line you will get
undefined
.I try to call it on the last by checking
reqret==0
or on one of the next lines. Looking more sane checkn->line.line == query->qloc.line+1
isn't working if the next line is an empty one. I thoughtreqret==0
should be enough, but still not sure.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.
I now finally understand what you're trying to do :)
reqret==0
will work under most circumstances but it is very shaky, there may be exceptions.Just using
>
for the line comparison seems more robust, and should be sufficient.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.
But how then will be queried the last line…) I searched for anything that would be the last line indicator, but nothing found.
As for now,
reqret==0
is checked on the queried line, so there are two possible fails:reqret==0
. A little chance query to fail (found nothing).reqret==0
at all on this line. May be a problem if line is the last one. Can we have the last line withoutreqret==0
in it? If the answer is "No", thenreqret==0
is still a solution.