-
Notifications
You must be signed in to change notification settings - Fork 26.5k
feat(language-service): support auto-import for attribute completions #62797
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
base: main
Are you sure you want to change the base?
feat(language-service): support auto-import for attribute completions #62797
Conversation
20ecdc5
to
286e034
Compare
); | ||
if (info === null) { | ||
return undefined; | ||
break; |
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 think it's better to use break
than return
. After the switch
statement, there is logic for the code action.
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.
For example, there is a bug in the function getTsSymbolDisplayInfo
; if the symbol is a "get" accessor declaration, the function returns null
, which causes the logic of the code action to be skipped.
@@ -831,8 +831,7 @@ describe('completions', () => { | |||
expect(ts.displayPartsToString(details.documentation!)).toEqual('This is another component.'); | |||
}); | |||
|
|||
// TODO: check why this test is now broken |
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.
Broken because the completion item for the attribute only includes the directive in the component scope.
Add logic to provide code actions for auto-importing directives that are out of scope.
286e034
to
451f83f
Compare
@atscott PTAL |
attribute-completion.mov |
Add logic to provide code actions for auto-importing directives that
are out of scope.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information