Create pygments stubs (#5759)

* run stubgen

* replace individual lexers with __getattr__ in lexers/__init__.pyi

* replace individual styles with __getattr__ in styles/__init__.pyi

* import-export each formatter into formatters/__init__.pyi

* clean up slightly with quick and dirty script

* manual fixing
This commit is contained in:
Akuli
2021-07-11 16:27:35 +03:00
committed by GitHub
parent a90573feb2
commit e676fcabd3
35 changed files with 776 additions and 0 deletions

View File

@@ -0,0 +1 @@
sphinx

View File

@@ -0,0 +1,12 @@
# Pygments uses mcs, pyright wants cls
pygments.lexer.LexerMeta.__new__
pygments.style.StyleMeta.__new__
# Defined in lexer classes, intended to be used as static method, but doesn't use @staticmethod
pygments.lexer.LexerMeta.analyse_text
# Inheriting from tuple seems to do something weird
pygments.token.Number
pygments.token.String
pygments.token.Token
pygments.token.Whitespace