[Bug]: Pasted text references wrong block level to do its formatting.
What happened?
Example:
copied text: if (true) { myInt = 0; } else { myInt = 1; }
Before pasting: public class RootClass { 1111public RootClass() { 11112222{ 111122223333{ 1111222233334444{ 11112222333344445555{ 111122223333444455556666paste-here 11112222333344445555} 1111222233334444} 111122223333} 11112222} 1111} }
After pasting: public class RootClass { 1111public RootClass() { 11112222{ 111122223333{ 1111222233334444{ 11112222333344445555{ 111122223333444455556666if (true) { 111122223333myInt = 0; 11112222} else { 111122223333myInt = 1; 11112222} 11112222333344445555} 1111222233334444} 111122223333} 11112222} 1111} }
No matter how deep the level (6, 7, 8, ...), it always puts the text at the 2nd level, except for the first line because that's where we put the cursor before pasting.
What's the expected behavior?
Pasted text should be properly formatted at the correct position.
What version of AndroidIDE you're using?
v2.5.2 (debug builds)
Relevant log output
No response
Duplicate issues
- [X] This issue has not been reported yet.
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
This is probably an issue with tree-sitter based indentation. I think we should use something else (probably the previous implementation or something new that we could implement in the Java LSP).