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

Extract to function doesn't work for C code that involves a typedef'd variable #11475

Closed
sean-mcmanus opened this issue Sep 27, 2023 · 0 comments
Assignees
Labels
bug Feature: Extract to function Extract to function (free function or member function) fixed Check the Milestone for the release in which the fix is or will be available. insiders Currently only repros with our latest Insiders release. Language Service quick fix Visual Studio Inherited from Visual Studio
Milestone

Comments

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Sep 27, 2023

Use Extract to function with C code

typedef unsigned int uint32_t;

uint32_t func1()
{
    uint32_t var1 = 1;
    return var1 + var1; // doesn't work
}

int func2()
{
    int var2 = 1;
    return var2 + var2; // works
}

Bug: It doesn't work. It works if the variable is not typedef or with C++ code. The bug also repros with VS. Using Ctrl+Shift+E Ctrl+E shows the incorrect errors:

image

or

image
@sean-mcmanus sean-mcmanus added bug Language Service insiders Currently only repros with our latest Insiders release. Visual Studio Inherited from Visual Studio Feature: Extract to function Extract to function (free function or member function) labels Sep 27, 2023
@sean-mcmanus sean-mcmanus added this to the 1.18 milestone Sep 27, 2023
@sean-mcmanus sean-mcmanus self-assigned this Sep 27, 2023
@sean-mcmanus sean-mcmanus modified the milestones: 1.18, 1.19 Oct 31, 2023
@sean-mcmanus sean-mcmanus added the fixed Check the Milestone for the release in which the fix is or will be available. label Nov 8, 2023
@sean-mcmanus sean-mcmanus modified the milestones: 1.19, 1.18.2 Nov 8, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Feature: Extract to function Extract to function (free function or member function) fixed Check the Milestone for the release in which the fix is or will be available. insiders Currently only repros with our latest Insiders release. Language Service quick fix Visual Studio Inherited from Visual Studio
Projects
None yet
Development

No branches or pull requests

1 participant