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

Create Declaration / Definition incorrectly adds the definition into a function #10500

Closed
sean-mcmanus opened this issue Feb 9, 2023 · 1 comment
Assignees
Labels
bug duplicate Feature: Create Declaration or Definition fixed Check the Milestone for the release in which the fix is or will be available. Works in VS So we'd need to fix it for VS Code to reach parity.
Milestone

Comments

@sean-mcmanus
Copy link
Contributor

test.h

void func();

test.cpp

int main()
{
    return 0;
}

Bug: It creates invalid code:

#include "test.h"
int main()
{

    void func()
    {
    }
    return 0;
}
@sean-mcmanus sean-mcmanus added bug Works in VS So we'd need to fix it for VS Code to reach parity. Feature: Create Declaration or Definition labels Feb 9, 2023
@bobbrow bobbrow added this to the On Deck milestone Feb 9, 2023
@michelleangela
Copy link
Contributor

michelleangela commented Feb 9, 2023

This is the same issue as #10464. The issue is in typescript, where there are two text edits and it calculates or adjusts the edit positions.

If there are at least 2 lines after the last function or namespace scope, then it doesn't repro.

@sean-mcmanus sean-mcmanus modified the milestones: On Deck, 1.15 Feb 13, 2023
@bobbrow bobbrow modified the milestones: 1.15, On Deck Apr 17, 2023
@browntarik browntarik added the fixed Check the Milestone for the release in which the fix is or will be available. label Jun 21, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Aug 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug duplicate Feature: Create Declaration or Definition fixed Check the Milestone for the release in which the fix is or will be available. Works in VS So we'd need to fix it for VS Code to reach parity.
Projects
None yet
Development

No branches or pull requests

4 participants