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

In case unsaved file, Tern is returning filename without forward slash#14055

Merged
boopeshmahendran merged 2 commits intomasterfrom
navc/RenameInUnsavedFile
Jan 20, 2018
Merged

In case unsaved file, Tern is returning filename without forward slash#14055
boopeshmahendran merged 2 commits intomasterfrom
navc/RenameInUnsavedFile

Conversation

@navch
Copy link
Copy Markdown
Contributor

@navch navch commented Jan 19, 2018

Fixing issue #14053

Please review @swmitra @nethip @boopeshmahendran

Copy link
Copy Markdown
Collaborator

@swmitra swmitra left a comment

Choose a reason for hiding this comment

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

LGTM

function isInSameFile(obj, refsResp) {
return (obj && obj.file === refsResp.file);
// 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))));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can be written as -
return (obj && (obj.file === refsResp.file || obj.file === refsResp.file.slice(1, refsResp.file.length)));

By eliminating the last brace.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@swmitra Done. Please merge this PR.

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.

3 participants