Open kassi opened 1 year ago
I tested it, and it seems working fine with the latest release. Is it possible to send a screen recording of the issue?
BTW I also updated to v2.6.92 with the same effect. If I disable Ansible extension, then only the real word under the cursor, for instance shell will be highlighted (no dash, no colon). And: If I just hover over it, it kind of highlights correctly the part without colon, but as soon as I click to have the real selection, colon is appended.
I believe it it happening because of the of the .
in the module names as each part is considered a separate word. So entire selection means the entire line, which in this case includes the :
as well.
Just to verify this, Could you try highlighting and selecting other Ansible keys, like the play and task keywords, or maybe even the module options?
I tested it and it's the same behavior on single words without dots, e.g. tasks, roles, hosts, etc. A single click into the word highlights it incl. colon.
Yes, you are right. I can replicate the behavior now.
However, we do not change anything in our extension in terms of word separators, I checked in the YAML extension, and the behavior is the same.
For your use case, you need to double-click the key in order to select the key or word (without the :
). Single click includes the :
as well, just like the YAML extension does.
Summary
When I click on a yaml key, the whole word including the colon is highlighted and used as the "word".
Colon should not be part of the word. When I now perform the action to "Search in Dash for current selection" for instance, it searches for the key including colon, which won't reveal anything. One has to manually remove the colon from the search term and search again.
I also tried to overwrite wordSeparators in the settings with
but this is obviously not considered, since it still includes the dot (which is correct in this case), which I incorrectly left in the separators list above.
Extension version
v2.5.86
VS Code version
1.80.1
Ansible Version
OS / Environment
MacOS Ventura 13.5, ansible-lint 6.17.2 using ansible-core:2.15.2 ansible-compat:4.1.5 ruamel-yaml:0.17.32 ruamel-yaml-clib:0.2.7
Relevant log output
No response