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

fix(language-service): bug of accessing a string index signature using dot notation #34177

Closed
wants to merge 4 commits into from

Conversation

@ivanwonder
Copy link
Contributor

ivanwonder commented Dec 2, 2019

fix bug of the pr #33884 @ayazhafiz

primitiveType: {[name: string]: string} = {};

{{primitiveType.test}} this will produce errors. because the string type doesn't have Symbol.

const symbol = this.stringIndexType.getSymbol();

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

@ivanwonder ivanwonder requested a review from angular/tools-language-service as a code owner Dec 2, 2019
@googlebot googlebot added the cla: yes label Dec 2, 2019
@ivanwonder ivanwonder force-pushed the ivanwonder:primitive-type branch from beecd8f to 0c569c9 Dec 2, 2019
@ayazhafiz ayazhafiz requested a review from kyliau Dec 2, 2019
@ngbot ngbot bot added this to the needsTriage milestone Dec 2, 2019
@ivanwonder ivanwonder requested a review from ayazhafiz Dec 3, 2019
Copy link
Member

ayazhafiz left a comment

LGTM, just a couple of typos.

packages/language-service/src/typescript_symbols.ts Outdated Show resolved Hide resolved
packages/language-service/src/typescript_symbols.ts Outdated Show resolved Hide resolved
packages/language-service/src/typescript_symbols.ts Outdated Show resolved Hide resolved
@ivanwonder ivanwonder force-pushed the ivanwonder:primitive-type branch from e3ebbcb to 37fa083 Dec 3, 2019
@ivanwonder ivanwonder requested a review from ayazhafiz Dec 3, 2019
@ayazhafiz

This comment has been minimized.

Copy link
Member

ayazhafiz commented Dec 3, 2019

Thank you!

@ivanwonder ivanwonder requested review from ayazhafiz and kyliau Dec 4, 2019
…PipeSymbol.selectSignature
@ivanwonder ivanwonder force-pushed the ivanwonder:primitive-type branch from 557c2e2 to 9e020ff Dec 4, 2019
@kyliau
kyliau approved these changes Dec 5, 2019
Copy link
Member

kyliau left a comment

Thank you very much @ivanwonder
This solution is clean and elegant, much appreciated!

AndrewKushnir added a commit that referenced this pull request Dec 5, 2019
AndrewKushnir added a commit that referenced this pull request Dec 5, 2019
AndrewKushnir added a commit that referenced this pull request Dec 5, 2019
…PipeSymbol.selectSignature (#34177)

PR Close #34177
AndrewKushnir added a commit that referenced this pull request Dec 5, 2019
AndrewKushnir added a commit that referenced this pull request Dec 5, 2019
AndrewKushnir added a commit that referenced this pull request Dec 5, 2019
…PipeSymbol.selectSignature (#34177)

PR Close #34177
josephperrott added a commit to josephperrott/angular that referenced this pull request Dec 11, 2019
josephperrott added a commit to josephperrott/angular that referenced this pull request Dec 11, 2019
josephperrott added a commit to josephperrott/angular that referenced this pull request Dec 11, 2019
josephperrott added a commit to josephperrott/angular that referenced this pull request Dec 11, 2019
@ivanwonder ivanwonder deleted the ivanwonder:primitive-type branch Dec 15, 2019
kyliau added a commit to kyliau/angular that referenced this pull request Dec 20, 2019
Now that angular#34177 fixed the `TypeWrapper`
to have a proper name, we have the information needed to show the type
name in a hover tooltip.
kyliau added a commit to kyliau/angular that referenced this pull request Dec 20, 2019
Now that angular#34177 fixed the `TypeWrapper`
to have a proper name, we have the information needed to show the type
name in a hover tooltip.
kyliau added a commit to kyliau/angular that referenced this pull request Dec 20, 2019
Now that angular#34177 fixed the `TypeWrapper`
to have a proper name, we have the information needed to show the type
name in a hover tooltip.
alxhub added a commit that referenced this pull request Dec 20, 2019
Now that #34177 fixed the `TypeWrapper`
to have a proper name, we have the information needed to show the type
name in a hover tooltip.

PR Close #34515
alxhub added a commit that referenced this pull request Dec 20, 2019
Now that #34177 fixed the `TypeWrapper`
to have a proper name, we have the information needed to show the type
name in a hover tooltip.

PR Close #34515
januwA added a commit to januwA/angular that referenced this pull request Jan 2, 2020
pull (#1)
* fix(language-service): completions after "let x of |" in ngFor (angular#34473)

This commit fixes a bug in which we do testing for completions.
Subsequently, this exposes another bug in our implementation whereby
suggestions are not provided in "ngFor" where there should have been.

Currently, multiple test cases are grouped together in a single
template. This requires the template to be somewhat complete so that
test cases that depend on variables declared earlier would pass.

Consider the following example:

```
  template: `
    <div *ngFor="let ~{for-person}person of ~{for-people}people">
      <span>Name: {{~{for-interp-person}person.~{for-interp-name}name}}</span>
      <span>Age: {{person.~{for-interp-age}age}}</span>
    </div>`,
```

In order to test `~{for-interp-person}`, `people` has to be included after
`~{for-people}`. This means the test case for `~{for-people}` is not
reflective of the actual use case because the variable is already there!
In real case, the expression would be incomplete, and our implementation
failed to take that into account.

This commit breaks such test into individual tests, and fix the bugs in
the underlying implementation.

PR Close angular#34473

* feat(language-service): Append symbol type to hover tooltip (angular#34515)

Now that angular#34177 fixed the `TypeWrapper`
to have a proper name, we have the information needed to show the type
name in a hover tooltip.

PR Close angular#34515

Co-authored-by: Keen Yee Liau <kyliau@google.com>
@angular-automatic-lock-bot

This comment has been minimized.

Copy link

angular-automatic-lock-bot bot commented Jan 15, 2020

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 Jan 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.