nvim-treesitter / nvim-treesitter/nvim-treesitter-textobjects

Align the way rust and typescript are defining field paramaters

Open
#774 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Tree-sitter Query
Stars
2.8k
Forks
271
Avg merge
8d 8h
Merged PRs (30d)
1

Description

Is your feature request related to a problem? Please describe.
Seeing the PR https://github.com/nvim-treesitter/nvim-treesitter-textobjects/pull/751 made me think that it would be possible to resolve the problem I am struggling with for quite some time.

In rust

let value = MyStruct {
   my_param: 13
};

If I want to work with my_param I need to use @parameter text object, but in typescript with the exact same code

let value = MyStruct {
  my_param: 13
}

I have to use @variable for whatever reason

Describe the solution you'd like
Have similar code in different languages to be handled in the similar way either @parameter or @attribute in both cases

Describe alternatives you've considered
to suffer

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the referenced PR #751 and comparing how Rust and TypeScript field-like constructs are captured for text objects. Reproduce the two examples, then determine how the relevant captures should be aligned so both use the same @parameter or @attribute category, and verify the resulting selections.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, rust, typescript
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.