本文整理汇总了Python中util.Util.is_java方法的典型用法代码示例。如果您正苦于以下问题:Python Util.is_java方法的具体用法?Python Util.is_java怎么用?Python Util.is_java使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类util.Util
的用法示例。
在下文中一共展示了Util.is_java方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_post_save
# 需要导入模块: from util import Util [as 别名]
# 或者: from util.Util import is_java [as 别名]
def on_post_save(self, view):
file = view.file_name()
if not (Util.is_scala(file) or Util.is_java(file)):
return
env = getEnvironment(view.window())
if env and env.is_connected() and env.client.analyzer_ready:
TypeCheckFilesReq([view.file_name()]).run_in(env, async=True)
示例2: on_query_completions
# 需要导入模块: from util import Util [as 别名]
# 或者: from util.Util import is_java [as 别名]
def on_query_completions(self, view, prefix, locations):
file = view.file_name()
if not (Util.is_scala(file) or Util.is_java(file)):
return
env = getEnvironment(view.window())
if env and env.is_connected() and env.client.indexer_ready:
if (env.editor.ignore_prefix and prefix.startswith(env.editor.ignore_prefix)):
return []
else:
env.editor.ignore_prefix = None
if (env.editor.current_prefix is not None and prefix == env.editor.current_prefix):
env.editor.current_prefix = None
if view.is_popup_visible():
view.hide_popup()
env.logger.info("Search for more suggestions either completed or was cancelled.")
return env.editor.suggestions
contents = (view.substr(sublime.Region(0, view.size())) if view.is_dirty()
else None)
response = CompletionsReq(locations[0],
view.file_name(),
contents,
max_results=5).run_in(env, async=False)
if response is None:
return ([],
sublime.INHIBIT_WORD_COMPLETIONS | sublime.INHIBIT_EXPLICIT_COMPLETIONS)
env.editor.ignore_prefix = prefix
else:
if len(env.editor.suggestions) > 1:
CompletionsReq(locations[0], view.file_name(), contents).run_in(env, async=True)
view.show_popup("Please wait while we query for more suggestions.",
sublime.HIDE_ON_MOUSE_MOVE | sublime.COOPERATE_WITH_AUTO_COMPLETE)
return (env.editor.suggestions,
sublime.INHIBIT_WORD_COMPLETIONS | sublime.INHIBIT_EXPLICIT_COMPLETIONS)