Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create missing component members from within template #1610

Closed
1 of 2 tasks
moniuch opened this issue Feb 7, 2022 · 9 comments
Closed
1 of 2 tasks

Create missing component members from within template #1610

moniuch opened this issue Feb 7, 2022 · 9 comments
Assignees
Labels

Comments

@moniuch
Copy link

moniuch commented Feb 7, 2022

Is your feature request related to a problem? Please describe.

馃殌 feature request

Description

A clear and concise description of the problem or missing capability...

Feature Type

What does this bug affect

  • Angular Language Service VSCode extension
  • Angular Language Service server

Describe the solution you'd like

If you have a solution in mind, please describe it.

Please provide creating a missing component member (property or method) from within template, as a QuickFix.

When you first develop a chunk of html and refer to methods/properties that don't exist yet, it would be a great helper and time-saver to:

  • be able to create them automatically in .ts as QuickFix, without having to copy/paste the name of the member
  • have the newly created members infer the types as much as possible
  • have it as a bulk operation (ie. if 3 members missing, create them all in one go)
  • have the QuickFix menu item available regardless of the caret position:
    • Create missing method 'foo()' - when cursor over the squiggled foo
    • Create missing member(s) - available anywhere if members missing

Describe alternatives you've considered

Have you considered any alternative solutions or workarounds?

Anything else relevant?

@moniuch moniuch added the feature label Feb 7, 2022
@dylhunn
Copy link
Collaborator

dylhunn commented Jul 6, 2022

