Deprecate Project::resolve

It’s not something that will make sense once we add the ability to have
multiple directories in a project. This adds a new private method on
Project, ::resolvePath, with the original implementation for convenience
until we actually implement multi-folder projects.
This commit is contained in:
Nathan Sobo
2015-01-09 14:54:54 -08:00
parent f9bde050b4
commit d26c19a0ec
8 changed files with 51 additions and 75 deletions

View File

@@ -6,6 +6,7 @@ Q = require 'q'
Serializable = require 'serializable'
{Emitter, Disposable, CompositeDisposable} = require 'event-kit'
Grim = require 'grim'
fs = require 'fs-plus'
TextEditor = require './text-editor'
PaneContainer = require './pane-container'
Pane = require './pane'
@@ -383,7 +384,7 @@ class Workspace extends Model
open: (uri, options={}) ->
searchAllPanes = options.searchAllPanes
split = options.split
uri = atom.project.resolve(uri)
uri = atom.project.resolvePath(uri)
pane = @paneContainer.paneForUri(uri) if searchAllPanes
pane ?= switch split
@@ -422,8 +423,7 @@ class Workspace extends Model
{initialLine, initialColumn} = options
activatePane = options.activatePane ? true
uri = atom.project.resolve(uri)
uri = atom.project.resolvePath(uri)
item = @getActivePane().itemForUri(uri)
if uri
item ?= opener(uri, options) for opener in @getOpeners() when !item
@@ -445,7 +445,7 @@ class Workspace extends Model
if uri?
item = pane.itemForUri(uri)
item ?= opener(atom.project.resolve(uri), options) for opener in @getOpeners() when !item
item ?= opener(uri, options) for opener in @getOpeners() when !item
item ?= atom.project.open(uri, options)
Q(item)