Merge from vscode 2f984aad710215f4e4684a035bb02f55d1a9e2cc (#9819)

This commit is contained in:
Anthony Dresser
2020-04-01 00:44:39 -07:00
committed by GitHub
parent 0e27aaa61f
commit 0bfbdc62ed
247 changed files with 5402 additions and 3311 deletions

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { isWindows } from 'vs/base/common/platform';
import { startsWithIgnoreCase, equalsIgnoreCase, endsWith, rtrim } from 'vs/base/common/strings';
import { startsWithIgnoreCase, equalsIgnoreCase, rtrim } from 'vs/base/common/strings';
import { CharCode } from 'vs/base/common/charCode';
import { sep, posix, isAbsolute, join, normalize } from 'vs/base/common/path';
@@ -235,7 +235,7 @@ export function isWindowsDriveLetter(char0: number): boolean {
export function sanitizeFilePath(candidate: string, cwd: string): string {
// Special case: allow to open a drive letter without trailing backslash
if (isWindows && endsWith(candidate, ':')) {
if (isWindows && candidate.endsWith(':')) {
candidate += sep;
}
@@ -252,7 +252,7 @@ export function sanitizeFilePath(candidate: string, cwd: string): string {
candidate = rtrim(candidate, sep);
// Special case: allow to open drive root ('C:\')
if (endsWith(candidate, ':')) {
if (candidate.endsWith(':')) {
candidate += sep;
}