Skip to content

Commit de6d963

Browse files
committed
Renames helpers for consistency
1 parent 6a50bc3 commit de6d963

File tree

17 files changed

+41
-41
lines changed

17 files changed

+41
-41
lines changed

src/commands/closeUnchangedFiles.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { showGenericErrorMessage } from '../messages';
55
import { getRepositoryOrShowPicker } from '../quickpicks/repositoryPicker';
66
import { command } from '../system/-webview/command';
77
import { Logger } from '../system/logger';
8-
import { uriEquals } from '../system/uri';
8+
import { areUrisEqual } from '../system/uri';
99
import { GlCommandBase } from './commandBase';
1010

1111
export interface CloseUnchangedFilesCommandArgs {
@@ -46,12 +46,12 @@ export class CloseUnchangedFilesCommand extends GlCommandBase {
4646
tab.input instanceof TabInputNotebook
4747
) {
4848
const inputUri = tab.input.uri;
49-
if (hasNoChangedFiles || !args.uris.some(uri => uriEquals(uri, inputUri))) {
49+
if (hasNoChangedFiles || !args.uris.some(uri => areUrisEqual(uri, inputUri))) {
5050
void window.tabGroups.close(tab, true);
5151
}
5252
} else if (tab.input instanceof TabInputTextDiff || tab.input instanceof TabInputNotebookDiff) {
5353
const inputUri = tab.input.modified;
54-
if (hasNoChangedFiles || !args.uris.some(uri => uriEquals(uri, inputUri))) {
54+
if (hasNoChangedFiles || !args.uris.some(uri => areUrisEqual(uri, inputUri))) {
5555
void window.tabGroups.close(tab, true);
5656
}
5757
}

src/commands/diffLineWithPrevious.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { command, executeCommand } from '../system/-webview/command';
88
import { selectionToDiffRange } from '../system/-webview/vscode/editors';
99
import { getTabUris, getVisibleTabs } from '../system/-webview/vscode/tabs';
1010
import { Logger } from '../system/logger';
11-
import { uriEquals } from '../system/uri';
11+
import { areUrisEqual } from '../system/uri';
1212
import { ActiveEditorCommand } from './commandBase';
1313
import { getCommandUri } from './commandBase.utils';
1414
import type { CommandContext } from './commandContext';
@@ -52,7 +52,7 @@ export class DiffLineWithPreviousCommand extends ActiveEditorCommand {
5252
const uris = getTabUris(tab);
5353
// If there is an original, then we are in a diff editor -- modified is right, original is left
5454
if (uris.original != null) {
55-
skipFirstRev = uriEquals(uri, uris.modified);
55+
skipFirstRev = areUrisEqual(uri, uris.modified);
5656
}
5757
}
5858

src/commands/diffWithNext.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { command, executeCommand } from '../system/-webview/command';
88
import { selectionToDiffRange } from '../system/-webview/vscode/editors';
99
import { getTabUris, getVisibleTabs } from '../system/-webview/vscode/tabs';
1010
import { Logger } from '../system/logger';
11-
import { uriEquals } from '../system/uri';
11+
import { areUrisEqual } from '../system/uri';
1212
import { ActiveEditorCommand } from './commandBase';
1313
import { getCommandUri } from './commandBase.utils';
1414
import type { DiffWithCommandArgs } from './diffWith';
@@ -41,7 +41,7 @@ export class DiffWithNextCommand extends ActiveEditorCommand {
4141
if (tab != null) {
4242
const uris = getTabUris(tab);
4343
// If there is an original, then we are in a diff editor -- modified is right, original is left
44-
if (uris.original != null && uriEquals(uri, uris.original)) {
44+
if (uris.original != null && areUrisEqual(uri, uris.original)) {
4545
isInLeftSideOfDiffEditor = true;
4646
}
4747
}

src/commands/diffWithPrevious.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { command, executeCommand } from '../system/-webview/command';
99
import { getOrOpenTextEditor, selectionToDiffRange } from '../system/-webview/vscode/editors';
1010
import { getTabUris, getVisibleTabs } from '../system/-webview/vscode/tabs';
1111
import { Logger } from '../system/logger';
12-
import { uriEquals } from '../system/uri';
12+
import { areUrisEqual } from '../system/uri';
1313
import { ActiveEditorCommand } from './commandBase';
1414
import { getCommandUri } from './commandBase.utils';
1515
import type { DiffWithCommandArgs } from './diffWith';
@@ -80,7 +80,7 @@ export class DiffWithPreviousCommand extends ActiveEditorCommand {
8080

8181
const uris = getTabUris(tab);
8282
// If there is an original, then we are in a diff editor -- modified is right, original is left
83-
if (uris.original != null && uriEquals(uri, uris.modified)) {
83+
if (uris.original != null && areUrisEqual(uri, uris.modified)) {
8484
isInRightSideOfDiffEditor = true;
8585
}
8686
}

src/commands/diffWithWorking.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { command, executeCommand } from '../system/-webview/command';
1111
import { getOrOpenTextEditor, selectionToDiffRange } from '../system/-webview/vscode/editors';
1212
import { getTabUris, getVisibleTabs } from '../system/-webview/vscode/tabs';
1313
import { Logger } from '../system/logger';
14-
import { uriEquals } from '../system/uri';
14+
import { areUrisEqual } from '../system/uri';
1515
import { ActiveEditorCommand } from './commandBase';
1616
import { getCommandUri } from './commandBase.utils';
1717
import type { DiffWithCommandArgs } from './diffWith';
@@ -48,7 +48,7 @@ export class DiffWithWorkingCommand extends ActiveEditorCommand {
4848
if (tab != null) {
4949
const uris = getTabUris(tab);
5050
// If there is an original, then we are in a diff editor -- modified is right, original is left
51-
if (uris.original != null && uriEquals(uri, uris.modified)) {
51+
if (uris.original != null && areUrisEqual(uri, uris.modified)) {
5252
isInRightSideOfDiffEditor = true;
5353
}
5454
}

src/commands/openFileOnRemote.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { showReferencePicker } from '../quickpicks/referencePicker';
1111
import { command, executeCommand } from '../system/-webview/command';
1212
import { Logger } from '../system/logger';
1313
import { pad, splitSingle } from '../system/string';
14-
import { uriEquals } from '../system/uri';
14+
import { areUrisEqual } from '../system/uri';
1515
import { StatusFileNode } from '../views/nodes/statusFileNode';
1616
import { ActiveEditorCommand } from './commandBase';
1717
import { getCommandUri } from './commandBase.utils';
@@ -122,7 +122,7 @@ export class OpenFileOnRemoteCommand extends ActiveEditorCommand {
122122

123123
let range: Range | undefined;
124124
if (args.range) {
125-
if (editor != null && uriEquals(editor.document.uri, uri)) {
125+
if (editor != null && areUrisEqual(editor.document.uri, uri)) {
126126
range = new Range(
127127
editor.selection.start.with({ line: editor.selection.start.line + 1 }),
128128
editor.selection.end.with({

src/commands/openOnlyChangedFiles.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { command } from '../system/-webview/command';
77
import { openTextEditors } from '../system/-webview/vscode/editors';
88
import { filterMap } from '../system/array';
99
import { Logger } from '../system/logger';
10-
import { uriEquals } from '../system/uri';
10+
import { areUrisEqual } from '../system/uri';
1111
import { GlCommandBase } from './commandBase';
1212

1313
export interface OpenOnlyChangedFilesCommandArgs {
@@ -64,7 +64,7 @@ export class OpenOnlyChangedFilesCommand extends GlCommandBase {
6464

6565
if (inputUri == null) continue;
6666
// eslint-disable-next-line no-loop-func
67-
matchingUri = args.uris.find(uri => uriEquals(uri, inputUri));
67+
matchingUri = args.uris.find(uri => areUrisEqual(uri, inputUri));
6868
if (matchingUri != null) {
6969
openUris.delete(matchingUri);
7070
} else {

src/env/node/git/localGitProvider.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ import { first, join } from '../../../system/iterable';
6868
import { Logger } from '../../../system/logger';
6969
import type { LogScope } from '../../../system/logger.scope';
7070
import { getLogScope, setLogScopeExit } from '../../../system/logger.scope';
71-
import { commonBaseIndex, dirname, isAbsolute, maybeUri, normalizePath, pathEquals } from '../../../system/path';
71+
import { arePathsEqual, commonBaseIndex, dirname, isAbsolute, maybeUri, normalizePath } from '../../../system/path';
7272
import { any, asSettled, getSettledValue } from '../../../system/promise';
7373
import { equalsIgnoreCase, getDurationMilliseconds } from '../../../system/string';
7474
import { compare, fromString } from '../../../system/version';
@@ -1221,7 +1221,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
12211221
if (networkPath != null) {
12221222
// If the repository is at the root of the mapped drive then we
12231223
// have to append `\` (ex: D:\) otherwise the path is not valid.
1224-
const isDriveRoot = pathEquals(repoUri.fsPath, networkPath);
1224+
const isDriveRoot = arePathsEqual(repoUri.fsPath, networkPath);
12251225

12261226
repoPath = normalizePath(
12271227
repoUri.fsPath.replace(
@@ -1250,7 +1250,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
12501250
return;
12511251
}
12521252

1253-
if (pathEquals(uri.fsPath, resolvedPath)) {
1253+
if (arePathsEqual(uri.fsPath, resolvedPath)) {
12541254
Logger.debug(scope, `No symlink detected; repoPath=${repoPath}`);
12551255
resolve([repoPath!, undefined]);
12561256
return;

src/git/gitProviderService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import { getScheme, isAbsolute, maybeUri, normalizePath } from '../system/path';
3939
import type { Deferred } from '../system/promise';
4040
import { asSettled, defer, getDeferredPromiseIfPending, getSettledValue } from '../system/promise';
4141
import { VisitedPathsTrie } from '../system/trie';
42-
import { uriEquals } from '../system/uri';
42+
import { areUrisEqual } from '../system/uri';
4343
import type {
4444
CachedGitTypes,
4545
GitBranchesSubProvider,
@@ -1970,7 +1970,7 @@ export class GitProviderService implements Disposable {
19701970
if (typeof pathOrUri === 'string') {
19711971
return this.getRepository(pathOrUri)?.path === pathOrUri;
19721972
}
1973-
return uriEquals(pathOrUri, this.getRepository(pathOrUri)?.uri);
1973+
return areUrisEqual(pathOrUri, this.getRepository(pathOrUri)?.uri);
19741974
}
19751975

19761976
@log({ exit: true })

src/git/gitUri.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { isVirtualUri } from '../system/-webview/vscode/uris';
99
import { memoize } from '../system/decorators/-webview/memoize';
1010
import { debug } from '../system/decorators/log';
1111
import { basename, normalizePath } from '../system/path';
12-
import { uriEquals } from '../system/uri';
12+
import { areUrisEqual } from '../system/uri';
1313
import type { RevisionUriData } from './gitProvider';
1414
import { decodeGitLensRevisionUriAuthority, decodeRemoteHubAuthority } from './gitUri.authority';
1515
import type { GitFile } from './models/file';
@@ -213,7 +213,7 @@ export class GitUri extends (Uri as any as UriEx) {
213213
}
214214

215215
equals(uri: Uri | undefined): boolean {
216-
if (!uriEquals(this, uri)) return false;
216+
if (!areUrisEqual(this, uri)) return false;
217217

218218
return this.sha === (isGitUri(uri) ? uri.sha : undefined);
219219
}

0 commit comments

Comments
 (0)