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 authored and GitHub committed 2021-07-11 16:27:35 +03:00
1 parent a90573feb2
commit e676fcabd3
35 files changed
+776

No files matched your search

@@ -0,0 +1 @@
sphinx
@@ -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