mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 14:54:47 +08:00
Move the stdlib executions into a plugin
This commit is contained in:
18
jedi/plugins/stdlib.py
Normal file
18
jedi/plugins/stdlib.py
Normal file
@@ -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