D6949: Rewrite declarationForName()

Francis Herne noreply at phabricator.kde.org
Thu Jul 27 16:57:28 UTC 2017


flherne created this revision.
Restricted Application added a subscriber: kdevelop-devel.

REVISION SUMMARY
  This causes the correct declaration to be found in some unusual cases that previously failed.
  
  - Names can be used in a function body before their definition, provided that they're defined before the function is called. These weren't found unless declared at module scope.
  
  BUG: 378083
  
  - Class attributes from any enclosing class definition were found in default arguments. Only those from a method's parent class should be found.
  
  - Class or instance attributes were, correctly, not directly visible inside a method body (only with `self.` or similar). They did however hide names from outer contexts.

TEST PLAN
  All existing tests pass.
  
  Add some new tests, of which four previously failed (declaration_order_func_defarg2, intermediate_vs_class/instance_attrs, top_level_vs_nested_*).
  
  Quite a lot of manual testing.

REPOSITORY
  R53 KDevelop: Python Support

REVISION DETAIL
  https://phabricator.kde.org/D6949

AFFECTED FILES
  duchain/helpers.cpp

To: flherne, brauch
Cc: kdevelop-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20170727/554111c9/attachment.html>


More information about the KDevelop-devel mailing list