@atscott Can you assign this to me? (I don't have write access to this repo)

@ivanwonder
Copy link
Contributor

ivanwonder/angular@6bb8770

I made a prototype for this recently. Waiting for the official implementation馃榾

@dylhunn
Copy link
Collaborator

dylhunn commented Jul 7, 2022

@ivanwonder Oh wow, I didn't realize anyone was already working on this! What is the state of your prototype? (And in particular, would you like to continue the work, or are you OK if I pick it up from you?)

@ivanwonder
Copy link
Contributor

If OK, I think I can finish my code this week and open a PR.

@dylhunn
Copy link
Collaborator

dylhunn commented Jul 8, 2022

@ivanwonder OK, thanks for working on this!

ivanwonder added a commit to ivanwonder/angular that referenced this issue Jul 9, 2022
The diagnostic of the component missing member comes from the ts service,
so the all code fixes for it are delegated to the ts service.

The code fixes are placed in the LS package because only LS can benefit from
it now, and The LS knows how to provide code fixes by the diagnostic and NgCompiler.

The class `CodeFixes` is useful to extend the code fixes if LS needs to
provide more code fixes for the template in the future. The ts service uses
the same way to provide code fixes.

https://github.com/microsoft/TypeScript/blob/162224763681465b417274383317ca9a0a573835/src/services/codeFixProvider.ts#L22

Fixes angular/vscode-ng-language-service#1610
ivanwonder added a commit to ivanwonder/angular that referenced this issue Jul 9, 2022
The diagnostic of the component missing member comes from the ts service,
so the all code fixes for it are delegated to the ts service.

The code fixes are placed in the LS package because only LS can benefit from
it now, and The LS knows how to provide code fixes by the diagnostic and NgCompiler.

The class `CodeFixes` is useful to extend the code fixes if LS needs to
provide more code fixes for the template in the future. The ts service uses
the same way to provide code fixes.

https://github.com/microsoft/TypeScript/blob/162224763681465b417274383317ca9a0a573835/src/services/codeFixProvider.ts#L22

Fixes angular/vscode-ng-language-service#1610
ivanwonder added a commit to ivanwonder/angular that referenced this issue Jul 9, 2022
The diagnostic of the component missing member comes from the ts service,
so the all code fixes for it are delegated to the ts service.

The code fixes are placed in the LS package because only LS can benefit from
it now, and The LS knows how to provide code fixes by the diagnostic and NgCompiler.

The class `CodeFixes` is useful to extend the code fixes if LS needs to
provide more code fixes for the template in the future. The ts service uses
the same way to provide code fixes.

https://github.com/microsoft/TypeScript/blob/162224763681465b417274383317ca9a0a573835/src/services/codeFixProvider.ts#L22

Fixes angular/vscode-ng-language-service#1610
@ivanwonder
Copy link
Contributor

@dylhunn The PR is alreay.

You can try it in vscode with this PR.

ivanwonder added a commit to ivanwonder/angular that referenced this issue Jul 15, 2022
The diagnostic of the component missing member comes from the ts service,
so the all code fixes for it are delegated to the ts service.

The code fixes are placed in the LS package because only LS can benefit from
it now, and The LS knows how to provide code fixes by the diagnostic and NgCompiler.

The class `CodeFixes` is useful to extend the code fixes if LS needs to
provide more code fixes for the template in the future. The ts service uses
the same way to provide code fixes.

https://github.com/microsoft/TypeScript/blob/162224763681465b417274383317ca9a0a573835/src/services/codeFixProvider.ts#L22

Fixes angular/vscode-ng-language-service#1610
ivanwonder added a commit to ivanwonder/angular that referenced this issue Jul 15, 2022
The diagnostic of the component missing member comes from the ts service,
so the all code fixes for it are delegated to the ts service.

The code fixes are placed in the LS package because only LS can benefit from
it now, and The LS knows how to provide code fixes by the diagnostic and NgCompiler.

The class `CodeFixes` is useful to extend the code fixes if LS needs to
provide more code fixes for the template in the future. The ts service uses
the same way to provide code fixes.

https://github.com/microsoft/TypeScript/blob/162224763681465b417274383317ca9a0a573835/src/services/codeFixProvider.ts#L22

Fixes angular/vscode-ng-language-service#1610
ivanwonder added a commit to ivanwonder/angular that referenced this issue Jul 15, 2022
The diagnostic of the component missing member comes from the ts service,
so the all code fixes for it are delegated to the ts service.

The code fixes are placed in the LS package because only LS can benefit from
it now, and The LS knows how to provide code fixes by the diagnostic and NgCompiler.

The class `CodeFixes` is useful to extend the code fixes if LS needs to
provide more code fixes for the template in the future. The ts service uses
the same way to provide code fixes.

https://github.com/microsoft/TypeScript/blob/162224763681465b417274383317ca9a0a573835/src/services/codeFixProvider.ts#L22

Fixes angular/vscode-ng-language-service#1610
ivanwonder added a commit to ivanwonder/angular that referenced this issue Jul 16, 2022
The diagnostic of the component missing member comes from the ts service,
so the all code fixes for it are delegated to the ts service.

The code fixes are placed in the LS package because only LS can benefit from
it now, and The LS knows how to provide code fixes by the diagnostic and NgCompiler.

The class `CodeFixes` is useful to extend the code fixes if LS needs to
provide more code fixes for the template in the future. The ts service uses
the same way to provide code fixes.

https://github.com/microsoft/TypeScript/blob/162224763681465b417274383317ca9a0a573835/src/services/codeFixProvider.ts#L22

Fixes angular/vscode-ng-language-service#1610
ivanwonder added a commit to ivanwonder/angular that referenced this issue Jul 16, 2022
The diagnostic of the component missing member comes from the ts service,
so the all code fixes for it are delegated to the ts service.

The code fixes are placed in the LS package because only LS can benefit from
it now, and The LS knows how to provide code fixes by the diagnostic and NgCompiler.

The class `CodeFixes` is useful to extend the code fixes if LS needs to
provide more code fixes for the template in the future. The ts service uses
the same way to provide code fixes.

https://github.com/microsoft/TypeScript/blob/162224763681465b417274383317ca9a0a573835/src/services/codeFixProvider.ts#L22

Fixes angular/vscode-ng-language-service#1610
ivanwonder added a commit to ivanwonder/angular that referenced this issue Jul 16, 2022
The diagnostic of the component missing member comes from the ts service,
so the all code fixes for it are delegated to the ts service.

The code fixes are placed in the LS package because only LS can benefit from
it now, and The LS knows how to provide code fixes by the diagnostic and NgCompiler.

The class `CodeFixes` is useful to extend the code fixes if LS needs to
provide more code fixes for the template in the future. The ts service uses
the same way to provide code fixes.

https://github.com/microsoft/TypeScript/blob/162224763681465b417274383317ca9a0a573835/src/services/codeFixProvider.ts#L22

Fixes angular/vscode-ng-language-service#1610
@atscott atscott reopened this Aug 2, 2022
@atscott
Copy link
Collaborator

atscott commented Aug 2, 2022

Re-opening since this still needs to be supported on the extension side: #1723

@atscott
Copy link
Collaborator

atscott commented Aug 4, 2022

fixed by #1723

@atscott atscott closed this as completed Aug 4, 2022
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants