Skip to content

[folding] spec that invalid ranges are ignored #48524

Closed

Description

re #48352

  • have the provider and file from below
  • the provider is being called
  • the editor doesn't show folds
 vscode.languages.registerFoldingRangeProvider({ pattern: '**/*.foo' }, new class implements vscode.FoldingRangeProvider {
        provideFoldingRanges(document: vscode.TextDocument, context: vscode.FoldingContext, token: vscode.CancellationToken): vscode.ProviderResult<vscode.FoldingRange[]> {
            return [
                new vscode.FoldingRange(0, document.lineCount, vscode.FoldingRangeKind.Region)
            ]
        }
    });
this is test
this is test
this is test

Activity

  1. jrieken commented on Apr 24, 2018

    @jrieken
    ContributorAuthor

    It seems that document.lineCount is the culprit... The docs on the ctor aren't very clear and there is no validation/warning message printed...

  2. changed the title [-]FoldingProvider doesn't work?[/-] [+]FoldingProvider results slightly dropped[/+] on Apr 24, 2018
  3. changed the title [-]FoldingProvider results slightly dropped[/-] [+]FoldingProvider results silently dropped[/+] on Apr 24, 2018
  4. changed the title [-]FoldingProvider results silently dropped[/-] [+][folding] FoldingProvider results silently dropped[/+] on May 4, 2018
  5. changed the title [-][folding] FoldingProvider results silently dropped[/-] [+][folding] spec that invalid ranges are ignored[/+] on May 4, 2018
  6. aeschli commented on May 4, 2018

    @aeschli
    Contributor

    Yes, end line must be a line that exists in the document (< document.lineCount).
    I updated the spec.

  7. dbaeumer commented on May 31, 2018

    @dbaeumer
    Member

    Verified that doc got updated.

  8. locked and limited conversation to collaborators on Jun 18, 2018
  9. added a commit that references this issue on May 6, 2026
    48792c1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

editor-foldingverification-neededverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions