You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure why we are filtering out members that are declared after the current position, since they would still be valid identifier suggestions (unless I am misunderstanding the intended use of the scope member).
Unit test:
it(`section foo; a = 1; b = |2; c = 1;`,()=>{const[text,position]=textWithPosition(`section foo; a = 1; b = |2; c = 1;`);constexpected: AbridgedInspection={nodes: [],scope: [`a`,`c`],};expectParseOkAbridgedInspectionEqual(text,position,expected);});
The text was updated successfully, but these errors were encountered:
I'm wondering if I'm misunderstanding the purpose of scope.
I tried removing the position check in inspectIdentifier, but that ended up breaking a number of valid test cases. So clearly a different or smarter approach is required.
case 1:(x|, y) => z
Removing the position check added y to the current scope, which isn't what we want.
If scope is for intellisense, then x shouldn't be included. If scope is used to represent a hierarchy of symbols, then we need an easy way to determine which scope members should be excluded from intellisense results (i.e. what assignmentKeyNodeIdMap is doing now).
case 2:s|ection foo; x = 1; y = 2;
Since the cursor is on the section keyword/declaration, we shouldn't have any members in scope.
I resolved case 1 by not calling inspectIdentifier when processing the section.
For case 2, I updated the related test cases and added TODO comments.
I think this scenario is related to #56 in that there are certain cursor positions where we should be returning an empty scope, or providing additional context so the intellisense layer knows that the current list of identifiers shouldn't be included in suggestions.
I'm not sure why we are filtering out members that are declared after the current position, since they would still be valid identifier suggestions (unless I am misunderstanding the intended use of the
scope
member).Unit test:
The text was updated successfully, but these errors were encountered: