Skip to content

Tested in this language - #9

Open
ayoubelmhamdi wants to merge 6 commits into
David-Kunz:mainfrom
ayoubelmhamdi:testedin
Open

Tested in this language#9
ayoubelmhamdi wants to merge 6 commits into
David-Kunz:mainfrom
ayoubelmhamdi:testedin

Conversation

@ayoubelmhamdi

Copy link
Copy Markdown

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

@David-Kunz

Copy link
Copy Markdown
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

ayoubelmhamdi commented Sep 12, 2021

Copy link
Copy Markdown
Author

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
Copy Markdown
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
Copy Markdown
Owner

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

@ayoubelmhamdi

Copy link
Copy Markdown
Author

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

@David-Kunz

Copy link
Copy Markdown
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