Skip to content
This repository was archived by the owner on May 25, 2019. It is now read-only.

Commit 5493524

Browse files
committed
adds module completions in .module('',[...])
1 parent 74e4986 commit 5493524

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

‎AngularJS-sublime-package.py

+2
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,8 @@ def on_query_completions(self, view, prefix, locations):
390390
word = '$rootScope'
391391
return ng.js_completions(word)
392392
if(view.score_selector(_scope, 'source.js string.quoted')):
393+
if viewlocation.at_line_with_module(view, locations):
394+
return jscompletions.get('module', ng.get_current_project_indexes())
393395
return ng.js_in_string_completions(prefix)
394396

395397
if(viewlocation.at_html_attribute(view, 'ng-controller', locations)):

‎viewlocation.py

+5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ def settings():
1212
return sublime.load_settings('AngularJS-sublime-package.sublime-settings')
1313

1414

15+
def at_line_with_module(view, locations):
16+
line = view.substr(view.line(locations[0]))
17+
return 'module(' in line
18+
19+
1520
def at_html_attribute(view, attribute, locations):
1621
selector = view.match_selector(locations[0], 'text.html string')
1722
if not selector:

0 commit comments

Comments
 (0)