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

Code folding incorrectly matches to an inactive } #5429

Closed
sean-mcmanus opened this issue May 7, 2020 · 5 comments
Closed

Code folding incorrectly matches to an inactive } #5429

sean-mcmanus opened this issue May 7, 2020 · 5 comments
Assignees
Labels
bug Feature: Code Folding fixed Check the Milestone for the release in which the fix is or will be available. Language Service Works in VS So we'd need to fix it for VS Code to reach parity.
Milestone

Comments

@sean-mcmanus
Copy link
Contributor

Originally reported at #407.

Use code

int main()
{
    if (false)
    {
    #if false
    }
    #else
    }
    #endif
    return 0;
}

Bug: Code folding incorrectly matches to the inactive } instead of the active one that comes afterwards. The bug doesn't repro with VS.

@Colengms
Copy link
Contributor

Colengms commented May 7, 2020

Code folding is lexer based. It doesn't know the values of preprocessor conditions. It looks like VS is initially folding this incorrectly as well, but doing another folding pass after inactive regions are available. We might be able to do something similar, but need a way to trigger VS Code to request ranges from us again (without having to edit the document). I've sent them a question on this, and am waiting for a reply.

@Colengms
Copy link
Contributor

This is blocked on: microsoft/vscode#99914

@bobbrow bobbrow modified the milestones: 0.29.0, Tracking Jun 15, 2020
@bobbrow bobbrow added the Visual Studio Code Caused by (or depends on changes from) VS Code label Jun 15, 2020
@Colengms
Copy link
Contributor

Taking this out of tracking, as the blocking VS Code issue has been fixed.

@Colengms Colengms removed this from the Tracking milestone Oct 22, 2020
@Colengms Colengms removed the Visual Studio Code Caused by (or depends on changes from) VS Code label Oct 22, 2020
@bobbrow bobbrow added this to the 1.2.0 milestone Oct 22, 2020
@Colengms
Copy link
Contributor

Although the blocking issue has been addressed by VS Code, it's still in insiders and not yet available in a general release. This will need to be delayed until the next VS Code release. This will also involve a dependency on that new VS Code version.

@Colengms
Copy link
Contributor

Colengms commented Nov 10, 2020

The type we need is not yet present in @types/vscode 1.51.0. It's expected to be in 1.52.0.

@Colengms Colengms added the fixed Check the Milestone for the release in which the fix is or will be available. label Dec 15, 2020
@bobbrow bobbrow removed the fixed Check the Milestone for the release in which the fix is or will be available. label Jan 26, 2021
@bobbrow bobbrow added the fixed Check the Milestone for the release in which the fix is or will be available. label Jan 26, 2021
@Colengms Colengms closed this as completed Feb 3, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Mar 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Feature: Code Folding fixed Check the Milestone for the release in which the fix is or will be available. Language Service 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

3 participants