MarketSquare / robotframework-requests

Robot Framework keyword library wrapper for requests
http://marketsquare.github.io/robotframework-requests/
MIT License
482 stars 279 forks source link

Make RF-requests keywords compatible with RF LS intellisense #368

Closed Serhiy1 closed 1 year ago

Serhiy1 commented 1 year ago

PR for #367

Serhiy1 commented 1 year ago

Looks like the robot LSP does not work as expected, and the desired behaviour that was in my PR observed was due to caching.

lucagiove commented 1 year ago

that part is by the way not the best, I'm not sure what update_wrapper and TYPE_CHECK does can you elaborate? it might be useful actually

Serhiy1 commented 1 year ago

update_wrapper is the underlying function that gets called by the @wraps decorator TYPE_CHECKING is a constant that is true when doing static analysis (eg when your IDE is doing intellisense) and false during runtime.

The problem is that robot LSP does not do static analysis, but runs the code so the TYPE_CHECK conditional does yield the desired result.