Skip to content

Code folding incorrectly matches to an inactive } #5429

Closed

Description

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.

Activity

  1. Colengms commented on May 7, 2020

    @Colengms
    Contributor

    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.

  2. Colengms commented on Jun 15, 2020

    @Colengms
    Contributor

    This is blocked on: microsoft/vscode#99914

  3. Colengms commented on Oct 22, 2020

    @Colengms
    Contributor

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

  4. added this to the 1.2.0 milestone on Oct 22, 2020
  5. Colengms commented on Oct 28, 2020

    @Colengms
    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.

  6. Colengms commented on Nov 10, 2020

    @Colengms
    Contributor

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

  7. added
    fixedCheck the Milestone for the release in which the fix is or will be available.
    and removed
    fixedCheck the Milestone for the release in which the fix is or will be available.
    on Jan 26, 2021
  8. locked and limited conversation to collaborators on Mar 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Feature: Code FoldingLanguage ServiceWorks in VSSo we'd need to fix it for VS Code to reach parity.bugfixedCheck the Milestone for the release in which the fix is or will be available.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions