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

Notebook cell scope provider #2693

Merged
merged 7 commits into from
Jan 19, 2025
Merged

Notebook cell scope provider #2693

merged 7 commits into from
Jan 19, 2025

Conversation

AndreasArvidsson
Copy link
Member

@AndreasArvidsson AndreasArvidsson commented Nov 23, 2024

Fixes #1053

Related #1052

I'm sure how we're gonna support the python comment style cells

# %%
print("hello")

We have tests for them: https://github.com/cursorless-dev/cursorless/blob/56ad4c5cef3f8c8267a098a375cf9139cbbfb0ff/data/fixtures/recorded/selectionTypes/pourCell.yml
But they are not a cell scope you can actually target. Tree sitter just sees these as a comment and a function call. We could

  1. Remove them. I'm probably leaning towards this.
  2. Try to use regular expression to actually support them properly. That means we're back to language specific implementations in typescript.
  3. Do what we did before and just yield the current position as a notebook target. Feels very hacky and not something I would like to do.

Checklist

  • [/] I have added tests
  • [/] I have updated the docs and cheatsheet
  • [/] I have not broken the cheatsheet

@AndreasArvidsson AndreasArvidsson changed the title Implemented Notebook cell scope provider Nov 23, 2024
@pokey
Copy link
Member

pokey commented Nov 30, 2024

This one probably warrants some discussion.

@pokey pokey added the to discuss Plan to discuss at meet-up label Nov 30, 2024
@AndreasArvidsson AndreasArvidsson marked this pull request as draft January 11, 2025 09:48
@AndreasArvidsson AndreasArvidsson removed the to discuss Plan to discuss at meet-up label Jan 12, 2025
@AndreasArvidsson
Copy link
Member Author

I went with solution one and just removed those four tests

@AndreasArvidsson AndreasArvidsson marked this pull request as ready for review January 12, 2025 10:15
@phillco phillco enabled auto-merge January 19, 2025 15:29
@phillco phillco added this pull request to the merge queue Jan 19, 2025
Merged via the queue into main with commit 9b4bb24 Jan 19, 2025
15 checks passed
@phillco phillco deleted the migrateNotebookCell branch January 19, 2025 15:50
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.

Migrate notebookCell to use a scope handler
3 participants