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

override keyword is duplicated in vscode autocomplete when accepting suggested override when the override keyword is already there #57760

Closed
DetachHead opened this issue Mar 13, 2024 · 3 comments

Comments

@DetachHead
Copy link
Contributor

DetachHead commented Mar 13, 2024

πŸ”Ž Search Terms

override vscode

πŸ•— Version & Regression Information

typescript 5.4.2
vscode 1.87.1

⏯ Playground Link

No response

πŸ’» Code

class Foo {
    foo(a: number) {}
}

class Bar extends Foo {
    override fo//caret here
}

πŸ™ Actual behavior

class Foo {
    foo(a: number) {}
}

class Bar extends Foo {
    override override foo(a: number): void {
        
    }
}

πŸ™‚ Expected behavior

class Foo {
    foo(a: number) {}
}

class Bar extends Foo {
    override foo(a: number): void {
        
    }
}

Additional information about the issue

@jakebailey
Copy link
Member

Try nightly, this was probably fixed by #57643

@DetachHead
Copy link
Contributor Author

looks like it's mostly fixed, but it seems to briefly insert the duplicated override before removing it because the duplicated keyword appears when pressing ctrl+z after accepting the suggestion:

@jakebailey
Copy link
Member

Yep:

The modifiers already present may be out of order, so we always add all the modifiers as part of the member completion entry, and send a code action to erase the present modifiers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants