robotcodedev / robotcode

RobotFramework support for Visual Studio Code
https://robotcode.io
Apache License 2.0
186 stars 15 forks source link

[ENHANCEMENT]: Variable view with search and copy to clipboard functionality in VSCode #354

Open andrascsoltko opened 1 week ago

andrascsoltko commented 1 week ago

Hi there!

When importing a variable file/class hovering over the imported item brings up this window showing the available variables:

image

Honestly, this view is annoying if one has to copy values out of it. In my scenario the variable class is not a static one, it queries localization data from a service depending on the arguments provided to it.

Would be great to have a view such as the keyword documentation one, which opens a web view with in VSCode. I don't have any preferences as long as the view containing these variables have a search functionality like ctrl+f in most editors/browrsers. Maybe even a grid like view with copy to clipboard functionality when clicking on the variable's name.

The opening of this view could be an option for the Source Action right click context menu item. Or could exist as a exapndable option in the Explorer view next to the KEYWORDS one.

d-biehl commented 1 week ago

How about the normal code completion. When you define a variable usage, the search does not start at the beginning. You can enter some letters and every variable containing these letters/words will be displayed and can be selected, like in this video:

https://github.com/user-attachments/assets/c0c8ff6d-7ddc-4179-ad58-e815f6e46dc5

Is that not enough?

Or do you mean something like the Keywords view on the Explorer tab on the left-hand side?

image
andrascsoltko commented 1 week ago

While autocompletion works fine when you know the specific variable name, in my case I find what I need much faster by searching for the value of the variable. (By looking at the UI and seeing the value) It could be that my scenario is a bit "special", the data loaded by the variable file is UI element localized names, and the keys are usually parsed by their automation paths.

Now that I look at it again, and re thought my requirement, the view like Keywords on the explorer tab would not be sufficient as it might not be possible to execute filtering (might be wrong here though).

d-biehl commented 1 week ago

The value of a variable is really a bit special ;-), because I can't get a value for all variables, only for scalar variables and environment variables. But a tree of variables defined in a suite could be helpful.

And of course you can also filter in the keyword view by selecting the view and then pressing F3, whereupon a filter box appears.