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

Commit c5e4b54

Browse files
committed
JS Completions overhaul (WIP), Related issues #14 #45
1 parent fffffd3 commit c5e4b54

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

‎AngularJS-js-completions.sublime-settings

+14
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,20 @@
220220
["reject\tAngularJS", "reject(${1:reason})"],
221221
["when\tAngularJS", "when(${1:value})"]
222222
],
223+
"$rootScope": [
224+
["$apply\tAngularJS", "\\$apply(${1:exp})"],
225+
["$broadcast\tAngularJS", "\\$broadcast(${1:name}, ${2:args})"],
226+
["$destroy\tAngularJS", "\\$destroy()"],
227+
["$digest\tAngularJS", "\\$digest()"],
228+
["$emit\tAngularJS", "\\$emit(${1:name}, ${2:args})"],
229+
["$eval\tAngularJS", "\\$eval(${1:${2:expression}${3:, ${4:locals}}})"],
230+
["$evalAsync\tAngularJS", "\\$evalAsync(${1:expression})"],
231+
["$new\tAngularJS", "\\$new(${1:isolate})"],
232+
["$on\tAngularJS", "\\$on($1:name}, ${2:listener})"],
233+
["$watch\tAngularJS", "\\$watch(${1:watchExpression}${2:, ${3:listener}${4:, ${5:objectEquality}}})"],
234+
["$watchCollection\tAngularJS", "\\$watchCollection(${1:obj}, ${2:listener})"],
235+
["$id\tAngularJS", "\\$id"]
236+
],
223237
"$rootScopeProvider": [
224238
["digestTtl\tAngularJS", "digestTtl(${1:limit})"]
225239
],

‎AngularJS-sublime-package.py

+3
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,9 @@ def on_query_completions(self, view, prefix, locations):
406406
# Check if we're possibly at a directive attrs param
407407
if 'attrs' in word.lower():
408408
word = 'attrs'
409+
# Check if we're possibly at a scope var
410+
if 'scope' in word.lower():
411+
word = '$rootScope'
409412
return ng.js_completions(word)
410413
if(view.score_selector(_scope, 'source.js string.quoted')):
411414
return ng.js_event_completions(prefix)

0 commit comments

Comments
 (0)