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

Scope visualizer #1523

Closed
wants to merge 62 commits into from
Closed

Scope visualizer #1523

wants to merge 62 commits into from

Conversation

pokey
Copy link
Member

@pokey pokey commented Jun 12, 2023

Partially addresses #259

Checklist

  • Make docs page for migrating scopes to new query setup. Be sure to link to contributor intro doc at the top as well. Link to this page from error message
  • I have updated the docs and cheatsheet
  • I have not broken the cheatsheet
  • Flatten settings? Might make it easier to tweak one specific color
  • Add note to removal highlight ranges in target type and removal ranges mentioning example of document with only \n. In that case first and second line have identical removal range but want different removal highlight range
  • What to do when word wrapping is enabled? It ends up looking like the scope ends when the line wraps. Not sure there's much we can do about that unfortunately
  • Use these for normal highlights?
  • Use these for normal flashes?
  • Use property / random testing where we just walk through line char by char to ensure it is right: intersects with exactly one highlight and has the correct borders on all sides. Special case for zero-length line
  • Light theme
  • Iteration scopes
  • Try setting ranges to empty before disposing to fix strange artifacts
  • try dotted / dashed / transparent border on edges that continue
  • Figure out where hats are getting siphoned to. That's causing spurious error message for "plaintext not implemented"
  • Figure out issue where visualizations disappear when you open up settings
  • Don't show errors when you're visualizing all editors. We can add an error in the future if you run it targeted at a specific editor. Maybe experiment with a code lens
    • Maybe only show the error for the active editor at the moment you say the visualize command
  • Make sure visualisation style enum is part of api surface
  • Try blending colours to avoid artifacts. Could try removing rounding and then always do blending. If that doesn't look good could at least have optimisation when domain equals range. Would prob need special api for visualisation because otherwise domain and range are independent
  • Have tests for cursorless-engine side of visualisation
  • Don't need to have initial 0 event for next line; can just start the line in the mode knowing that next line starts at 0
  • File issue for side bar for showing scopes for a given language
  • What to do about border colors?
  • filter to only ancestors of visible ranges
  • Investigate broken flashes
  • Investigate lack of dash (see image at bottom)
  • Make sure normal highlights still work
  • Figure out why I'm only seeing domain in installed version
  • I have added tests

Questions

  • Should the visualizer run on all editors, or just one? answer: both, but let's start with all editors as that's already implemented

Screenshots

"funk"

image image

"funk name"

image

"token"

image image

"char"

image

"word"

image image

"line"

image image

"state"

image

"block"

image image

Bugs

image image

@pokey pokey force-pushed the pokey/scope-visualizer branch from 1636f2b to 3066175 Compare June 12, 2023 10:59
@pokey pokey added to discuss Plan to discuss at meet-up and removed to discuss Plan to discuss at meet-up labels Jun 13, 2023
@pokey pokey force-pushed the pokey/scope-visualizer branch 6 times, most recently from b200d8f to 1391a22 Compare June 19, 2023 14:06
pokey added a commit that referenced this pull request Jun 19, 2023
Introduces a new convention for tests that end with `.vscode.test.ts`
must run within VSCode; other tests can be run as unit tests outside of
VSCode. This makes it easier to add unit tests within packages such as
`cursorless-vscode`. Just because a package is designed to be used with
VSCode doesn't mean that all of its tests should have to be run within a
VSCode context. It might (and should!) have support code that consists
of pure functions with no dependencies.

- Required by #1523 

## Checklist

- [x] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [x] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [x] I have not broken the cheatsheet
@pokey pokey force-pushed the pokey/scope-visualizer branch 5 times, most recently from bed8c8e to cf862ea Compare June 23, 2023 16:21
user.private_cursorless_run_rpc_command_and_wait("cursorless.showScopeVisualizer", cursorless_scope_type, "iteration")
visualize every <user.cursorless_scope_type>:
user.private_cursorless_run_rpc_command_and_wait("cursorless.showScopeVisualizer", cursorless_scope_type, "every")
visualize nothing:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use "nothing" from mark csv

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opted to just make it its own entry

@pokey pokey mentioned this pull request Jun 28, 2023
1 task
@pokey pokey added this to the Short list milestone Jul 6, 2023
@pokey pokey force-pushed the pokey/scope-visualizer branch 3 times, most recently from e8564ad to fe5e0e9 Compare July 14, 2023 15:33
@pokey pokey force-pushed the pokey/scope-visualizer branch from fe5e0e9 to 325a995 Compare July 14, 2023 15:40
@pokey pokey force-pushed the pokey/scope-visualizer branch 4 times, most recently from 1bcaf1d to 5c8d1b4 Compare July 16, 2023 15:17
@pokey pokey added the to discuss Plan to discuss at meet-up label Jul 16, 2023
@pokey pokey force-pushed the pokey/scope-visualizer branch from 5c8d1b4 to b43c13d Compare July 16, 2023 15:40
@pokey pokey force-pushed the pokey/scope-visualizer branch from 33a0df6 to 3fe5390 Compare July 16, 2023 15:57
@pokey pokey closed this Jul 17, 2023
This was referenced Jul 17, 2023
@pokey pokey deleted the pokey/scope-visualizer branch July 18, 2023 13:44
@pokey pokey mentioned this pull request Jul 18, 2023
9 tasks
@pokey pokey removed the to discuss Plan to discuss at meet-up label Jul 18, 2023
github-merge-queue bot pushed a commit that referenced this pull request Jul 18, 2023
- Depends on #1651
- Depends on #1652
- Depends on #1649
- Depends on #1644
## Checklist

- [x] Add image to doc page
- [x] File issue to migrate all our vscode references to use new thin
wrapper
- [x] File issue about reworking removal highlight range to return
generalised range, and not using line range for line target content
range
- [x] Investigate cheatsheet performance issue
- [x] Migrate todos from #1523 
- [x] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [x] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [x] I have not broken the cheatsheet
- [x] Compute border colors from background color?

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
cursorless-bot pushed a commit that referenced this pull request Jul 19, 2023
- Depends on #1651
- Depends on #1652
- Depends on #1649
- Depends on #1644
## Checklist

- [x] Add image to doc page
- [x] File issue to migrate all our vscode references to use new thin
wrapper
- [x] File issue about reworking removal highlight range to return
generalised range, and not using line range for line target content
range
- [x] Investigate cheatsheet performance issue
- [x] Migrate todos from #1523 
- [x] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [x] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [x] I have not broken the cheatsheet
- [x] Compute border colors from background color?

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
thetomcraig-aya pushed a commit to thetomcraig/cursorless that referenced this pull request Mar 27, 2024
- Depends on cursorless-dev#1651
- Depends on cursorless-dev#1652
- Depends on cursorless-dev#1649
- Depends on cursorless-dev#1644
## Checklist

- [x] Add image to doc page
- [x] File issue to migrate all our vscode references to use new thin
wrapper
- [x] File issue about reworking removal highlight range to return
generalised range, and not using line range for line target content
range
- [x] Investigate cheatsheet performance issue
- [x] Migrate todos from cursorless-dev#1523 
- [x] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [x] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [x] I have not broken the cheatsheet
- [x] Compute border colors from background color?

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant