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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(language-service): provide diagnostics for invalid styleUrls #32674

Closed
wants to merge 2 commits into from

Conversation

@ayazhafiz
Copy link
Contributor

commented Sep 13, 2019

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

Closes #32564.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@ayazhafiz ayazhafiz requested a review from kyliau Sep 13, 2019
@ayazhafiz ayazhafiz requested a review from angular/tools-language-service as a code owner Sep 13, 2019
@ayazhafiz ayazhafiz self-assigned this Sep 13, 2019
@ngbot ngbot bot modified the milestone: needsTriage Sep 13, 2019
@googlebot googlebot added the cla: yes label Sep 13, 2019
Similar to diagnostics for invalid templateUrls, check that styleUrls
actually point to a valid Url.

Closes #32564.
@ayazhafiz ayazhafiz force-pushed the ayazhafiz:ref/completions branch from 5bc8ea5 to 6992592 Sep 17, 2019
if (!tsLsHost.fileExists) {
return [];
}

const allErrors: ng.Diagnostic[] = [];
// TODO(ayazhafiz): most of this logic can be unified with the logic in
// definitions.ts#getUrlFromProperty. Create a utility function to be used by both.
for (const urlNode of urls) {
for (let i = 0; i < urls.length; ++i) {

This comment has been minimized.

Copy link
@kyliau

kyliau Sep 17, 2019

Member

any reason for this change? Is it for performance reasons?

This comment has been minimized.

Copy link
@ayazhafiz

ayazhafiz Sep 17, 2019

Author Contributor

The type of urls has changed; ArrayLike is not an iterable, but can be indexed.

This comment has been minimized.

Copy link
@kyliau

kyliau Sep 17, 2019

Member

ah, I see. thanks!

packages/language-service/test/diagnostics_spec.ts Outdated Show resolved Hide resolved
packages/language-service/test/diagnostics_spec.ts Outdated Show resolved Hide resolved
@ayazhafiz ayazhafiz requested a review from kyliau Sep 17, 2019
@kyliau
kyliau approved these changes Sep 17, 2019
arnehoek added a commit to arnehoek/angular that referenced this pull request Sep 26, 2019
…gular#32674)

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

Closes angular#32564.

PR Close angular#32674
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.