Skip to content

Fix occurrences for classexpressions #4531

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

Conversation

DickvdBrink
Copy link
Contributor

I looked at some other tests for the getOccurrences and I think I got most of the possibilities.
Tested in highlighting of the occurrences in VS2015.

One small question, the original issue is also talking about find all references on this but that doesn't work in classes either and according to a comment in one of the tests that is currently by design.

The CURRENT behavior is that findAllRefs doesn't work on 'this' or 'super' keywords


Edit by @DanielRosenwasser: This fixes #4479.

@DanielRosenwasser
Copy link
Member

Thanks @DickvdBrink!

@DanielRosenwasser
Copy link
Member

Actually, before I pull this in:

One small question, the original issue is also talking about find all references on this but that doesn't work in classes either and according to a comment in one of the tests that is currently by design.

Which test are you talking about? I'm pretty sure I added support for getOccurrences for this everywhere (though findAllRefs doesn't seem to work on this keywords right now).

@DickvdBrink
Copy link
Contributor Author

Oops, sorry about not providing the link. I really thought I did add it to my post above but I think I didn't press save 👊
The test I was talking about:
https://github.com/Microsoft/TypeScript/blob/59782a98eb36425f4365d423ba11e3bf848066a1/tests/cases/fourslash/findAllRefsThisKeywordMultipleFiles.ts#L18

So yeah, occurrences work but find all refs doesn't, didn't think it mattered though but because issue 4479 was mentioning it I thought I should at least mention it here

@DanielRosenwasser
Copy link
Member

@DickvdBrink if you'd like to take that on I think we'd be interested in a PR. If it at least could find this in a function or class, I think that would be pretty helpful.

DanielRosenwasser added a commit that referenced this pull request Aug 28, 2015
…sions

Fix occurrences for classexpressions
@DanielRosenwasser DanielRosenwasser merged commit 9f8de0f into microsoft:master Aug 28, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Find references/get occurrences on 'this' doesn't work in class expressions
3 participants