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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to discuss Plan to discuss at meet-up
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate notebookCell to use a scope handler
2 participants