Skip to content

Change name scope in scm language to include the @ #1923

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

Closed
pokey opened this issue Oct 2, 2023 · 2 comments · Fixed by #1927
Closed

Change name scope in scm language to include the @ #1923

pokey opened this issue Oct 2, 2023 · 2 comments · Fixed by #1927
Assignees
Labels
lang-scm Language support for tree-sitter .scm files

Comments

@pokey
Copy link
Member

pokey commented Oct 2, 2023

If I have the following code:

(aaa) |
(bbb) @ccc

(where | is my cursor), I want to be able to say "bring name cap", but that results in

(aaa) ccc
(bbb) @ccc

rather than the desired

(aaa) @ccc
(bbb) @ccc

I think we were trying to be too fancy. I'd be inclined to just include the @ in the name scope, and stop using @ as insertion delimiter

The drawback is we wouldn't get a @ when we say "pour name" or "change name"

Note that we could get something like this in the future where we'd support "bring name cap to this" if we had #1631, but that's still more verbose than "bring name cap"

If we decide to go this route, we should prob also include the . in "access" (#1519)

@pokey pokey added the to discuss Plan to discuss at meet-up label Oct 2, 2023
@pokey
Copy link
Member Author

pokey commented Oct 3, 2023

  • "bring name air"
  • "bring name air to bat"
  • "bring name air to arg bat" (eg in (#foo! @bbb))
  • "bring name air after bat"
  • "pour name air"
  • "drink name air"
  • "chuck name air"
  • "change name air"
  • "leading name air" (really more interesting with "access")
  • "copy name air" / "paste that" / "paste to name bat" / "paste after name bat"

@pokey
Copy link
Member Author

pokey commented Oct 3, 2023

Update from discussion:

  • Include @ in content range
  • Don't have @ be insertion delimiter

Note that this makes drink, pour, and change inconvenient due to missing @, but those are not that common in my current experience; let's implement this and see how painful it is

In the future, we may want to get fancy and include the @ and also use it as insertion delimiter but have it be smart so that it won't insert the @ if it's next to an @. Could do this with some kind of "soft" / "smart" query predicate operator

For "access",

  • Make it private by not having it appear in csvs, but don't throw error if we manually add it to the csv. Also call it private.access
  • Ship it as is where it includes the . in the content range

@pokey pokey removed the to discuss Plan to discuss at meet-up label Oct 3, 2023
@pokey pokey self-assigned this Oct 3, 2023
pokey added a commit that referenced this issue Oct 3, 2023
@pokey pokey added the lang-scm Language support for tree-sitter .scm files label Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang-scm Language support for tree-sitter .scm files
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant