Remove debug logs

This commit is contained in:
Shane Kilkelly 2017-05-24 14:28:15 +01:00
parent 1f3a375b4e
commit b871cdab4c
2 changed files with 1 additions and 8 deletions

View file

@ -45,7 +45,6 @@ define [
labelsManager = @labelsManager labelsManager = @labelsManager
LabelsCompleter = LabelsCompleter =
getCompletions: (editor, session, pos, prefxi, callback) -> getCompletions: (editor, session, pos, prefxi, callback) ->
# console.log ">> [LabelsCompleter] getting completions"
upToCursorRange = new Range(pos.row, 0, pos.row, pos.column) upToCursorRange = new Range(pos.row, 0, pos.row, pos.column)
lineUpToCursor = editor.getSession().getTextRange(upToCursorRange) lineUpToCursor = editor.getSession().getTextRange(upToCursorRange)
commandFragment = getLastCommandFragment(lineUpToCursor) commandFragment = getLastCommandFragment(lineUpToCursor)
@ -120,7 +119,6 @@ define [
}) })
onChange: (change) -> onChange: (change) ->
window.EDITOR = @editor
cursorPosition = @editor.getCursorPosition() cursorPosition = @editor.getCursorPosition()
end = change.end end = change.end
# Check that this change was made by us, not a collaborator # Check that this change was made by us, not a collaborator
@ -134,7 +132,6 @@ define [
if commandFragment? and commandFragment.length > 2 if commandFragment? and commandFragment.length > 2
if commandFragment.startsWith('\\label{') if commandFragment.startsWith('\\label{')
# console.log ">> LABEL IS HERE"
@labelsManager.scheduleLoadLabelsFromOpenDoc() @labelsManager.scheduleLoadLabelsFromOpenDoc()
setTimeout () => setTimeout () =>
@editor.execCommand("startAutocomplete") @editor.execCommand("startAutocomplete")
@ -144,7 +141,6 @@ define [
# and see if that contains a `\label{}` # and see if that contains a `\label{}`
if change.action == 'remove' if change.action == 'remove'
if _.any(change.lines, (line) -> line.match(/\\label{.*}/)) if _.any(change.lines, (line) -> line.match(/\\label{.*}/))
# console.log ">> a label has been removed"
@labelsManager.scheduleLoadLabelsFromOpenDoc() @labelsManager.scheduleLoadLabelsFromOpenDoc()
monkeyPatchAutocomplete: () -> monkeyPatchAutocomplete: () ->

View file

@ -25,7 +25,6 @@ define [
loadLabelsFromOpenDoc: () -> loadLabelsFromOpenDoc: () ->
docId = @ide.editorManager.getCurrentDocId() docId = @ide.editorManager.getCurrentDocId()
# console.log ">> [LabelsMangager] loading labels", docId
docText = @ide.editorManager.getCurrentDocValue() docText = @ide.editorManager.getCurrentDocValue()
labels = [] labels = []
re = /\\label{(.*)}/g re = /\\label{(.*)}/g
@ -33,16 +32,14 @@ define [
if labelMatch[1] if labelMatch[1]
labels.push(labelMatch[1]) labels.push(labelMatch[1])
@state.documents[docId] = labels @state.documents[docId] = labels
# console.log ">> [LabelsMangager] success, loaded labels", docId, labels
scheduleLoadLabelsFromOpenDoc: () -> scheduleLoadLabelsFromOpenDoc: () ->
if @loadLabelsTimeout if @loadLabelsTimeout
clearTimeout(@loadLabelsTimeout) clearTimeout(@loadLabelsTimeout)
@loadLabelsTimeout = setTimeout( @loadLabelsTimeout = setTimeout(
(self) -> (self) ->
# console.log ">> trigger timeout"
self.loadLabelsFromOpenDoc() self.loadLabelsFromOpenDoc()
, 500 , 1000
, this , this
) )