robotcodedev / robotcode

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

[ENHANCEMENT] Warning when assigning keyword output, with keyword without RETURN statement. #238

Open gohierf opened 3 months ago

gohierf commented 3 months ago

Is your enhancement request related to a problem? Please describe. The current absence of warnings in the RobotCode extension when assigning a keyword's return value to a variable without a corresponding RETURN statement poses a risk of undetected errors. Additionally, there is no alert for assigning values of incompatible types (e.g., assigning a returned dictionary to a list variable or vice versa).

image

Describe the solution you'd like I propose the implementation of a warning mechanism in the RobotCode extension. This mechanism should alert users when they attempt to assign a keyword's return value to a variable without a corresponding RETURN statement in the keyword. Furthermore, the extension should provide warnings for attempts to assign values of incompatible types.

Describe alternatives you've considered Currently, users need to manually track and ensure the compatibility of assigned values, which is error-prone. A warning system within the extension would proactively notify users of potential issues, enhancing code reliability.

gohierf commented 3 months ago

Discussion on Slack.

Noordsestern commented 3 months ago

I see the point and agree. Would this feature be better provided by robotcode or robocop?

gohierf commented 3 months ago

Yes, if robocop can do it, then I think it would be better that robocop handles this.