Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

jsRefactor Rename Relative Path issue fixed #14520

Merged
merged 2 commits into from
Aug 27, 2018
Merged

jsRefactor Rename Relative Path issue fixed #14520

merged 2 commits into from
Aug 27, 2018

Conversation

niteskum
Copy link
Collaborator

@niteskum niteskum commented Aug 24, 2018

Rename doesn't work if TernNodeDomain return Refs with path relative to project Root.
So added check it will compare both Absolute path and Relative path so if either of these is true Refs will be considered in same file.

@boopeshmahendran @navch please review

@niteskum niteskum changed the title jsRefactor Rename Realtice Path issue fixed jsRefactor Rename Realtive Path issue fixed Aug 24, 2018
@niteskum niteskum changed the title jsRefactor Rename Realtive Path issue fixed jsRefactor Rename Relative Path issue fixed Aug 24, 2018
@@ -98,7 +99,17 @@ define(function (require, exports, module) {

function isInSameFile(obj, refsResp) {
// In case of unsaved files, After renameing once Tern is returning filename without forward slash
return (obj && (obj.file === refsResp.file || obj.file === refsResp.file.slice(1, refsResp.file.length)));
var projectDir = ProjectManager.getProjectRoot().fullPath,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if ProjectManager.getProjectRoot() returns null


// get the relative path of File as Tern can also return
// references with file name as a relative path wrt projectRoot
// so refernce file will be compared with both relative and Absolute path ti check if it is same file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: fix typos

@boopeshmahendran boopeshmahendran merged commit 8f5be98 into adobe:master Aug 27, 2018
nyteksf pushed a commit to nyteksf/brackets that referenced this pull request Sep 8, 2018
author Nitesh Kumar <38075523+niteskum@users.noreply.github.com> 1535377091 +0530
committer nyteksf <email.nytek@gmail.com> 1536424652 -0700

jsRefactor Rename Relative Path issue fixed (adobe#14520)

* jsRefactor Rename Realtice Path issue fixed

* Addressed review comments

Delete .gitignore

Exclude .gitignore, config.json

Repair error, Refactor error handling for localStorage

Add package.json to merge repos
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants