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

ark: Implement folding rules #18

Open
kevinushey opened this issue Sep 29, 2022 · 8 comments
Open

ark: Implement folding rules #18

kevinushey opened this issue Sep 29, 2022 · 8 comments
Labels
Milestone

Comments

@kevinushey
Copy link
Contributor

kevinushey commented Sep 29, 2022

VSCode allows an extension to declare folding rules within language-configuration.json:

https://code.visualstudio.com/api/language-extensions/language-configuration-guide#folding

However, it's fairly rigid -- each foldable region must have separate (and uniquely-matched) start and end boundaries. However, we'd likely want to support foldable sections -- for example:

# Section 1 ----

## Section 1.1 ----

## Section 1.2 ----

For that reason, we'll probably need to implement folding rules in the LSP (unless we want to patch the VSCode behavior here)

@kevinushey
Copy link
Contributor Author

This probably isn't necessary for MVP, if we want to defer this to later.

@kevinushey kevinushey added this to the Public Beta milestone Feb 15, 2023
@EmilHvitfeldt
Copy link

Since we are having quarto support, it would be nice if the folding rules also worked with fenced divs: https://quarto.org/docs/authoring/markdown-basics.html#divs-and-spans

In the following picture, it would be neat if line 19-23 could collapse, 26-30 could collapse and 17-32 could collapse

Screenshot 2023-09-27 at 10 46 24 AM

For clarity, i made the outside div with 4 colons, but that isn't strictly needed by quarto, so the columns work on a first-in-first-out kinda basis when they are created with the same number of colons

@petetronic
Copy link
Collaborator

petetronic commented Nov 22, 2023

Here is RStudio IDE's guide to Code Sections:
https://docs.posit.co/ide/user/ide/guide/code/code-sections.html#code-sections
@kevinushey was this the functionality you had in mind?

@petetronic
Copy link
Collaborator

We recently discussed modifying the newly added positron-code-cells extension to allow runtimes to better control code ranges and behaviors. However, we've not yet prioritized this work.

@petetronic
Copy link
Collaborator

Since we are having quarto support, it would be nice if the folding rules also worked with fenced divs: https://quarto.org/docs/authoring/markdown-basics.html#divs-and-spans

In the following picture, it would be neat if line 19-23 could collapse, 26-30 could collapse and 17-32 could collapse

Hi @EmilHvitfeldt, for Quarto docs, the folding rules would be controlled by the Quarto extension. Would you mind logging that request with their backlog here? https://github.com/quarto-dev/quarto/issues

jmcphers pushed a commit that referenced this issue Dec 7, 2023
* Disable Problems throughout workbench

* Justin/backup (#18)

* modifying settings

* added fix for listener

* problem markers removed for tab and workbench

* working version all accross the workspace

* update editor configration (make sure to remove if don
't need later

* setting fix and fix for scrollbar decorations

* commit with temp changes

* resolved merge conflict

* using the right values for check box, placeholder text

* big cleanup, removing config service throuhgout, outline, tabs working

* changed settings langauge

* minimap working

* cleanup again

* fixes view configuration change check

* added auto setting instead

* working for all scenarios

* code cleanup

* working in problems panel

* working in status bar and on view pane tabs

* tried adding link from problems view

* removed unused context keys

* starting cleanup

* cleanup again and adding back context keys

* cleanedup

* revert woopsie

* removbed keybinding:

* changed settings again, removed problem filter

* removed context keys

* cleanup

* added new statusbar item when setting is off

* added colored highlight for when errors are turned off

* using new codicon placeholder

* exposes renderValidationDecorations and checks edits on that instead

* code cleanup

* removed unused override

* leave override, but changed elsewhere

* fixes unit tests:

* removed unused code, triggering build unit tests for sanity

* added warning via addEntry from statusbarService

* remove extra commas

* addressing PR comments and code cleanup

* reverted imports from autosave

* fix leaking listeners

* swapped new new setting, overwrites config based on setting value

* cleanup part 3

* moved new setting to marker contribution

* more cleanup and review comments
@EmilHvitfeldt
Copy link

another use-case here is being able to fold test_that() blocks in R package tests, (missing this one right now). May be related to #1428.

@juliasilge juliasilge modified the milestones: Old Beta Milestone, Future Feb 15, 2024
@juliasilge juliasilge removed the future label Mar 4, 2024
wesm pushed a commit that referenced this issue Mar 28, 2024
…es on parent positron repository environment

Merge pull request #18 from posit-dev/local-extension

Remove vscode type dependencies on parent positron repository environment
--------------------
Commit message for posit-dev/positron-python@38407da:

Remove dependencies on parent positron repository environment

To avoid running into type definition mismatches between positron and the python extension, undoing some of the dependencies that this extension has so that it can compile independently.

Also removing some workarounds now that we can use the types defined in the python extension.

Finally, also removing unused jupyter.js


Authored-by: Jonathan McPherson <jonathan@rstudio.com>
Signed-off-by: Pete Farland <pete.farland@posit.co>
wesm pushed a commit that referenced this issue Mar 28, 2024
…es on parent positron repository environment

Merge pull request #18 from posit-dev/local-extension

Remove vscode type dependencies on parent positron repository environment
--------------------
Commit message for posit-dev/positron-python@38407da:

Remove dependencies on parent positron repository environment

To avoid running into type definition mismatches between positron and the python extension, undoing some of the dependencies that this extension has so that it can compile independently.

Also removing some workarounds now that we can use the types defined in the python extension.

Finally, also removing unused jupyter.js


Authored-by: Jonathan McPherson <jonathan@rstudio.com>
Signed-off-by: Pete Farland <pete.farland@posit.co>
@juliasilge
Copy link
Contributor

Requested by a private beta user here: https://github.com/posit-dev/positron-beta/discussions/208

@kv9898
Copy link

kv9898 commented Oct 31, 2024

@kevinushey Would you like to see if posit-dev/ark#615 and https://github.com/kv9898/ark/releases/tag/0.1.149 are what you wanted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants