diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee index d2341f04f8..27f5b15a3a 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee @@ -3,7 +3,7 @@ define [ "ide/editor/directives/aceEditor/auto-complete/Snippets" "ace/ace" "ace/ext-language_tools" -], (SuggestionManager, Snippets) -> +], (SuggestionManager, SnippetManager) -> Range = ace.require("ace/range").Range getLastCommandFragment = (lineUpToCursor) -> @@ -38,9 +38,7 @@ define [ enableLiveAutocompletion: false }) - SnippetCompleter = - getCompletions: (editor, session, pos, prefix, callback) -> - callback null, Snippets + SnippetCompleter = new SnippetManager() references = @$scope.$root._references ReferencesCompleter = diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/Snippets.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/Snippets.coffee index 4bc3d16ef4..a637005711 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/Snippets.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/Snippets.coffee @@ -1,6 +1,6 @@ define () -> environments = [ - "abstract", + "abstract", "align", "align*", "equation", "equation*", "gather", "gather*", @@ -96,5 +96,9 @@ define () -> """ meta: "env" }] + class SnippetManager + getCompletions: (editor, session, pos, prefix, callback) -> + console.log ">> get snippet completions" + callback null, snippets - return snippets \ No newline at end of file + return SnippetManager diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/SuggestionManager.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/SuggestionManager.coffee index 559a2c5981..e0c3710358 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/SuggestionManager.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/SuggestionManager.coffee @@ -28,7 +28,7 @@ define [], () -> # Ignore single letter commands since auto complete is moot then. commandRegex: /\\([a-zA-Z][a-zA-Z]+)/ - + nextCommand: () -> i = @doc.search(@commandRegex) if i == -1 @@ -123,4 +123,3 @@ define [], () -> completionBeforeCursor: completionBeforeCursor completionAfterCursor: completionAfterCursor } -