diff options
| author | Clouds Flowing <clouds.flowing@gmail.com> | 2025-04-14 11:45:21 +0800 |
|---|---|---|
| committer | Clouds Flowing <clouds.flowing@gmail.com> | 2025-04-14 11:45:21 +0800 |
| commit | cfdeaca216b6024983a554f50bde5a5232a30d89 (patch) | |
| tree | cef546890a0f3bcb7e8ba8d74e1a343d7fe9aa90 /src/tools/rust-analyzer/editors/code | |
| parent | 8bc76c64e6ec21844406b8fe97b5f8c7ac8b58fa (diff) | |
| download | rust-cfdeaca216b6024983a554f50bde5a5232a30d89.tar.gz rust-cfdeaca216b6024983a554f50bde5a5232a30d89.zip | |
fix format
Diffstat (limited to 'src/tools/rust-analyzer/editors/code')
| -rw-r--r-- | src/tools/rust-analyzer/editors/code/src/util.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/tools/rust-analyzer/editors/code/src/util.ts b/src/tools/rust-analyzer/editors/code/src/util.ts index 723d2388ebf..83b8abe7773 100644 --- a/src/tools/rust-analyzer/editors/code/src/util.ts +++ b/src/tools/rust-analyzer/editors/code/src/util.ts @@ -304,12 +304,18 @@ export const isWindows = process.platform === "win32"; export function isWindowsDriveLetter(code: number): boolean { // Copied from https://github.com/microsoft/vscode/blob/02c2dba5f2669b924fd290dff7d2ff3460791996/src/vs/base/common/extpath.ts#L265-L267 - return code >= /* CharCode.A */ 65 && code <= /* CharCode.Z */ 90 || code >= /* CharCode.a */ 97 && code <= /* CharCode.z */ 122; + return ( + (code >= /* CharCode.A */ 65 && code <= /* CharCode.Z */ 90) || + (code >= /* CharCode.a */ 97 && code <= /* CharCode.z */ 122) + ); } export function hasDriveLetter(path: string, isWindowsOS: boolean = isWindows): boolean { // Copied from https://github.com/microsoft/vscode/blob/02c2dba5f2669b924fd290dff7d2ff3460791996/src/vs/base/common/extpath.ts#L324-L330 if (isWindowsOS) { - return isWindowsDriveLetter(path.charCodeAt(0)) && path.charCodeAt(1) === /* CharCode.Colon */ 58; + return ( + isWindowsDriveLetter(path.charCodeAt(0)) && + path.charCodeAt(1) === /* CharCode.Colon */ 58 + ); } return false; |
