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

Tested in this language #9

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

Tested in this language #9

wants to merge 6 commits into from

Conversation

ayoubelmhamdi
Copy link

for view language that supports now treesitter-unit, I add this table for fill later.

@David-Kunz
Copy link
Owner

Hi @ayoubelmhamdi ,

Thank you very much for this PR, really appreciated!

But I'm not sure if we should put this information in the README as this list can be outdated pretty fast. Thus, I'd prefer to just provide a link to this list: https://github.com/nvim-treesitter/nvim-treesitter#supported-languages

What do you think?

Thanks and best regards,
David

@ayoubelmhamdi
Copy link
Author

ayoubelmhamdi commented Sep 12, 2021

I think, not all languages work better like demo
for example with Lua: sumneko_lua lsp:

function aaa()
[cursor 1]  -- test 1 at column 0
  -- [cursor 2] test 12 at comumn 4
  a=9
end

in cursor 1: if I use viu will select all function like vau
in cursor 2: if I use viu will select line like ^v$
also, I tested with dartls but did not work properly!

@David-Kunz
Copy link
Owner

Hi @ayoubelmhamdi ,

I've tested it with lua and it works equally good as in JavaScript.

If I define this function

function aaa()
  -- test 1 at column 0
  -- [cursor 2] test 12 at comumn 4
  a=9
end

Then viu will select the whole function if my cursor is before any sub unit (as expected).
If I place my cursor on a sub unit (e.g. the comment), then only the sub unit is selected.

But you're right about Dart, the treesitter definitions are a bit weird (the function signature is on another leaf as the function body). I'm afraid that will be impossible to fix (without having language-specific coding).

Thank you for testing, then I guess we should include that list!

Thanks and best regards,
David

@David-Kunz
Copy link
Owner

But one small question: There's still Dart inside your list, shouldn't we remove it?

@ayoubelmhamdi
Copy link
Author

in Lua:
if cursor at 0
i think, viu should be like vi{ not va{

@David-Kunz
Copy link
Owner

in Lua:
if cursor at 0
i think, viu should be like vi{ not va{

u is not really a bracket-like object. It's more like a paragraph object, so it should behave more like dip and dap, right?

Best regards,
David

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants