mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 15:37:46 +03:00
Remove more empty Private: comment blocks
This commit is contained in:
parent
5b453290ad
commit
967db1f7b8
@ -9,7 +9,6 @@ fs = require 'fs'
|
||||
url = require 'url'
|
||||
_ = require 'underscore-plus'
|
||||
|
||||
# Private:
|
||||
module.exports =
|
||||
class AtomWindow
|
||||
@iconPath: path.resolve(__dirname, '..', '..', 'resources', 'atom.png')
|
||||
|
@ -1,6 +1,5 @@
|
||||
Menu = require 'menu'
|
||||
|
||||
# Private:
|
||||
module.exports =
|
||||
class ContextMenu
|
||||
constructor: (template, browserWindow) ->
|
||||
|
@ -118,7 +118,6 @@ class File
|
||||
exists: ->
|
||||
fs.existsSync(@getPath())
|
||||
|
||||
# Private:
|
||||
setDigest: (contents) ->
|
||||
@digest = crypto.createHash('sha1').update(contents ? '').digest('hex')
|
||||
|
||||
@ -126,7 +125,6 @@ class File
|
||||
getDigest: ->
|
||||
@digest ? @setDigest(@readSync())
|
||||
|
||||
# Private:
|
||||
handleNativeChangeEvent: (eventType, path) ->
|
||||
if eventType is "delete"
|
||||
@unsubscribeFromNativeChangeEvents()
|
||||
@ -139,11 +137,9 @@ class File
|
||||
@read(true).done (newContents) =>
|
||||
@emit 'contents-changed' unless oldContents == newContents
|
||||
|
||||
# Private:
|
||||
detectResurrectionAfterDelay: ->
|
||||
_.delay (=> @detectResurrection()), 50
|
||||
|
||||
# Private:
|
||||
detectResurrection: ->
|
||||
if @exists()
|
||||
@subscribeToNativeChangeEvents()
|
||||
@ -152,13 +148,11 @@ class File
|
||||
@cachedContents = null
|
||||
@emit "removed"
|
||||
|
||||
# Private:
|
||||
subscribeToNativeChangeEvents: ->
|
||||
unless @watchSubscription?
|
||||
@watchSubscription = pathWatcher.watch @path, (eventType, path) =>
|
||||
@handleNativeChangeEvent(eventType, path)
|
||||
|
||||
# Private:
|
||||
unsubscribeFromNativeChangeEvents: ->
|
||||
if @watchSubscription?
|
||||
@watchSubscription.close()
|
||||
|
@ -13,7 +13,6 @@ module.exports =
|
||||
class MenuManager
|
||||
pendingUpdateOperation: null
|
||||
|
||||
# Private:
|
||||
constructor: ({@resourcePath}) ->
|
||||
@template = []
|
||||
atom.keymap.on 'bundled-keymaps-loaded', => @loadPlatformItems()
|
||||
@ -59,7 +58,6 @@ class MenuManager
|
||||
keystrokesByCommand[binding.command].push binding.keystroke
|
||||
@sendToBrowserProcess(@template, keystrokesByCommand)
|
||||
|
||||
# Private:
|
||||
loadPlatformItems: ->
|
||||
menusDirPath = path.join(@resourcePath, 'menus')
|
||||
platformMenuPath = fs.resolve(menusDirPath, process.platform, ['cson', 'json'])
|
||||
@ -89,12 +87,10 @@ class MenuManager
|
||||
filtered[key].push(binding)
|
||||
filtered
|
||||
|
||||
# Private:
|
||||
sendToBrowserProcess: (template, keystrokesByCommand) ->
|
||||
keystrokesByCommand = @filterMultipleKeystroke(keystrokesByCommand)
|
||||
ipc.sendChannel 'update-application-menu', template, keystrokesByCommand
|
||||
|
||||
# Private:
|
||||
normalizeLabel: (label) ->
|
||||
return undefined unless label?
|
||||
|
||||
|
@ -23,7 +23,6 @@ module.exports =
|
||||
class PackageManager
|
||||
Emitter.includeInto(this)
|
||||
|
||||
# Private:
|
||||
constructor: ({configDirPath, devMode, @resourcePath}) ->
|
||||
@packageDirPaths = [path.join(configDirPath, "packages")]
|
||||
if devMode
|
||||
@ -47,11 +46,9 @@ class PackageManager
|
||||
getPackageDirPaths: ->
|
||||
_.clone(@packageDirPaths)
|
||||
|
||||
# Private:
|
||||
getPackageState: (name) ->
|
||||
@packageStates[name]
|
||||
|
||||
# Private:
|
||||
setPackageState: (name, state) ->
|
||||
@packageStates[name] = state
|
||||
|
||||
@ -79,7 +76,6 @@ class PackageManager
|
||||
registerPackageActivator: (activator, types) ->
|
||||
@packageActivators.push([activator, types])
|
||||
|
||||
# Private:
|
||||
activatePackages: (packages) ->
|
||||
@activatePackage(pack.name) for pack in packages
|
||||
@observeDisabledPackages()
|
||||
@ -118,13 +114,11 @@ class PackageManager
|
||||
isPackageActive: (name) ->
|
||||
@getActivePackage(name)?
|
||||
|
||||
# Private:
|
||||
unobserveDisabledPackages: ->
|
||||
return unless @observingDisabledPackages
|
||||
atom.config.unobserve('core.disabledPackages')
|
||||
@observingDisabledPackages = false
|
||||
|
||||
# Private:
|
||||
observeDisabledPackages: ->
|
||||
return if @observingDisabledPackages
|
||||
|
||||
@ -138,7 +132,6 @@ class PackageManager
|
||||
|
||||
@observingDisabledPackages = true
|
||||
|
||||
# Private:
|
||||
loadPackages: (options) ->
|
||||
# Ensure atom exports is already in the require cache so the load time
|
||||
# of the first package isn't skewed by being the first to require atom
|
||||
@ -150,7 +143,6 @@ class PackageManager
|
||||
@loadPackage(packagePath, options) for packagePath in packagePaths
|
||||
@emit 'loaded'
|
||||
|
||||
# Private:
|
||||
loadPackage: (nameOrPath, options) ->
|
||||
if packagePath = @resolvePackagePath(nameOrPath)
|
||||
name = path.basename(nameOrPath)
|
||||
@ -162,12 +154,10 @@ class PackageManager
|
||||
else
|
||||
throw new Error("Could not resolve '#{nameOrPath}' to a package path")
|
||||
|
||||
# Private:
|
||||
unloadPackages: ->
|
||||
@unloadPackage(name) for name in _.keys(@loadedPackages)
|
||||
null
|
||||
|
||||
# Private:
|
||||
unloadPackage: (name) ->
|
||||
if @isPackageActive(name)
|
||||
throw new Error("Tried to unload active package '#{name}'")
|
||||
@ -209,7 +199,6 @@ class PackageManager
|
||||
isPackageDisabled: (name) ->
|
||||
_.include(atom.config.get('core.disabledPackages') ? [], name)
|
||||
|
||||
# Private:
|
||||
hasAtomEngine: (packagePath) ->
|
||||
metadata = Package.loadMetadata(packagePath, true)
|
||||
metadata?.engines?.atom?
|
||||
@ -218,7 +207,6 @@ class PackageManager
|
||||
isBundledPackage: (name) ->
|
||||
@getPackageDependencies().hasOwnProperty(name)
|
||||
|
||||
# Private:
|
||||
getPackageDependencies: ->
|
||||
unless @packageDependencies?
|
||||
try
|
||||
|
@ -55,7 +55,6 @@ class Package
|
||||
isTheme: ->
|
||||
@metadata?.theme?
|
||||
|
||||
# Private:
|
||||
measure: (key, fn) ->
|
||||
startTime = Date.now()
|
||||
value = fn()
|
||||
|
@ -31,7 +31,6 @@ class PaneView extends View
|
||||
|
||||
previousActiveItem: null
|
||||
|
||||
# Private:
|
||||
initialize: (args...) ->
|
||||
if args[0] instanceof Pane
|
||||
@model = args[0]
|
||||
@ -97,7 +96,6 @@ class PaneView extends View
|
||||
# Deprecated: Use ::activatePreviousItem
|
||||
showPreviousItem: -> @activatePreviousItem()
|
||||
|
||||
# Private:
|
||||
afterAttach: (onDom) ->
|
||||
@focus() if @model.focused and onDom
|
||||
|
||||
@ -167,11 +165,9 @@ class PaneView extends View
|
||||
@unsubscribe(item) if typeof item.off is 'function'
|
||||
@trigger 'pane:before-item-destroyed', [item]
|
||||
|
||||
# Private:
|
||||
activeItemTitleChanged: =>
|
||||
@trigger 'pane:active-item-title-changed'
|
||||
|
||||
# Private:
|
||||
viewForItem: (item) ->
|
||||
return unless item?
|
||||
if item instanceof $
|
||||
@ -184,7 +180,6 @@ class PaneView extends View
|
||||
@viewsByItem.set(item, view)
|
||||
view
|
||||
|
||||
# Private:
|
||||
@::accessor 'activeView', -> @viewForItem(@activeItem)
|
||||
|
||||
splitLeft: (items...) -> @model.splitLeft({items})._view
|
||||
@ -204,7 +199,6 @@ class PaneView extends View
|
||||
beforeRemove: ->
|
||||
@model.destroy() unless @model.isDestroyed()
|
||||
|
||||
# Private:
|
||||
remove: (selector, keepData) ->
|
||||
return super if keepData
|
||||
@unsubscribe()
|
||||
|
@ -27,7 +27,6 @@ class Pane extends Model
|
||||
.map((activePane) => activePane is this)
|
||||
.distinctUntilChanged()
|
||||
|
||||
# Private:
|
||||
constructor: (params) ->
|
||||
super
|
||||
|
||||
@ -78,7 +77,6 @@ class Pane extends Model
|
||||
@container?.activePane = this
|
||||
@emit 'activated'
|
||||
|
||||
# Private:
|
||||
getPanes: -> [this]
|
||||
|
||||
# Public: Get the items in this pane.
|
||||
@ -153,7 +151,6 @@ class Pane extends Model
|
||||
@addItem(item, index + i) for item, i in items
|
||||
items
|
||||
|
||||
# Private:
|
||||
removeItem: (item, destroying) ->
|
||||
index = @items.indexOf(item)
|
||||
return if index is -1
|
||||
@ -281,7 +278,6 @@ class Pane extends Model
|
||||
else
|
||||
false
|
||||
|
||||
# Private:
|
||||
copyActiveItem: ->
|
||||
if @activeItem?
|
||||
@activeItem.copy?() ? atom.deserializers.deserialize(@activeItem.serialize())
|
||||
@ -322,7 +318,6 @@ class Pane extends Model
|
||||
splitDown: (params) ->
|
||||
@split('vertical', 'after', params)
|
||||
|
||||
# Private:
|
||||
split: (orientation, side, params) ->
|
||||
if @parent.orientation isnt orientation
|
||||
@parent.replaceChild(this, new PaneAxis({@container, orientation, children: [this]}))
|
||||
|
@ -63,19 +63,16 @@ class Project extends Model
|
||||
# Public: Remove a previously registered opener.
|
||||
unregisterOpener: (opener) -> _.remove(@openers, opener)
|
||||
|
||||
# Private:
|
||||
destroyed: ->
|
||||
editor.destroy() for editor in @getEditors()
|
||||
buffer.destroy() for buffer in @getBuffers()
|
||||
@destroyRepo()
|
||||
|
||||
# Private:
|
||||
destroyRepo: ->
|
||||
if @repo?
|
||||
@repo.destroy()
|
||||
@repo = null
|
||||
|
||||
# Private:
|
||||
destroyUnretainedBuffers: ->
|
||||
buffer.destroy() for buffer in @getBuffers() when not buffer.isRetained()
|
||||
|
||||
@ -187,7 +184,6 @@ class Project extends Model
|
||||
isPathModified: (filePath) ->
|
||||
@findBufferForPath(@resolve(filePath))?.isModified()
|
||||
|
||||
# Private:
|
||||
findBufferForPath: (filePath) ->
|
||||
_.find @buffers, (buffer) -> buffer.getPath() == filePath
|
||||
|
||||
@ -210,7 +206,6 @@ class Project extends Model
|
||||
existingBuffer = @findBufferForPath(absoluteFilePath) if absoluteFilePath
|
||||
Q(existingBuffer ? @buildBuffer(absoluteFilePath))
|
||||
|
||||
# Private:
|
||||
bufferForId: (id) ->
|
||||
_.find @buffers, (buffer) -> buffer.id is id
|
||||
|
||||
@ -234,12 +229,10 @@ class Project extends Model
|
||||
.then((buffer) -> buffer)
|
||||
.catch(=> @removeBuffer(buffer))
|
||||
|
||||
# Private:
|
||||
addBuffer: (buffer, options={}) ->
|
||||
@addBufferAtIndex(buffer, @buffers.length, options)
|
||||
buffer.once 'destroyed', => @removeBuffer(buffer)
|
||||
|
||||
# Private:
|
||||
addBufferAtIndex: (buffer, index, options={}) ->
|
||||
@buffers.splice(index, 0, buffer)
|
||||
buffer.once 'destroyed', => @removeBuffer(buffer)
|
||||
@ -253,7 +246,6 @@ class Project extends Model
|
||||
index = @buffers.indexOf(buffer)
|
||||
@removeBufferAtIndex(index) unless index is -1
|
||||
|
||||
# Private:
|
||||
removeBufferAtIndex: (index, options={}) ->
|
||||
[buffer] = @buffers.splice(index, 1)
|
||||
buffer?.destroy()
|
||||
@ -339,18 +331,15 @@ class Project extends Model
|
||||
|
||||
deferred.promise
|
||||
|
||||
# Private:
|
||||
buildEditorForBuffer: (buffer, editorOptions) ->
|
||||
editor = new Editor(_.extend({buffer}, editorOptions))
|
||||
@addEditor(editor)
|
||||
editor
|
||||
|
||||
# Private:
|
||||
eachEditor: (callback) ->
|
||||
callback(editor) for editor in @getEditors()
|
||||
@on 'editor-created', (editor) -> callback(editor)
|
||||
|
||||
# Private:
|
||||
eachBuffer: (args...) ->
|
||||
subscriber = args.shift() if args.length > 1
|
||||
callback = args.shift()
|
||||
|
@ -14,7 +14,6 @@ class Selection
|
||||
wordwise: false
|
||||
needsAutoscroll: null
|
||||
|
||||
# Private:
|
||||
constructor: ({@cursor, @marker, @editor}) ->
|
||||
@cursor.selection = this
|
||||
@marker.on 'changed', => @screenRangeChanged()
|
||||
@ -23,18 +22,15 @@ class Selection
|
||||
@editor.removeSelection(this)
|
||||
@emit 'destroyed' unless @editor.isDestroyed()
|
||||
|
||||
# Private:
|
||||
destroy: ->
|
||||
@marker.destroy()
|
||||
|
||||
# Private:
|
||||
finalize: ->
|
||||
@initialScreenRange = null unless @initialScreenRange?.isEqual(@getScreenRange())
|
||||
if @isEmpty()
|
||||
@wordwise = false
|
||||
@linewise = false
|
||||
|
||||
# Private:
|
||||
clearAutoscroll: ->
|
||||
@needsAutoscroll = null
|
||||
|
||||
@ -600,7 +596,6 @@ class Selection
|
||||
compare: (otherSelection) ->
|
||||
@getBufferRange().compare(otherSelection.getBufferRange())
|
||||
|
||||
# Private:
|
||||
screenRangeChanged: ->
|
||||
screenRange = @getScreenRange()
|
||||
@emit 'screen-range-changed', screenRange
|
||||
|
@ -40,7 +40,6 @@ class TextBuffer extends TextBufferCore
|
||||
|
||||
@load() if loadWhenAttached
|
||||
|
||||
# Private:
|
||||
serializeParams: ->
|
||||
params = super
|
||||
_.extend params,
|
||||
@ -48,7 +47,6 @@ class TextBuffer extends TextBufferCore
|
||||
modifiedWhenLastPersisted: @isModified()
|
||||
digestWhenLastPersisted: @file?.getDigest()
|
||||
|
||||
# Private:
|
||||
deserializeParams: (params) ->
|
||||
params = super(params)
|
||||
params.loadWhenAttached = true
|
||||
|
@ -66,14 +66,12 @@ class WorkspaceView extends View
|
||||
audioBeep: true
|
||||
destroyEmptyPanes: false
|
||||
|
||||
# Private:
|
||||
@content: ->
|
||||
@div class: 'workspace', tabindex: -1, =>
|
||||
@div class: 'horizontal', outlet: 'horizontal', =>
|
||||
@div class: 'vertical', outlet: 'vertical', =>
|
||||
@div class: 'panes', outlet: 'panes'
|
||||
|
||||
# Private:
|
||||
initialize: (@model) ->
|
||||
@model ?= new Workspace
|
||||
|
||||
@ -158,7 +156,6 @@ class WorkspaceView extends View
|
||||
message: "Commands installed."
|
||||
detailedMessage: "The shell commands `atom` and `apm` are installed."
|
||||
|
||||
# Private:
|
||||
handleFocus: (e) ->
|
||||
if @getActivePane()
|
||||
@getActivePane().focus()
|
||||
@ -173,7 +170,6 @@ class WorkspaceView extends View
|
||||
$(document.body).focus()
|
||||
true
|
||||
|
||||
# Private:
|
||||
afterAttach: (onDom) ->
|
||||
@focus() if onDom
|
||||
|
||||
|
@ -24,7 +24,6 @@ class Workspace extends Model
|
||||
fullScreen: false
|
||||
destroyedItemUris: -> []
|
||||
|
||||
# Private:
|
||||
constructor: ->
|
||||
super
|
||||
@subscribe @paneContainer, 'item-destroyed', @onPaneItemDestroyed
|
||||
|
Loading…
Reference in New Issue
Block a user