In VSCode provide quickfix relevant to the position of the cursor #7353
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.
Currently, all the quickfix calculated appears in the VS code which may not be related to the current cursor position as well.
So, if we add a condition that it should provide quick fixes for the current line only then it would provide quickfixes with better context.
Examples:
Example-1:
As seen in the below image before this fix all the hints are shown irrespective of the line context after this only relevant to the current line hints are provided
Before this fix:

After this fix:

Example-2
In this example, a false hint appears since context of the line is not provided, the hint of
test()
method is shown intest1()
method.Before this fix:

After this fix:

For more info:
oracle/javavscode#59