mirror of
https://github.com/atom/atom.git
synced 2026-01-26 07:19:06 -05:00
Merge pull request #12782 from Ingramz/remove-unused-variables-obvious
Remove unused variables (obvious ones)
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
_ = require 'underscore-plus'
|
||||
path = require 'path'
|
||||
temp = require 'temp'
|
||||
Package = require '../src/package'
|
||||
ThemeManager = require '../src/theme-manager'
|
||||
AtomEnvironment = require '../src/atom-environment'
|
||||
StorageFolder = require '../src/storage-folder'
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
path = require 'path'
|
||||
fs = require 'fs-plus'
|
||||
temp = require 'temp'
|
||||
AtomPortable = require '../src/main-process/atom-portable'
|
||||
|
||||
portableModeCommonPlatformBehavior = (platform) ->
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
DecorationManager = require '../src/decoration-manager'
|
||||
_ = require 'underscore-plus'
|
||||
|
||||
describe "DecorationManager", ->
|
||||
[decorationManager, buffer, defaultMarkerLayer] = []
|
||||
|
||||
@@ -2,7 +2,6 @@ temp = require 'temp'
|
||||
GitRepository = require '../src/git-repository'
|
||||
fs = require 'fs-plus'
|
||||
path = require 'path'
|
||||
Task = require '../src/task'
|
||||
Project = require '../src/project'
|
||||
|
||||
copyRepository = ->
|
||||
@@ -195,7 +194,7 @@ describe "GitRepository", ->
|
||||
expect(repo.isStatusModified(repo.getDirectoryStatus(directoryPath))).toBe true
|
||||
|
||||
describe ".refreshStatus()", ->
|
||||
[newPath, modifiedPath, cleanPath, originalModifiedPathText, workingDirectory] = []
|
||||
[newPath, modifiedPath, cleanPath, workingDirectory] = []
|
||||
|
||||
beforeEach ->
|
||||
workingDirectory = copyRepository()
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
Grim = require 'grim'
|
||||
_ = require 'underscore-plus'
|
||||
fs = require 'fs-plus'
|
||||
path = require 'path'
|
||||
{ipcRenderer} = require 'electron'
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
LinesYardstick = require '../src/lines-yardstick'
|
||||
LineTopIndex = require 'line-top-index'
|
||||
{toArray} = require 'underscore-plus'
|
||||
{Point} = require 'text-buffer'
|
||||
|
||||
describe "LinesYardstick", ->
|
||||
@@ -15,8 +14,6 @@ describe "LinesYardstick", ->
|
||||
|
||||
runs ->
|
||||
createdLineNodes = []
|
||||
availableScreenRows = {}
|
||||
screenRowsToMeasure = []
|
||||
|
||||
buildLineNode = (screenRow) ->
|
||||
startIndex = 0
|
||||
|
||||
@@ -197,7 +197,7 @@ describe "Package", ->
|
||||
expect(spy).toHaveBeenCalled()
|
||||
|
||||
describe ".loadMetadata()", ->
|
||||
[packagePath, pack, metadata] = []
|
||||
[packagePath, metadata] = []
|
||||
|
||||
beforeEach ->
|
||||
packagePath = atom.project.getDirectories()[0]?.resolve('packages/package-with-different-directory-name')
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
{Emitter} = require 'event-kit'
|
||||
Grim = require 'grim'
|
||||
Pane = require '../src/pane'
|
||||
PaneAxis = require '../src/pane-axis'
|
||||
PaneContainer = require '../src/pane-container'
|
||||
|
||||
describe "Pane", ->
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
Panel = require '../src/panel'
|
||||
PanelElement = require '../src/panel-element'
|
||||
PanelContainer = require '../src/panel-container'
|
||||
PanelContainerElement = require '../src/panel-container-element'
|
||||
|
||||
describe "PanelContainerElement", ->
|
||||
[jasmineContent, element, container] = []
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
temp = require 'temp'
|
||||
fstream = require 'fstream'
|
||||
Project = require '../src/project'
|
||||
_ = require 'underscore-plus'
|
||||
fs = require 'fs-plus'
|
||||
path = require 'path'
|
||||
BufferedProcess = require '../src/buffered-process'
|
||||
{Directory} = require 'pathwatcher'
|
||||
GitRepository = require '../src/git-repository'
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
TextEditor = require '../src/text-editor'
|
||||
|
||||
describe "Selection", ->
|
||||
[buffer, editor, selection] = []
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ if process.env.CI
|
||||
else
|
||||
jasmine.getEnv().defaultTimeoutInterval = 5000
|
||||
|
||||
{resourcePath, testPaths} = atom.getLoadSettings()
|
||||
{testPaths} = atom.getLoadSettings()
|
||||
|
||||
if specPackagePath = FindParentDir.sync(testPaths[0], 'package.json')
|
||||
packageMetadata = require(path.join(specPackagePath, 'package.json'))
|
||||
@@ -61,8 +61,6 @@ else
|
||||
specProjectPath = path.join(__dirname, 'fixtures')
|
||||
|
||||
beforeEach ->
|
||||
documentTitle = null
|
||||
|
||||
atom.project.setPaths([specProjectPath])
|
||||
|
||||
window.resetTimeouts()
|
||||
|
||||
@@ -4,7 +4,6 @@ path = require 'path'
|
||||
temp = require 'temp'
|
||||
SquirrelUpdate = require '../src/main-process/squirrel-update'
|
||||
Spawner = require '../src/main-process/spawner'
|
||||
WinPowerShell = require '../src/main-process/win-powershell'
|
||||
WinShell = require '../src/main-process/win-shell'
|
||||
|
||||
# Run passed callback as Spawner.spawn() would do
|
||||
|
||||
@@ -8,7 +8,6 @@ describe "Task", ->
|
||||
task = Task.once require.resolve('./fixtures/task-spec-handler'), (result) ->
|
||||
handlerResult = result
|
||||
|
||||
processClosed = false
|
||||
processErrored = false
|
||||
childProcess = task.childProcess
|
||||
spyOn(childProcess, 'kill').andCallThrough()
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
TextEditorElement = require '../src/text-editor-element'
|
||||
TextEditor = require '../src/text-editor'
|
||||
{Disposable} = require 'event-kit'
|
||||
|
||||
# The rest of text-editor-component-spec will be moved to this file when React
|
||||
|
||||
@@ -2,7 +2,6 @@ _ = require 'underscore-plus'
|
||||
randomWords = require 'random-words'
|
||||
TextBuffer = require 'text-buffer'
|
||||
{Point, Range} = TextBuffer
|
||||
TextEditor = require '../src/text-editor'
|
||||
TextEditorPresenter = require '../src/text-editor-presenter'
|
||||
FakeLinesYardstick = require './fake-lines-yardstick'
|
||||
LineTopIndex = require 'line-top-index'
|
||||
@@ -1848,7 +1847,7 @@ describe "TextEditorPresenter", ->
|
||||
|
||||
describe ".highlights", ->
|
||||
expectUndefinedStateForHighlight = (presenter, decoration) ->
|
||||
for tileId, tileState of getState(presenter).content.tiles
|
||||
for tileId of getState(presenter).content.tiles
|
||||
state = stateForHighlightInTile(presenter, decoration, tileId)
|
||||
expect(state).toBeUndefined()
|
||||
|
||||
@@ -1860,7 +1859,7 @@ describe "TextEditorPresenter", ->
|
||||
stateForHighlightInTile(presenter, selection.decoration, tile)
|
||||
|
||||
expectUndefinedStateForSelection = (presenter, selectionIndex) ->
|
||||
for tileId, tileState of getState(presenter).content.tiles
|
||||
for tileId of getState(presenter).content.tiles
|
||||
state = stateForSelectionInTile(presenter, selectionIndex, tileId)
|
||||
expect(state).toBeUndefined()
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
fs = require 'fs-plus'
|
||||
path = require 'path'
|
||||
temp = require 'temp'
|
||||
clipboard = require '../src/safe-clipboard'
|
||||
TextEditor = require '../src/text-editor'
|
||||
TextBuffer = require 'text-buffer'
|
||||
@@ -4751,7 +4749,7 @@ describe "TextEditor", ->
|
||||
it "deletes the entire file from the bottom up", ->
|
||||
count = buffer.getLineCount()
|
||||
expect(count).toBeGreaterThan(0)
|
||||
for line in [0...count]
|
||||
for [0...count]
|
||||
editor.getLastCursor().moveToBottom()
|
||||
editor.deleteLine()
|
||||
expect(buffer.getLineCount()).toBe(1)
|
||||
@@ -4760,7 +4758,7 @@ describe "TextEditor", ->
|
||||
it "deletes the entire file from the top down", ->
|
||||
count = buffer.getLineCount()
|
||||
expect(count).toBeGreaterThan(0)
|
||||
for line in [0...count]
|
||||
for [0...count]
|
||||
editor.getLastCursor().moveToTop()
|
||||
editor.deleteLine()
|
||||
expect(buffer.getLineCount()).toBe(1)
|
||||
|
||||
@@ -2,12 +2,7 @@ path = require 'path'
|
||||
fs = require 'fs-plus'
|
||||
temp = require 'temp'
|
||||
|
||||
Package = require '../src/package'
|
||||
|
||||
describe "atom.themes", ->
|
||||
resourcePath = atom.getLoadSettings().resourcePath
|
||||
configDirPath = atom.getConfigDirPath()
|
||||
|
||||
beforeEach ->
|
||||
spyOn(console, 'warn')
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ class TimeReporter extends jasmine.Reporter
|
||||
time: duration
|
||||
fullName: spec.getFullName()
|
||||
|
||||
if timedSuites[@suite]
|
||||
if window.timedSuites[@suite]
|
||||
window.timedSuites[@suite] += duration
|
||||
else
|
||||
window.timedSuites[@suite] = duration
|
||||
|
||||
@@ -499,10 +499,7 @@ describe "TokenizedBuffer", ->
|
||||
expect(tokenizedBuffer.indentLevelForRow(10)).toBe 2 # }
|
||||
|
||||
describe "::isFoldableAtRow(row)", ->
|
||||
changes = null
|
||||
|
||||
beforeEach ->
|
||||
changes = []
|
||||
buffer = atom.project.bufferForPathSync('sample.js')
|
||||
buffer.insert [10, 0], " // multi-line\n // comment\n // block\n"
|
||||
buffer.insert [0, 0], "// multi-line\n// comment\n// block\n"
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
KeymapManager = require 'atom-keymap'
|
||||
path = require 'path'
|
||||
fs = require 'fs-plus'
|
||||
temp = require 'temp'
|
||||
TextEditor = require '../src/text-editor'
|
||||
WindowEventHandler = require '../src/window-event-handler'
|
||||
{ipcRenderer} = require 'electron'
|
||||
|
||||
describe "WindowEventHandler", ->
|
||||
[projectPath, windowEventHandler] = []
|
||||
[windowEventHandler] = []
|
||||
|
||||
beforeEach ->
|
||||
atom.uninstallWindowEventHandler()
|
||||
@@ -19,7 +16,6 @@ describe "WindowEventHandler", ->
|
||||
loadSettings
|
||||
atom.project.destroy()
|
||||
windowEventHandler = new WindowEventHandler({atomEnvironment: atom, applicationDelegate: atom.applicationDelegate, window, document})
|
||||
projectPath = atom.project.getPaths()[0]
|
||||
|
||||
afterEach ->
|
||||
windowEventHandler.unsubscribe()
|
||||
|
||||
@@ -2,7 +2,6 @@ path = require 'path'
|
||||
temp = require 'temp'
|
||||
Workspace = require '../src/workspace'
|
||||
Project = require '../src/project'
|
||||
Pane = require '../src/pane'
|
||||
platform = require './spec-helper-platform'
|
||||
_ = require 'underscore-plus'
|
||||
fstream = require 'fstream'
|
||||
@@ -1241,7 +1240,6 @@ describe "Workspace", ->
|
||||
expect(matches.length).toBe 1
|
||||
|
||||
it "excludes values in core.ignoredNames", ->
|
||||
projectPath = path.join(__dirname, 'fixtures', 'git', 'working-dir')
|
||||
ignoredNames = atom.config.get("core.ignoredNames")
|
||||
ignoredNames.push("a")
|
||||
atom.config.set("core.ignoredNames", ignoredNames)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
_ = require 'underscore-plus'
|
||||
{screen, ipcRenderer, remote, shell, systemPreferences, webFrame} = require 'electron'
|
||||
{screen, ipcRenderer, remote, shell, webFrame} = require 'electron'
|
||||
ipcHelpers = require './ipc-helpers'
|
||||
{Disposable} = require 'event-kit'
|
||||
{getWindowLoadSettings, setWindowLoadSettings} = require './window-load-settings-helpers'
|
||||
|
||||
@@ -9,10 +9,9 @@ fs = require 'fs-plus'
|
||||
{mapSourcePosition} = require 'source-map-support'
|
||||
Model = require './model'
|
||||
WindowEventHandler = require './window-event-handler'
|
||||
StylesElement = require './styles-element'
|
||||
StateStore = require './state-store'
|
||||
StorageFolder = require './storage-folder'
|
||||
{getWindowLoadSettings, setWindowLoadSettings} = require './window-load-settings-helpers'
|
||||
{getWindowLoadSettings} = require './window-load-settings-helpers'
|
||||
registerDefaultCommands = require './register-default-commands'
|
||||
|
||||
DeserializerManager = require './deserializer-manager'
|
||||
@@ -51,7 +50,6 @@ PanelElement = require './panel-element'
|
||||
PaneContainerElement = require './pane-container-element'
|
||||
PaneAxisElement = require './pane-axis-element'
|
||||
PaneElement = require './pane-element'
|
||||
TextEditorElement = require './text-editor-element'
|
||||
{createGutterView} = require './gutter-component-helpers'
|
||||
|
||||
# Essential: Atom global for dealing with packages, themes, menus, and the window.
|
||||
|
||||
@@ -24,7 +24,7 @@ class BlockDecorationsComponent
|
||||
@domNode.style.width = @newState.width + "px"
|
||||
@oldState.width = @newState.width
|
||||
|
||||
for id, blockDecorationState of @oldState.blockDecorations
|
||||
for id of @oldState.blockDecorations
|
||||
unless @newState.blockDecorations.hasOwnProperty(id)
|
||||
blockDecorationNode = @blockDecorationNodesById[id]
|
||||
blockDecorationNode.previousSibling.remove()
|
||||
@@ -33,7 +33,7 @@ class BlockDecorationsComponent
|
||||
delete @blockDecorationNodesById[id]
|
||||
delete @oldState.blockDecorations[id]
|
||||
|
||||
for id, blockDecorationState of @newState.blockDecorations
|
||||
for id of @newState.blockDecorations
|
||||
if @oldState.blockDecorations.hasOwnProperty(id)
|
||||
@updateBlockDecorationNode(id)
|
||||
else
|
||||
@@ -42,7 +42,6 @@ class BlockDecorationsComponent
|
||||
|
||||
measureBlockDecorations: ->
|
||||
for decorationId, blockDecorationNode of @blockDecorationNodesById
|
||||
style = getComputedStyle(blockDecorationNode)
|
||||
decoration = @newState.blockDecorations[decorationId].decoration
|
||||
topRuler = blockDecorationNode.previousSibling
|
||||
bottomRuler = blockDecorationNode.nextSibling
|
||||
|
||||
@@ -214,7 +214,6 @@ class CommandRegistry
|
||||
immediatePropagationStopped = false
|
||||
matched = false
|
||||
currentTarget = event.target
|
||||
{preventDefault, stopPropagation, stopImmediatePropagation, abortKeyBinding} = event
|
||||
|
||||
dispatchedEvent = new CustomEvent(event.type, {bubbles: true, detail: event.detail})
|
||||
Object.defineProperty dispatchedEvent, 'eventPhase', value: Event.BUBBLING_PHASE
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
_ = require 'underscore-plus'
|
||||
fs = require 'fs-plus'
|
||||
{CompositeDisposable, Disposable, Emitter} = require 'event-kit'
|
||||
{Emitter} = require 'event-kit'
|
||||
CSON = require 'season'
|
||||
path = require 'path'
|
||||
async = require 'async'
|
||||
@@ -561,7 +561,7 @@ class Config
|
||||
# * `scopeDescriptor` The {ScopeDescriptor} with which the value is associated
|
||||
# * `value` The value for the key-path
|
||||
getAll: (keyPath, options) ->
|
||||
{scope, sources} = options if options?
|
||||
{scope} = options if options?
|
||||
result = []
|
||||
|
||||
if scope?
|
||||
@@ -1045,7 +1045,6 @@ class Config
|
||||
resetSettingsForSchemaChange: (source=@getUserConfigPath()) ->
|
||||
@transact =>
|
||||
@settings = @makeValueConformToSchema(null, @settings, suppressException: true)
|
||||
priority = @priorityForSource(source)
|
||||
selectorsAndSettings = @scopedSettingsStore.propertiesForSource(source)
|
||||
@scopedSettingsStore.removePropertiesForSource(source)
|
||||
for scopeSelector, settings of selectorsAndSettings
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
_ = require 'underscore-plus'
|
||||
path = require 'path'
|
||||
CSON = require 'season'
|
||||
fs = require 'fs-plus'
|
||||
|
||||
@@ -682,7 +682,6 @@ class Cursor extends Model
|
||||
{row, column} = start
|
||||
scanRange = [[row-1, column], [0, 0]]
|
||||
position = new Point(0, 0)
|
||||
zero = new Point(0, 0)
|
||||
@editor.backwardsScanInBufferRange EmptyLineRegExp, scanRange, ({range, stop}) ->
|
||||
position = range.start.traverse(Point(1, 0))
|
||||
stop() unless position.isEqual(start)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{basename, join} = require 'path'
|
||||
{join} = require 'path'
|
||||
|
||||
_ = require 'underscore-plus'
|
||||
{Emitter, Disposable, CompositeDisposable} = require 'event-kit'
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
_ = require 'underscore-plus'
|
||||
{Emitter} = require 'event-kit'
|
||||
FirstMate = require 'first-mate'
|
||||
Token = require './token'
|
||||
fs = require 'fs-plus'
|
||||
|
||||
@@ -18,7 +18,7 @@ class GutterContainerComponent
|
||||
@domNode.style.display = 'flex'
|
||||
|
||||
destroy: ->
|
||||
for {name, component} in @gutterComponents
|
||||
for {component} in @gutterComponents
|
||||
component.destroy?()
|
||||
return
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ module.exports = ({blobStore}) ->
|
||||
require './window'
|
||||
{getWindowLoadSettings} = require './window-load-settings-helpers'
|
||||
{ipcRenderer} = require 'electron'
|
||||
{resourcePath, isSpec, devMode, env} = getWindowLoadSettings()
|
||||
{resourcePath, devMode, env} = getWindowLoadSettings()
|
||||
require '../src/electron-shims'
|
||||
|
||||
updateProcessEnv(env)
|
||||
|
||||
@@ -253,7 +253,6 @@ class LanguageMode
|
||||
iterator.next()
|
||||
scopeDescriptor = new ScopeDescriptor(scopes: iterator.getScopes())
|
||||
|
||||
patterns =
|
||||
increaseIndentRegex = @increaseIndentRegexForScopeDescriptor(scopeDescriptor)
|
||||
decreaseIndentRegex = @decreaseIndentRegexForScopeDescriptor(scopeDescriptor)
|
||||
decreaseNextIndentRegex = @decreaseNextIndentRegexForScopeDescriptor(scopeDescriptor)
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
_ = require 'underscore-plus'
|
||||
|
||||
idCounter = 0
|
||||
nextId = -> idCounter++
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
TiledComponent = require './tiled-component'
|
||||
LineNumbersTileComponent = require './line-numbers-tile-component'
|
||||
WrapperDiv = document.createElement('div')
|
||||
DOMElementPool = require './dom-element-pool'
|
||||
|
||||
module.exports =
|
||||
class LineNumberGutterComponent extends TiledComponent
|
||||
|
||||
@@ -96,7 +96,7 @@ class LineNumbersTileComponent
|
||||
screenRowForNode: (node) -> parseInt(node.dataset.screenRow)
|
||||
|
||||
buildLineNumberNode: (lineNumberState) ->
|
||||
{screenRow, bufferRow, softWrapped, top, decorationClasses, zIndex, blockDecorationsHeight} = lineNumberState
|
||||
{screenRow, bufferRow, softWrapped, blockDecorationsHeight} = lineNumberState
|
||||
|
||||
className = @buildLineNumberClassName(lineNumberState)
|
||||
lineNumberNode = @domElementPool.buildElement("div", className)
|
||||
|
||||
@@ -15,8 +15,6 @@ DummyLineNode.children[1].textContent = '我'
|
||||
DummyLineNode.children[2].textContent = 'ハ'
|
||||
DummyLineNode.children[3].textContent = '세'
|
||||
|
||||
RangeForMeasurement = document.createRange()
|
||||
|
||||
module.exports =
|
||||
class LinesComponent extends TiledComponent
|
||||
placeholderTextDiv: null
|
||||
@@ -77,7 +75,6 @@ class LinesComponent extends TiledComponent
|
||||
|
||||
measureLineHeightAndDefaultCharWidth: ->
|
||||
@domNode.appendChild(DummyLineNode)
|
||||
textNode = DummyLineNode.firstChild.childNodes[0]
|
||||
|
||||
lineHeightInPixels = DummyLineNode.getBoundingClientRect().height
|
||||
defaultCharWidth = DummyLineNode.children[0].getBoundingClientRect().width
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
_ = require 'underscore-plus'
|
||||
|
||||
HighlightsComponent = require './highlights-component'
|
||||
AcceptFilter = {acceptNode: -> NodeFilter.FILTER_ACCEPT}
|
||||
TokenTextEscapeRegex = /[&"'<>]/g
|
||||
MaxTokenLength = 20000
|
||||
ZERO_WIDTH_NBSP = '\ufeff'
|
||||
|
||||
cloneObject = (object) ->
|
||||
@@ -201,7 +196,6 @@ class LinesTileComponent
|
||||
lineNode.classList.add(decorationClass)
|
||||
|
||||
textNodes = []
|
||||
lineLength = 0
|
||||
startIndex = 0
|
||||
openScopeNode = lineNode
|
||||
for tagCode in tagCodes when tagCode isnt 0
|
||||
|
||||
@@ -18,7 +18,6 @@ class LinesYardstick
|
||||
screenPositionForPixelPosition: (pixelPosition) ->
|
||||
targetTop = pixelPosition.top
|
||||
targetLeft = pixelPosition.left
|
||||
defaultCharWidth = @model.getDefaultCharWidth()
|
||||
row = @lineTopIndex.rowForPixelPosition(targetTop)
|
||||
targetLeft = 0 if targetTop < 0 or targetLeft < 0
|
||||
targetLeft = Infinity if row > @model.getLastScreenRow()
|
||||
|
||||
@@ -63,7 +63,7 @@ class AtomApplication
|
||||
exit: (status) -> app.exit(status)
|
||||
|
||||
constructor: (options) ->
|
||||
{@resourcePath, @devResourcePath, @version, @devMode, @safeMode, @socketPath, @logFile, @setPortable, @userDataDir, timeout, clearWindowState} = options
|
||||
{@resourcePath, @devResourcePath, @version, @devMode, @safeMode, @socketPath, @logFile, @setPortable, @userDataDir} = options
|
||||
@socketPath = null if options.test
|
||||
@pidsToOpenWindows = {}
|
||||
@windows = []
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{app, protocol} = require 'electron'
|
||||
{protocol} = require 'electron'
|
||||
fs = require 'fs'
|
||||
path = require 'path'
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ class AtomWindow
|
||||
isSpec: null
|
||||
|
||||
constructor: (@atomApplication, @fileRecoveryService, settings={}) ->
|
||||
{@resourcePath, initialPaths, pathToOpen, locationsToOpen, @isSpec, @headless, @safeMode, @devMode} = settings
|
||||
{@resourcePath, pathToOpen, locationsToOpen, @isSpec, @headless, @safeMode, @devMode} = settings
|
||||
locationsToOpen ?= [{pathToOpen}] if pathToOpen
|
||||
locationsToOpen ?= []
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{Emitter, Disposable} = require 'event-kit'
|
||||
{Emitter} = require 'event-kit'
|
||||
Notification = require '../src/notification'
|
||||
|
||||
# Public: A notification manager used to create {Notification}s to be shown
|
||||
|
||||
@@ -284,7 +284,7 @@ class PackageManager
|
||||
packagePaths.push(packagePath) if fs.isDirectorySync(packagePath)
|
||||
|
||||
packagesPath = path.join(@resourcePath, 'node_modules')
|
||||
for packageName, packageVersion of @getPackageDependencies()
|
||||
for packageName of @getPackageDependencies()
|
||||
packagePath = path.join(packagesPath, packageName)
|
||||
packagePaths.push(packagePath) if fs.isDirectorySync(packagePath)
|
||||
|
||||
|
||||
@@ -422,8 +422,6 @@ class Package
|
||||
@settingsActivated = false
|
||||
|
||||
reloadStylesheets: ->
|
||||
oldSheets = _.clone(@stylesheets)
|
||||
|
||||
try
|
||||
@loadStylesheets()
|
||||
catch error
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{find, flatten} = require 'underscore-plus'
|
||||
{find} = require 'underscore-plus'
|
||||
{Emitter, CompositeDisposable} = require 'event-kit'
|
||||
Gutter = require './gutter'
|
||||
Model = require './model'
|
||||
Pane = require './pane'
|
||||
ItemRegistry = require './item-registry'
|
||||
|
||||
@@ -21,7 +21,7 @@ class Pane extends Model
|
||||
focused: false
|
||||
|
||||
@deserialize: (state, {deserializers, applicationDelegate, config, notifications}) ->
|
||||
{items, itemStackIndices, activeItemIndex, activeItemURI, activeItemUri} = state
|
||||
{items, activeItemIndex, activeItemURI, activeItemUri} = state
|
||||
activeItemURI ?= activeItemUri
|
||||
items = items.map (itemState) -> deserializers.deserialize(itemState)
|
||||
state.activeItem = items[activeItemIndex]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
path = require 'path'
|
||||
url = require 'url'
|
||||
|
||||
_ = require 'underscore-plus'
|
||||
fs = require 'fs-plus'
|
||||
@@ -8,8 +7,6 @@ TextBuffer = require 'text-buffer'
|
||||
|
||||
DefaultDirectoryProvider = require './default-directory-provider'
|
||||
Model = require './model'
|
||||
TextEditor = require './text-editor'
|
||||
Task = require './task'
|
||||
GitRepositoryProvider = require './git-repository-provider'
|
||||
|
||||
# Extended: Represents a project that's opened in Atom.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{ipcRenderer} = require 'electron'
|
||||
Grim = require 'grim'
|
||||
|
||||
module.exports = ({commandRegistry, commandInstaller, config, notificationManager, project, clipboard}) ->
|
||||
commandRegistry.add 'atom-workspace',
|
||||
|
||||
@@ -5,8 +5,6 @@ async = require "async"
|
||||
module.exports = (rootPaths, regexSource, options) ->
|
||||
callback = @async()
|
||||
|
||||
rootPath = rootPaths[0]
|
||||
|
||||
PATHS_COUNTER_SEARCHED_CHUNK = 50
|
||||
pathsSearched = 0
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
CSON = require 'season'
|
||||
{CompositeDisposable} = require 'event-kit'
|
||||
|
||||
module.exports =
|
||||
class ScopedProperties
|
||||
|
||||
@@ -512,7 +512,7 @@ class Selection extends Model
|
||||
joinMarker = @editor.markBufferRange(selectedRange, invalidate: 'never')
|
||||
|
||||
rowCount = Math.max(1, selectedRange.getRowCount() - 1)
|
||||
for row in [0...rowCount]
|
||||
for [0...rowCount]
|
||||
@cursor.setBufferPosition([selectedRange.start.row])
|
||||
@cursor.moveToEndOfLine()
|
||||
|
||||
@@ -656,7 +656,7 @@ class Selection extends Model
|
||||
# * `autoIndent` If `true`, the line is indented to an automatically-inferred
|
||||
# level. Otherwise, {TextEditor::getTabText} is inserted.
|
||||
indent: ({autoIndent}={}) ->
|
||||
{row, column} = @cursor.getBufferPosition()
|
||||
{row} = @cursor.getBufferPosition()
|
||||
|
||||
if @isEmpty()
|
||||
@cursor.skipLeadingWhitespace()
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
_ = require 'underscore-plus'
|
||||
scrollbarStyle = require 'scrollbar-style'
|
||||
{Range, Point} = require 'text-buffer'
|
||||
{CompositeDisposable} = require 'event-kit'
|
||||
@@ -343,8 +342,6 @@ class TextEditorComponent
|
||||
@scopedConfigDisposables = new CompositeDisposable
|
||||
@disposables.add(@scopedConfigDisposables)
|
||||
|
||||
scope = @editor.getRootScopeDescriptor()
|
||||
|
||||
focused: ->
|
||||
if @mounted
|
||||
@presenter.setFocused(true)
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
{Emitter, CompositeDisposable} = require 'event-kit'
|
||||
Path = require 'path'
|
||||
{defaults} = require 'underscore-plus'
|
||||
TextBuffer = require 'text-buffer'
|
||||
TextEditor = require './text-editor'
|
||||
TextEditorComponent = require './text-editor-component'
|
||||
StylesElement = require './styles-element'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{CompositeDisposable, Disposable, Emitter} = require 'event-kit'
|
||||
{CompositeDisposable, Emitter} = require 'event-kit'
|
||||
{Point, Range} = require 'text-buffer'
|
||||
_ = require 'underscore-plus'
|
||||
Decoration = require './decoration'
|
||||
@@ -886,13 +886,11 @@ class TextEditorPresenter
|
||||
|
||||
setHorizontalScrollbarHeight: (horizontalScrollbarHeight) ->
|
||||
unless @measuredHorizontalScrollbarHeight is horizontalScrollbarHeight
|
||||
oldHorizontalScrollbarHeight = @measuredHorizontalScrollbarHeight
|
||||
@measuredHorizontalScrollbarHeight = horizontalScrollbarHeight
|
||||
@emitDidUpdateState()
|
||||
|
||||
setVerticalScrollbarWidth: (verticalScrollbarWidth) ->
|
||||
unless @measuredVerticalScrollbarWidth is verticalScrollbarWidth
|
||||
oldVerticalScrollbarWidth = @measuredVerticalScrollbarWidth
|
||||
@measuredVerticalScrollbarWidth = verticalScrollbarWidth
|
||||
@emitDidUpdateState()
|
||||
|
||||
@@ -922,7 +920,6 @@ class TextEditorPresenter
|
||||
|
||||
setContentFrameWidth: (contentFrameWidth) ->
|
||||
if @contentFrameWidth isnt contentFrameWidth or @editorWidthInChars?
|
||||
oldContentFrameWidth = @contentFrameWidth
|
||||
@contentFrameWidth = contentFrameWidth
|
||||
@editorWidthInChars = null
|
||||
@updateScrollbarDimensions()
|
||||
@@ -1122,7 +1119,7 @@ class TextEditorPresenter
|
||||
@updateHighlightState(decorationId, properties, screenRange)
|
||||
|
||||
for tileId, tileState of @state.content.tiles
|
||||
for id, highlight of tileState.highlights
|
||||
for id of tileState.highlights
|
||||
delete tileState.highlights[id] unless @visibleHighlights[tileId]?[id]?
|
||||
|
||||
return
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
path = require 'path'
|
||||
_ = require 'underscore-plus'
|
||||
{Emitter, Disposable, CompositeDisposable} = require 'event-kit'
|
||||
{Emitter, CompositeDisposable} = require 'event-kit'
|
||||
{File} = require 'pathwatcher'
|
||||
fs = require 'fs-plus'
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
_ = require 'underscore-plus'
|
||||
|
||||
StartDotRegex = /^\.?/
|
||||
WhitespaceRegex = /\S/
|
||||
|
||||
# Represents a single unit of text as selected by a grammar.
|
||||
module.exports =
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
_ = require 'underscore-plus'
|
||||
{CompositeDisposable, Emitter} = require 'event-kit'
|
||||
{Point, Range} = require 'text-buffer'
|
||||
{ScopeSelector} = require 'first-mate'
|
||||
Model = require './model'
|
||||
TokenizedLine = require './tokenized-line'
|
||||
TokenIterator = require './token-iterator'
|
||||
Token = require './token'
|
||||
ScopeDescriptor = require './scope-descriptor'
|
||||
TokenizedBufferIterator = require './tokenized-buffer-iterator'
|
||||
NullGrammar = require './null-grammar'
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
_ = require 'underscore-plus'
|
||||
{isPairedCharacter, isCJKCharacter} = require './text-utils'
|
||||
Token = require './token'
|
||||
CommentScopeRegex = /(\b|\.)comment/
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
{find} = require 'underscore-plus'
|
||||
Grim = require 'grim'
|
||||
{Disposable} = require 'event-kit'
|
||||
_ = require 'underscore-plus'
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
path = require 'path'
|
||||
{Disposable, CompositeDisposable} = require 'event-kit'
|
||||
fs = require 'fs-plus'
|
||||
listen = require './delegated-listener'
|
||||
|
||||
# Handles low-level events related to the @window.
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
{remote} = require 'electron'
|
||||
_ = require 'underscore-plus'
|
||||
|
||||
windowLoadSettings = null
|
||||
|
||||
exports.getWindowLoadSettings = ->
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
{ipcRenderer} = require 'electron'
|
||||
path = require 'path'
|
||||
fs = require 'fs-plus'
|
||||
{Disposable, CompositeDisposable} = require 'event-kit'
|
||||
Grim = require 'grim'
|
||||
{CompositeDisposable} = require 'event-kit'
|
||||
scrollbarStyle = require 'scrollbar-style'
|
||||
|
||||
module.exports =
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
_ = require 'underscore-plus'
|
||||
url = require 'url'
|
||||
path = require 'path'
|
||||
{join} = path
|
||||
{Emitter, Disposable, CompositeDisposable} = require 'event-kit'
|
||||
fs = require 'fs-plus'
|
||||
{Directory} = require 'pathwatcher'
|
||||
@@ -9,7 +8,6 @@ DefaultDirectorySearcher = require './default-directory-searcher'
|
||||
Model = require './model'
|
||||
TextEditor = require './text-editor'
|
||||
PaneContainer = require './pane-container'
|
||||
Pane = require './pane'
|
||||
Panel = require './panel'
|
||||
PanelContainer = require './panel-container'
|
||||
Task = require './task'
|
||||
|
||||
Reference in New Issue
Block a user