mirror of
https://github.com/davidhalter/jedi.git
synced 2026-10-14 00:29:01 +08:00
Move the stdlib executions into a plugin
This commit is contained in:
1 parent
df55f62ad8
commit
061489ec9a
5 files changed
+48
-41
No files matched your search
@@ -0,0 +1,18 @@
|
||||
from jedi import debug
|
||||
from jedi.plugins.base import BasePlugin
|
||||
|
||||
|
||||
class StdlibPlugin(BasePlugin):
|
||||
def execute(self, callback):
|
||||
def wrapper(context, arguments):
|
||||
debug.dbg('execute: %s %s', context, arguments)
|
||||
from jedi.evaluate import stdlib
|
||||
try:
|
||||
# Some stdlib functions like super(), namedtuple(), etc. have been
|
||||
# hard-coded in Jedi to support them.
|
||||
return stdlib.execute(self._evaluator, context, arguments)
|
||||
except stdlib.NotInStdLib:
|
||||
pass
|
||||
return callback(context, arguments)
|
||||
|
||||
return wrapper
|
||||
Reference in new issue
Block a user