From 681e67ecea10a569946c66c7e8ba8157afcd532d Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Thu, 17 May 2018 15:59:13 +0100 Subject: [PATCH] Be more consistent with naming --- .../aceEditor/spell-check/SpellCheckAdapter.coffee | 4 ++-- .../aceEditor/spell-check/SpellCheckManager.coffee | 14 +++++++------- .../spell-check/SpellCheckManagerTests.coffee | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor/spell-check/SpellCheckAdapter.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor/spell-check/SpellCheckAdapter.coffee index 51443d9848..9b6d809a37 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor/spell-check/SpellCheckAdapter.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor/spell-check/SpellCheckAdapter.coffee @@ -6,7 +6,7 @@ define [ class SpellCheckAdapter constructor: (@editor) -> - @wordManager = new HighlightedWordManager(@editor) + @highlightedWordManager = new HighlightedWordManager(@editor) getLines: () -> @editor.getValue().split('\n') @@ -25,7 +25,7 @@ define [ getHighlightFromCoords: (coords) -> position = @editor.renderer.screenToTextCoordinates(coords.x, coords.y) - @wordManager.findHighlightWithinRange({ + @highlightedWordManager.findHighlightWithinRange({ start: position end: position }) diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor/spell-check/SpellCheckManager.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor/spell-check/SpellCheckManager.coffee index 2828f4b426..89e3d1509d 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor/spell-check/SpellCheckManager.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor/spell-check/SpellCheckManager.coffee @@ -36,12 +36,12 @@ define [], () -> if @isSpellCheckEnabled() @markLinesAsUpdated(@adapter.normalizeChangeEvent(e)) - @adapter.wordManager.clearHighlightTouchingRange(e) + @adapter.highlightedWordManager.clearHighlightTouchingRange(e) @runSpellCheckSoon() onSessionChange: () => - @adapter.wordManager.reset() + @adapter.highlightedWordManager.reset() @inProgressRequest.abort() if @inProgressRequest? @runSpellCheckSoon(200) if @isSpellCheckEnabled() @@ -76,12 +76,12 @@ define [], () -> learnWord: (highlight) => @apiRequest "/learn", word: highlight.word - @adapter.wordManager.removeHighlight highlight + @adapter.highlightedWordManager.removeHighlight highlight language = @$scope.spellCheckLanguage @cache?.put("#{language}:#{highlight.word}", true) runFullCheck: () -> - @adapter.wordManager.reset() + @adapter.highlightedWordManager.reset() @runSpellCheck() if @isSpellCheckEnabled() markLinesAsUpdated: (change) -> @@ -146,11 +146,11 @@ define [], () -> displayResult = (highlights) => if linesToProcess? for shouldProcess, row in linesToProcess - @adapter.wordManager.clearRow(row) if shouldProcess + @adapter.highlightedWordManager.clearRow(row) if shouldProcess else - @adapter.wordManager.reset() + @adapter.highlightedWordManager.reset() for highlight in highlights - @adapter.wordManager.addHighlight highlight + @adapter.highlightedWordManager.addHighlight highlight if not words.length displayResult highlights diff --git a/services/web/test/unit_frontend/coffee/ide/editor/aceEditor/spell-check/SpellCheckManagerTests.coffee b/services/web/test/unit_frontend/coffee/ide/editor/aceEditor/spell-check/SpellCheckManagerTests.coffee index 68e47511d3..1b0dddced6 100644 --- a/services/web/test/unit_frontend/coffee/ide/editor/aceEditor/spell-check/SpellCheckManagerTests.coffee +++ b/services/web/test/unit_frontend/coffee/ide/editor/aceEditor/spell-check/SpellCheckManagerTests.coffee @@ -12,14 +12,14 @@ define [ spellCheck: true spellCheckLanguage: 'en' } - @wordManager = { + @highlightedWordManager = { reset: sinon.stub() clearRow: sinon.stub() addHighlight: sinon.stub() } @adapter = { getLines: sinon.stub() - wordManager: @wordManager + highlightedWordManager: @highlightedWordManager } inject ($q, $http, $httpBackend, $cacheFactory) => @$http = $http @@ -43,4 +43,4 @@ define [ @spellCheckManager.init() @timelord.tick(200) @$httpBackend.flush() - expect(@wordManager.addHighlight).to.have.been.called + expect(@highlightedWordManager.addHighlight).to.have.been.called