robotcodedev / robotcode

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

[ENHANCEMENT] Option to Prepend Namespace to Keywords Automatically #328

Open jwyffels2 opened 1 month ago

jwyffels2 commented 1 month ago

Is your enhancement request related to a problem? Please describe. I am frustrated that when using auto-complete I cannot automatically prepend the namespaace as it often leads to bad practices on the team. It is also kind of annoying when I have to backtrack to add the namespace myself. to ensure consistency etc

Describe the solution you'd like Have a toggle/boolean in the VsCode settings that allows auto-complete to prepend the namespace Describe alternatives you've considered I tried enforcing it manually or making a linter to catch it, but it would honestly just be easier if I can force it

Additional context Add any other context or screenshots about the feature request here.

d-biehl commented 1 month ago

That sounds like a great idea, and I will include it, but you don’t have to be frustrated ;-)

It might also be a good idea to add a QuickFix that automatically handles this for the selected keywords.

And by the way, do you know the shortcut CONTROL+ALT? It shows the namespaces where they aren’t indicated. You can also enable it fully so that you won’t have to add it manually anymore.

In your settings.json, you can add the following:

    "[robotframework]": {
        "editor.inlayHints.enabled": "on",
    },
    "robotcode.inlayHints.parameterNames": true

With the last setting, robotcode.inlayHints.parameterNames, you can toggle the inlay hints for parameter names on and off.

jwyffels2 commented 1 month ago

Thank you and no I didn't know that appreciate it