question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[api] Allow extensions to determine if a position is within a fold

See original GitHub issue

This has been the most demanded feature of VSCodeVim: VSCodeVim/Vim#1004 for over 3 years.

The main problem with Folds and Vim is that some motions will skip right over folded areas (like moving up/down). We need to know if we are in a folded area so we can iterate these motions until we are out of the fold.

An API like vscode.window.activeTextEditor.getAllFoldedRegions(): vscode.Range[] would be ideal.

An API like vscode.window.activeTextEditor.isPositionInFold(position: vscode.Position): boolean would also be great.


This is technically a duplicate for 22276, but that was closed because the roadmap at the time couldn’t include this ticket.

Maybe it’s time to revisit this? It has been blocking the most demanded feature of one of the most popular plugins out there, for 3+ years.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:145
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
lnicolacommented, Sep 27, 2019

Couldn’t extensions express interest in using this information, so that the UI process knows whether it should do that or not?

Also, Code is firing a telemetry event on every arrow press, and I imagine that’s not much better.

1reaction
aminroostacommented, Sep 27, 2019

please see @alexandrudima comment on this issue, he summarizes the core problem perfectly https://github.com/microsoft/vscode/issues/22276#issuecomment-302061827

here is the TLDR:

  • extensions run in a separate process
  • any reading API must be synchronous and must be pushed eagerly by the UI process to the extension host.
  • in other words, if we have a TextEditor.selection API, we must proactively push the selection, every time it changes, from the UI process to the extension host, even if there is an extension interested in reading the selection or not.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Allow extensions to determine if a position is within a fold.
We need to know if we are in a folded area so we can iterate these motions until we are out of the...
Read more >
VS Code API | Visual Studio Code Extension API
VS Code API is a set of JavaScript APIs that you can invoke in your Visual Studio Code extension. This page lists all...
Read more >
CameraX Extensions API - Android Developers
CameraX provides an Extensions API for accessing extensions that device manufacturers have implemented on various Android devices.
Read more >
azure-devops-extension-api package - Microsoft Learn
azure-devops-extension-api package ... Class that represents a Uri and allows parsing/getting and setting of ... Represents a gated check-in trigger.
Read more >
Dimensions in reports - Display & Video 360 Help
Dimension Category Description Advertiser General The name of an advertiser. App/URL General The name of a site, or mobile app. Audience Segment Additional dimensions The name...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found