1. 07 Jul, 2018 1 commit
  2. 06 Sep, 2017 1 commit
  3. 31 Aug, 2017 1 commit
  4. 31 Jul, 2017 1 commit
  5. 27 Jul, 2017 1 commit
    • Francis Herne's avatar
      Rewrite declarationForName() · 1a7d3c13
      Francis Herne authored
      This causes the correct declaration to be found in some unusual cases
       that previously failed.
      
      Only names declared before a function definition, or at module scope,
       were found in its body. Names may be declared later (but before the
       function is called); these were not found.
      
      BUG: 378083
      FIXED-IN: 5.2.0
      
      Class attributes from any enclosing class definition were found in
       default arguments, not only those from a method's parent class.
      
      Class or instance attributes were, correctly, not directly visible
       inside a method body (only with `self.` or similar), but hid
       declarations of the same name in outer contexts that should be found.
      1a7d3c13
  6. 15 Apr, 2017 1 commit
  7. 07 Mar, 2017 1 commit
  8. 28 Feb, 2017 1 commit
    • Francis Herne's avatar
      [trivial] Remove some of the spammier debug outputs · 1b357cce
      Francis Herne authored
      There are a lot of debug prints in kdev-python that occur in perfectly
       normal use, and bury important messages under a lot of spam.
      
      From looking at CLI output while in use, these seem to be some of the
       most intrusive.
      1b357cce
  9. 26 Dec, 2016 2 commits
  10. 23 Dec, 2016 1 commit
    • Francis Herne's avatar
      Restore compile-time support for Python 3.5 · 1af1f30f
      Francis Herne authored
      Python 3.5 is default on Ubuntu 16.04 LTS and 16.10, Mint 18 and
       other commonly-used distros; we probably shouldn't drop it yet.
      
      AST nodes in 3.6 seem to be a superset of those in 3.5, and no other
       changes (discovered so far?) affect kdev-python. Simply skipping the
       generating code for new AST types will allow compilation against 3.5.
      
      Add a new `SINCE` directive in python36.sdef, e.g. `SINCE 3.6`, and
       make conversionGenerator.py emit #if checks for affected statements.
      
      This can't be used with `CODE`, because that wasn't needed yet. (:P)
      
      The bundled `FindPython` CMake module doesn't handle multiple Python
       versions. Instead use `FindPythonInterp` and `FindPythonLibs` from
       upstream CMake, which (without EXACT) will find newer versions than the
       one requested; the existing check ensures the version isn't too new.
      
      Put #if statements around the new tests, too.
      
      Differential Revision: https://phabricator.kde.org/D3804
      1af1f30f
  11. 30 Nov, 2016 2 commits
    • Francis Herne's avatar
      Show uses for __call__() and __{get,set}item__() · 94ab1eee
      Francis Herne authored
      Uses of __getitem__() and __setitem__() weren't shown at all.
      Uses of __call__() were incorrectly shown as uses of __init__().
      
      This removes ExpressionAst::belongsToCall, because it's always equal to
       ExpressionAst::parent or null.
      
      This adds a new parameter `isAlias` to functionForCalled(), which allows
       it to distinguish between calling a class object (constructor __init__)
       and calling an instance of that class with __call__().
      
      This parameter can (and probably should) be used in other callers to
       improve parsing or just simplify code. For now, the default value of
       `true` causes functionForCalled() to behave as before.
      
      The ranges for these uses - as with the existing __init__() ones - are
       not always correct, particularly following subscripts.
      TODO: make the ranges of AST nodes more reliable, and then look more
       carefully for opening braces.
      
      No test regressions. No new tests, because the test framework doesn't
        seem to support use ranges currently.
      Tested on some real projects, didn't crash.
      
      Differential Revision: https://phabricator.kde.org/D3512
      94ab1eee
    • Francis Herne's avatar
      Rename functionDeclarationForCalledDeclaration -> functionForCalled and tweak types. · d757d25e
      Francis Herne authored
      Take a Declaration* instead of DeclarationPointer.
      
      Returns `struct { FunctionDeclaration* declaration, bool isConstructor }`
       instead of `QPair<FunctionDeclarationPointer, bool>`.
      
      Struct for readable attribute names rather than `.first` and `.second`.
      
      Drop the magic pointer type because most callers only wrap a normal one
       for this call anyway.
      
      No test changes, no (intended) behaviour changes.
      
      Differential Revision: https://phabricator.kde.org/D3534
      d757d25e
  12. 29 Nov, 2016 1 commit
  13. 25 Nov, 2016 1 commit
    • Francis Herne's avatar
      Miscellaneous helper cleanups · fc170e1a
      Francis Herne authored
       - Simplify some code that was mainly duplicating accessAttribute().
      
       - Improve accessAttribute() with ideas from the removed copies.
         -- Yes, I changed the method signature twice in three patches...
      
      - Replace QList with QVector in internalContextsForClass(), make type
      ptr const.
      
      - Remove unused return in getDocumentationFileContext().
      - Remove unused -typedef QPair<Declaration*, int> p; in
      declarationbuilder.cpp.
      fc170e1a
  14. 20 Nov, 2016 1 commit
  15. 13 Nov, 2016 1 commit
    • Francis Herne's avatar
      Improved unpacking and iteration. · 69177a77
      Francis Herne authored
      Make unpacking in assignments handle unsure-types (unpack all suitable
      types and combine the results).
      ```
      a = 1, 2, 3
      a = ["a", "b", "c"]
      x, y, z = a  # 'unsure (int, str)' rather than 'mixed'.
      ```
      
      Reimplement visitFor() and visitComprehension() to use the assignment
      code, which has better unpacking support and saves a lot of lines.
      
      For-loops and comprehensions now get a type when used on tuples:
       `for x in 1, 2, 3: pass # 'int'`
      ...and support nested and PEP-3132 unpacking:
      ```
      for first, *middle, (a, b) in [(1, 2, 3, (4, 5))]:
          pass # middle: 'list of int', a: 'int'
      ```
      BUG: 359915
      
      Iterating over dicts now gets the key type rather than values.
      
      Fixes one previously-XFAIL test, adds a few more. No known regressions.
      
      Differential Revision: https://phabricator.kde.org/D3352
      69177a77
  16. 23 Oct, 2016 1 commit
  17. 11 Sep, 2016 1 commit
    • Sven Brauch's avatar
      fix dependency scheduling logic · 4eb9fc0e
      Sven Brauch authored
      It is not correct to check for the priority of the parse job; that
      only exists if the job for that document was already started, which is
      usually not the case. Instead, use the API to get the priority of the
      document from the job queue.
      
      BUG:368556
      4eb9fc0e
  18. 25 Jul, 2016 2 commits
  19. 13 Jun, 2016 1 commit
  20. 09 Mar, 2016 1 commit
  21. 10 Feb, 2016 1 commit
    • Sven Brauch's avatar
      fix hinted type appearing repeatedly in unsure type list · bb98418e
      Sven Brauch authored
      The check looking whether a type is already in the list of possible
      types for an unsure does not work properly for HintedTypes, because
      they create a new IndexedType each (due to different modification
      revisions).
      When a function declaration was imported from another file, this would
      leed to arbitrarily large type lists, since on each parse pass of the
      importer an entry would be added but the list was never cleared.
      
      BUG:358563
      bb98418e
  22. 08 Feb, 2016 1 commit
  23. 06 Feb, 2016 2 commits
  24. 05 Feb, 2016 4 commits
  25. 02 Feb, 2016 1 commit
  26. 01 Feb, 2016 2 commits
  27. 30 Jan, 2016 1 commit
  28. 10 Oct, 2015 2 commits
  29. 08 Oct, 2015 3 commits