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

this does not appear in autocomplete when certain JSDoc annotations are present #48679

Open
DiamondIceNS opened this issue Apr 13, 2022 · 0 comments
Labels
Bug A bug in TypeScript Domain: Completion Lists The issue relates to showing completion lists in an editor Help Wanted You can do this
Milestone

Comments

@DiamondIceNS
Copy link

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.66.2
  • OS Version: Windows 10 Pro 21H1

Steps to Reproduce:

  1. Open a new file with the language parser type set to "JavaScript"
  2. Create an empty class like the following:
class Test {
    constructor() {
        this.callback = null;
    }
}
  1. Begin typing "this", note that the this keyword shows up in the autocomplete as expected.
    test1
  2. Add a JSDoc annotation to any element in the class containing a type definition of function with this set to some specific type:
class Test {
    constructor() {
        /** @type {function(this: HTMLElement)} */
        this.callback = null;
    }
}
  1. Begin typing "this", note that the keyword for this no longer appears, VSCode autocorrects to globalThis instead.
    test2

Notes:
This seems to occur no matter where the JSDoc comment is in the file. Here it is with it in a @param tag on a class method:
test3

I could be making incorrect JSDoc syntax, but I have my doubts, as this syntax throws no errors and gives me proper Intellisense for this when I create my callback functions when calling a method like the above with an inline function definition, which is what I wanted.

@mjbvz mjbvz transferred this issue from microsoft/vscode Apr 13, 2022
@mjbvz mjbvz removed their assignment Apr 13, 2022
@mjbvz mjbvz removed the new release label Apr 13, 2022
@RyanCavanaugh RyanCavanaugh added Bug A bug in TypeScript Help Wanted You can do this labels Apr 19, 2022
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Apr 19, 2022
@RyanCavanaugh RyanCavanaugh added the Domain: Completion Lists The issue relates to showing completion lists in an editor label Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Completion Lists The issue relates to showing completion lists in an editor Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

3 participants