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

Language Service: Provide error on invalid templateUrls #32564

Closed
ayazhafiz opened this issue Sep 9, 2019 · 1 comment

Comments

@ayazhafiz
Copy link
Contributor

commented Sep 9, 2019

馃殌 feature request

Relevant Package

This feature request is for @angular/tools-language-service

Description

The language service should provide an error whenever a user types an invalid templateUrl or styleUrl. In VSCode for instance, this will be displayed as a red squiggly.

@Component({
  templateUrl: 'badTemplate.ht',
                ~~~~~~~~~~~~~~
})

Describe the solution you'd like

Update language-service/diagnostics.

Describe alternatives you've considered

Have you considered any alternative solutions or workarounds?
@ngbot ngbot bot modified the milestone: Backlog Sep 9, 2019
ayazhafiz added a commit to ayazhafiz/angular that referenced this issue Sep 10, 2019
`templateUrls` that do not point to actual files are now diagnosed as such
by the Language Service. Support for `styleUrls` will come in a next PR.

This introduces a utility method `getPropertyValueOfType` that scans
TypeScript ASTs until a property assignment whose initializer of a
certain type is found. This PR also notices a couple of things that
could be improved in the language-service implementation, such as
enumerating directive properties and unifying common logic, that will be
fixed in future PRs.

Part of angular#32564.
ayazhafiz added a commit to ayazhafiz/angular that referenced this issue Sep 10, 2019
`templateUrls` that do not point to actual files are now diagnosed as such
by the Language Service. Support for `styleUrls` will come in a next PR.

This introduces a utility method `getPropertyValueOfType` that scans
TypeScript ASTs until a property assignment whose initializer of a
certain type is found. This PR also notices a couple of things that
could be improved in the language-service implementation, such as
enumerating directive properties and unifying common logic, that will be
fixed in future PRs.

Part of angular#32564.
ayazhafiz added a commit to ayazhafiz/angular that referenced this issue Sep 12, 2019
`templateUrls` that do not point to actual files are now diagnosed as such
by the Language Service. Support for `styleUrls` will come in a next PR.

This introduces a utility method `getPropertyValueOfType` that scans
TypeScript ASTs until a property assignment whose initializer of a
certain type is found. This PR also notices a couple of things that
could be improved in the language-service implementation, such as
enumerating directive properties and unifying common logic, that will be
fixed in future PRs.

Part of angular#32564.
kara added a commit that referenced this issue Sep 12, 2019
鈥32586)

`templateUrls` that do not point to actual files are now diagnosed as such
by the Language Service. Support for `styleUrls` will come in a next PR.

This introduces a utility method `getPropertyValueOfType` that scans
TypeScript ASTs until a property assignment whose initializer of a
certain type is found. This PR also notices a couple of things that
could be improved in the language-service implementation, such as
enumerating directive properties and unifying common logic, that will be
fixed in future PRs.

Part of #32564.

PR Close #32586
ayazhafiz added a commit to ayazhafiz/angular that referenced this issue Sep 13, 2019
Similar to diagnostics for invalid templateUrls, check that styleUrls
actually point to a valid Url.

Closes angular#32564.
ayazhafiz added a commit to ayazhafiz/angular that referenced this issue Sep 17, 2019
Similar to diagnostics for invalid templateUrls, check that styleUrls
actually point to a valid Url.

Closes angular#32564.
arnehoek added a commit to arnehoek/angular that referenced this issue Sep 26, 2019
鈥gular#32586)

`templateUrls` that do not point to actual files are now diagnosed as such
by the Language Service. Support for `styleUrls` will come in a next PR.

This introduces a utility method `getPropertyValueOfType` that scans
TypeScript ASTs until a property assignment whose initializer of a
certain type is found. This PR also notices a couple of things that
could be improved in the language-service implementation, such as
enumerating directive properties and unifying common logic, that will be
fixed in future PRs.

Part of angular#32564.

PR Close angular#32586
arnehoek added a commit to arnehoek/angular that referenced this issue Sep 26, 2019
鈥ular#32674)

Similar to diagnostics for invalid templateUrls, check that styleUrls
actually point to a valid Url.

Closes angular#32564.

PR Close angular#32674
@angular-automatic-lock-bot

This comment has been minimized.

Copy link

commented Oct 18, 2019

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 Oct 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
1 participant
You can鈥檛 perform that action at this time.