mirror of
https://github.com/RustyRaptor/brackets.git
synced 2026-12-04 00:15:22 -07:00
Use fullPath and name getters instead of getPath() and getName().
This commit is contained in:
1 parent
848e0b67f4
commit
819a20882d
40 files changed
+214
-218
No files matched your search
@@ -112,7 +112,7 @@ define(function (require, exports, module) {
|
||||
// Normally there is a project root, but for unit tests we need to
|
||||
// pass in a project root.
|
||||
if (pr) {
|
||||
projectRootPath = pr.getPath();
|
||||
projectRootPath = pr.fullPath;
|
||||
} else if (!projectRootPath) {
|
||||
console.log("initPreferences: projectRootPath has no value");
|
||||
}
|
||||
@@ -181,7 +181,7 @@ define(function (require, exports, module) {
|
||||
fileSystem.getDirectoryContents(directory)
|
||||
.done(function (contents) {
|
||||
contents.slice(0, preferences.getMaxFileCount()).forEach(function (entry) {
|
||||
var path = entry.getPath(),
|
||||
var path = entry.fullPath,
|
||||
split = HintUtils.splitPath(path),
|
||||
file = split.file;
|
||||
|
||||
@@ -196,7 +196,7 @@ define(function (require, exports, module) {
|
||||
} else if (directoryCallback && entry.isDirectory()) {
|
||||
var dirName = HintUtils.splitPath(split.dir).file;
|
||||
if (dirName.indexOf(".") !== 0) { // ignore .dotfiles
|
||||
directoryCallback(entry.getPath());
|
||||
directoryCallback(entry.fullPath);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -396,7 +396,7 @@ define(function (require, exports, module) {
|
||||
* has completed.
|
||||
*/
|
||||
function requestJumptoDef(session, document, offset) {
|
||||
var path = document.file.getPath(),
|
||||
var path = document.file.fullPath,
|
||||
fileInfo = {type: MessageIds.TERN_FILE_INFO_TYPE_FULL,
|
||||
name: path,
|
||||
offsetLines: 0,
|
||||
@@ -540,7 +540,7 @@ define(function (require, exports, module) {
|
||||
to = {line: endLine, ch: endCh};
|
||||
|
||||
return {type: MessageIds.TERN_FILE_INFO_TYPE_PART,
|
||||
name: document.file.getPath(),
|
||||
name: document.file.fullPath,
|
||||
offsetLines: from.line,
|
||||
text: document.getRange(from, to)};
|
||||
}
|
||||
@@ -558,7 +558,7 @@ define(function (require, exports, module) {
|
||||
var start = session.getCursor(),
|
||||
end = start,
|
||||
document = session.editor.document,
|
||||
path = document.file.getPath(),
|
||||
path = document.file.fullPath,
|
||||
isHtmlFile = LanguageManager.getLanguageForPath(path).getId() === "html",
|
||||
result;
|
||||
|
||||
@@ -768,7 +768,7 @@ define(function (require, exports, module) {
|
||||
* @return {jQuery.Promise} - the promise for the request
|
||||
*/
|
||||
function updateTernFile(document) {
|
||||
var path = document.file.getPath();
|
||||
var path = document.file.fullPath;
|
||||
|
||||
_postMessageByPass({
|
||||
type : MessageIds.TERN_UPDATE_FILE_MSG,
|
||||
@@ -826,20 +826,20 @@ define(function (require, exports, module) {
|
||||
var fileName = HintUtils.splitPath(name).file;
|
||||
|
||||
var files = ProjectManager.getFileSystem().getFileList(function (file) {
|
||||
return file.getName() === fileName;
|
||||
return file.name === fileName;
|
||||
});
|
||||
|
||||
var file;
|
||||
files = files.filter(function (file) {
|
||||
var pos = file.getPath().length - name.length;
|
||||
return pos === file.getPath().lastIndexOf(name);
|
||||
var pos = file.fullPath.length - name.length;
|
||||
return pos === file.fullPath.lastIndexOf(name);
|
||||
});
|
||||
|
||||
if (files.length === 1) {
|
||||
file = files[0];
|
||||
}
|
||||
if (file) {
|
||||
getDocText(file.getPath()).fail(function () {
|
||||
getDocText(file.fullPath).fail(function () {
|
||||
replyWith(name, "");
|
||||
});
|
||||
} else {
|
||||
@@ -1089,7 +1089,7 @@ define(function (require, exports, module) {
|
||||
* @param {Document} previousDocument - the document the editor has changed from
|
||||
*/
|
||||
function doEditorChange(session, document, previousDocument) {
|
||||
var path = document.file.getPath(),
|
||||
var path = document.file.fullPath,
|
||||
split = HintUtils.splitPath(path),
|
||||
dir = split.dir,
|
||||
files = [],
|
||||
@@ -1100,7 +1100,7 @@ define(function (require, exports, module) {
|
||||
|
||||
documentChanges = null;
|
||||
addFilesPromise = addFilesDeferred.promise();
|
||||
pr = ProjectManager.getProjectRoot() ? ProjectManager.getProjectRoot().getPath() : null;
|
||||
pr = ProjectManager.getProjectRoot() ? ProjectManager.getProjectRoot().fullPath : null;
|
||||
|
||||
// avoid re-initializing tern if possible.
|
||||
if (canSkipTernInitialization(path)) {
|
||||
|
||||
@@ -43,7 +43,7 @@ define(function (require, exports, module) {
|
||||
*/
|
||||
function Session(editor) {
|
||||
this.editor = editor;
|
||||
this.path = editor.document.file.getPath();
|
||||
this.path = editor.document.file.fullPath;
|
||||
this.ternHints = [];
|
||||
this.ternGuesses = null;
|
||||
this.fnType = null;
|
||||
@@ -593,7 +593,7 @@ define(function (require, exports, module) {
|
||||
* @return {string} - the "javascript" text that can be sent to Tern.
|
||||
*/
|
||||
Session.prototype.getJavascriptText = function () {
|
||||
if (LanguageManager.getLanguageForPath(this.editor.document.file.getPath()).getId() === "html") {
|
||||
if (LanguageManager.getLanguageForPath(this.editor.document.file.fullPath).getId() === "html") {
|
||||
// HTML file - need to send back only the bodies of the
|
||||
// <script> tags
|
||||
var text = "",
|
||||
|
||||
@@ -272,7 +272,7 @@ define(function (require, exports, module) {
|
||||
* @return {boolean} - true if the document is a html file
|
||||
*/
|
||||
function isHTMLFile(document) {
|
||||
var languageID = LanguageManager.getLanguageForPath(document.file.getPath()).getId();
|
||||
var languageID = LanguageManager.getLanguageForPath(document.file.fullPath).getId();
|
||||
return languageID === "html";
|
||||
}
|
||||
|
||||
@@ -547,7 +547,7 @@ define(function (require, exports, module) {
|
||||
// always clean up cached scope and hint info
|
||||
resetCachedHintContext();
|
||||
|
||||
if (editor && HintUtils.isSupportedLanguage(LanguageManager.getLanguageForPath(editor.document.file.getPath()).getId())) {
|
||||
if (editor && HintUtils.isSupportedLanguage(LanguageManager.getLanguageForPath(editor.document.file.fullPath).getId())) {
|
||||
initializeSession(editor, previousEditor);
|
||||
$(editor)
|
||||
.on(HintUtils.eventName("change"), function (event, editor, changeList) {
|
||||
|
||||
@@ -49,7 +49,7 @@ define(function (require, exports, module) {
|
||||
|
||||
CommandManager.register("test-file-open", Commands.FILE_OPEN, function (fileInfo) {
|
||||
// Register a command for FILE_OPEN, which the jump to def code will call
|
||||
return DocumentManager.getDocumentForPath(fileInfo.getPath()).done(function (doc) {
|
||||
return DocumentManager.getDocumentForPath(fileInfo.fullPath).done(function (doc) {
|
||||
DocumentManager.setCurrentDocument(doc);
|
||||
});
|
||||
});
|
||||
@@ -331,7 +331,7 @@ define(function (require, exports, module) {
|
||||
expect(newCursor.ch).toBe(expectedLocation.ch);
|
||||
if (expectedLocation.file) {
|
||||
var activeEditor = EditorManager.getActiveEditor();
|
||||
expect(activeEditor.document.file.getName()).toBe(expectedLocation.file);
|
||||
expect(activeEditor.document.file.name).toBe(expectedLocation.file);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user