-
-
Notifications
You must be signed in to change notification settings - Fork 120
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
Restrict attribute completion using targets #2629
base: master
Are you sure you want to change the base?
Restrict attribute completion using targets #2629
Conversation
Any idea how to better read target names from an attribute? At the moment it digs into |
|
||
if ($node->getEndPosition() > $truncatedLength) { | ||
$node = $this->parser->parseSourceFile($truncatedSource)->getDescendantNodeAtPosition($truncatedLength); | ||
} |
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.
@dantleech @mamazu It's hacky and probably worth a better replacement, but passes all current tests.
- on truncated source cannot determine attribute context (whether it's attached to class, method, etc.) because the relevant information is after the cursor
- without truncation: the data set
does not use variables declared after offset a
inWorseParameterCompletorTest
(and not only) does not pass. - inserting additional space after the cursor before parsing does not break any existing behavior but seems to help to get the correct node if there are no white space after the cursor (and avoid get the replacement for truncated document).
Fix #2199