nvim-treesitter-textobjects
nvim-treesitter-textobjects copied to clipboard
feat(c_sharp) add @assignment support for all possible assignable statements
Supports for all assignment statements.
Lambda Method
public static string Method() => $"return result";
class/struct/record fields
const int CONST_FIELD = 10;
public static Node head;
public static Node tempHead = new Node();
local variables declarations
int count = 10;
int[] arr = new int[] {1, 2, 3, 4, 5, 6};
head = new Node{data = arr[0]};
count = 100;
Above local fields also support in field scope
Any update on this PR...
@prashanthsp6498 Hi, sorry for the delay. C# is not a language I personally use and I find it time-consuming to test all query PRs.
Could you kindly add some test cases?
- Make an example C# file in
tests/select/c_sharp/*(the same as the description is fine) - The assignment textobjects are not defined in the
scripts/minimal_init.lua. Add bindings forig(@assignment.inner),ag(@assignment.outer),ik(@assignment.lhs),iv(@assignment.rhs). The k and v refers to key and value. - Write
tests/select/c_sharp_spec.luasimilar to the one in python. Make sure you write clear comments to indicate what the test is doing. a. For example, I would equality-compare commands likevt=bd(delete everything before = sign, except for the spaces) withdiganddik. All three commands should produce equal results. Make the default vim command robust and easy to understand (e.g. avoidv10ldbecause it's easy to be broken when the reference file changes a bit.)
@clason I think this should be mandatory in all query PRs. It's hard to really keep track of all queries manually.