SublimeText2:崇高codeIntel不增加进口,即使它建议 [英] SublimeText2: SublimeCodeIntel doesn't adds import even when it suggests
问题描述
我想使用的SQLAlchemy
与 SublimeText2
,我做以下顺序
I am trying to use SQLAlchemy
with SublimeText2
and I do the following sequence
然后我做
接着
Then I do and then
所以我的code是
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class Transaction(Base):
__tablename__ = 'transaction'
# id = Column('id', Integer, primary_key=True)
id = Column('id', Integer, primary_key=True)
def main():
print 'Hello World!'
if __name__ == '__main__':
main()
当我尝试建立以此为Python构建我看到
When I try to build this as python build i see
line 10, in Transaction
id = Column('id', Integer, primary_key=True)
NameError: name 'Column' is not defined
[Finished in 0.2s with exit code 1]
这是因为它不进口列
,整数
文件中的
This is because it does not imports the Column
, Integer
in the file
我该如何解决这个问题?
How can I fix this?
推荐答案
我的理解是,崇高codeIntel将解析已导入模块,并根据您导入什么建议。从他们的 GitHub的页面:
My understanding is that SublimeCodeIntel will parse the modules you have imported and make suggestions based on what you've imported. From their github page:
进口自动完成 - 自动完成显示在实时可用的模块/符号
Imports autocomplete - Shows autocomplete with the available modules/symbols in real time.
我不明白它们的文档在哪里,他们说,因为我已经在崇高文本中使用它,它会自动导入模块,你也没有我曾经发现自己的功能中的任何位置。
I don't see anywhere in their documentation where they say it will automatically import modules for you nor have I ever found that functionality myself as I've used it in Sublime Text.
作为一个方面说明,使用插件的PyDev要么用的Aptana Studio或Eclipse的给你很多的功能,相对于进口和自动完成,等等。当然,现在你正在使用,而不是一个轻量级的文本编辑器,一个完全成熟的IDE,但也有一定的优点和缺点两者。
As a side note, using the PyDev plugin with either Aptana Studio or Eclipse gives you a lot of functionality with respect to imports and auto completion, among other things. Granted, you're now using a full blown IDE as opposed to a lightweight text editor, but there are certainly pros and cons to both.
这篇关于SublimeText2:崇高codeIntel不增加进口,即使它建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!