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

elixir: Add textobjects queries #22055

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

Conversation

baldwindavid
Copy link
Contributor

@baldwindavid baldwindavid commented Dec 16, 2024

Release Notes:

  • N/A

Adds textobjects queries for Elixir.

These queries were originally pulled directly from the nvim-treesitter-textobjects repo with this textobjects.scm file, but have been heavily edited for Zed.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Dec 16, 2024
@baldwindavid baldwindavid changed the title elixir: textobjects queries elixir: Add textobjects queries Dec 16, 2024
@baldwindavid baldwindavid marked this pull request as ready for review December 16, 2024 02:01
@ConradIrwin
Copy link
Member

@baldwindavid thanks for this!

Unfortunately Zed and nvim work a bit differently (though I was initially trying to build a compatible implementation with either nvim or helix, neither quite worked for our context).

To update the queries, you'll need to remove use of make-range etc. (compare https://github.com/nvim-treesitter/nvim-treesitter-textobjects/blob/master/queries/zig/textobjects.scm with extensions/zig/languages/zig/textobjects.scm for example.

Zed also does not support most of the object types that nvim does; currently it's just function/class/comment, so you can remove most of them

@ConradIrwin ConradIrwin self-assigned this Dec 18, 2024
* main: (259 commits)
  assistant2: Tweak "Add Context" placeholder (zed-industries#22596)
  Update Rust crate serde_json to v1.0.134 (zed-industries#22555)
  collab_ui: Show the chat panel icon when the chat panel is active (zed-industries#22593)
  Update Rust crate quote to v1.0.38 (zed-industries#22553)
  Improve truncate efficiency and fix OBOE in truncate_and_remove_front (zed-industries#22591)
  Use the same label for both string and bag in tasks modal fuzzy match (zed-industries#22022)
  Fix a typo in default.json (zed-industries#22589)
  project_panel: Open rename file editor if pasted file was disambiguated (zed-industries#19975)
  assistant2: Suggest current thread in inline assistant (zed-industries#22586)
  Fix tooltips too eager to disappear when there's a gap between the tooltip source and the tooltip itself (zed-industries#22583)
  assistant2: Wire up the directory context picker (zed-industries#22582)
  racket: Bump Extension to v0.0.2 (zed-industries#22584)
  elixir: Bump to v0.1.3 (zed-industries#22585)
  elixir: Capture identifiers as @variable (zed-industries#22579)
  ci: Make docs-only check a no-op in the merge queue (zed-industries#22576)
  Update swatinem/rust-cache digest to f0deed1 (zed-industries#22552)
  docs: Update scrollbar > diagnostics setting section (zed-industries#22574)
  terminal: Support clicking on "file://" URLs with line numbers (zed-industries#22559)
  Add fine-grained control for scrollbar diagnostics (zed-industries#22364)
  Update Rust crate unicase to v2.8.1 (zed-industries#22558)
  ...
@baldwindavid
Copy link
Contributor Author

Thanks, @ConradIrwin . Okay, this has been mostly gutted and ready for another look.

The only surprising thing I notice is that visual select around functions (vaf) selects the entire lines rather than just the function which is problematic for inline/anonymous functions. It appears it is that way in other languages too though and at least daf/caf work as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants