Skip to content

More simpler regexp to match different class declarations and slight refactoring in the Python parser

Alain Laporte requested to merge alainl/kate:fix-python-class-detection into master

Tested class declarations:

class Philosopher:
class AustralianPhilosopher(Philosopher, default_name="Bruce"):
class Meta():
class MyClass(metaclass=Meta):
class MySubclass(MyClass):

Fix case where AustralianPhilosopher is not detected

Also, slight refactoring about:

  • replace QLatin1String by QStringLiteral where relevant to avoid cast
  • use static const for QRegularExpression variables and move out of the loop
  • replace variable use to define the type of the symbol by a class enum
  • create a directory where sample test files are stored (and add a sample test file for Python)

ISSUE: #75 (closed)

BUG: 454545

Edited by Alain Laporte

Merge request reports