Skip to content

Commit 364b84e

Browse files
committed
Merge remote-tracking branch 'origin/main' into connor4312/inline-remote-resolver
2 parents 66f719f + 0231286 commit 364b84e

File tree

185 files changed

+3923
-1839
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+3923
-1839
lines changed

.github/workflows/rich-navigation.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: "Rich Navigation Indexing"
22
on:
33
workflow_dispatch:
4-
pull_request:
54
push:
65
branches:
76
- main

.vscode/settings.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
},
1818
"search.exclude": {
1919
"**/node_modules": true,
20-
"**/bower_components": true,
2120
"cli/target/**": true,
2221
".build/**": true,
2322
"out/**": true,
@@ -34,6 +33,18 @@
3433
"src/vs/workbench/api/test/browser/extHostDocumentData.test.perf-data.ts": true,
3534
"src/vs/editor/test/node/diffing/fixtures/**": true,
3635
},
36+
"files.readonlyInclude": {
37+
"**/node_modules/**": true,
38+
"out/**": true,
39+
"out-build/**": true,
40+
"out-vscode/**": true,
41+
"out-vscode-reh/**": true,
42+
"extensions/**/dist/**": true,
43+
"extensions/**/out/**": true,
44+
"test/smoke/out/**": true,
45+
"test/automation/out/**": true,
46+
"test/integration/browser/out/**": true,
47+
},
3748
"lcov.path": [
3849
"./.build/coverage/lcov.info",
3950
"./.build/coverage-single/lcov.info"

build/azure-pipelines/cli/prepare.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/azure-pipelines/cli/prepare.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ const setLauncherEnvironmentVars = () => {
5454
['VSCODE_CLI_TUNNEL_SERVICE_MUTEX', product.win32TunnelServiceMutex],
5555
['VSCODE_CLI_TUNNEL_CLI_MUTEX', product.win32TunnelMutex],
5656
['VSCODE_CLI_COMMIT', commit],
57+
['VSCODE_CLI_DEFAULT_PARENT_DATA_DIR', product.dataFolderName],
5758
[
5859
'VSCODE_CLI_WIN32_APP_IDS',
5960
!isOSS && JSON.stringify(

build/gulpfile.reh.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ function nodejs(platform, arch) {
164164

165165
if (platform === 'win32') {
166166
if (product.nodejsRepository) {
167-
return assetFromGithub(product.nodejsRepository, nodeVersion, name => name === `win-${arch}-patched-node.exe`)
167+
return assetFromGithub(product.nodejsRepository, nodeVersion, name => name === `win-${arch}-node.exe`)
168168
.pipe(rename('node.exe'));
169169
}
170170

build/lib/electron.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/lib/electron.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function darwinBundleDocumentTypes(types: { [name: string]: string | string[] },
9191
}
9292

9393
export const config = {
94-
version: product.electronRepository ? '22.5.1' : util.getElectronVersion(),
94+
version: product.electronRepository ? '22.5.2' : util.getElectronVersion(),
9595
productAppName: product.nameLong,
9696
companyName: 'Microsoft Corporation',
9797
copyright: 'Copyright (C) 2023 Microsoft. All rights reserved',
@@ -212,7 +212,7 @@ function getElectron(arch: string): () => NodeJS.ReadWriteStream {
212212
}
213213

214214
async function main(arch = process.arch): Promise<void> {
215-
const version = product.electronRepository ? '22.5.1' : util.getElectronVersion();
215+
const version = product.electronRepository ? '22.5.2' : util.getElectronVersion();
216216
const electronPath = path.join(root, '.build', 'electron');
217217
const versionFile = path.join(electronPath, 'version');
218218
const isUpToDate = fs.existsSync(versionFile) && fs.readFileSync(versionFile, 'utf8') === `${version}`;

cli/src/bin/code/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async fn main() -> Result<(), std::convert::Infallible> {
3636
});
3737

3838
let core = parsed.core();
39-
let context_paths = LauncherPaths::new(&core.global_options.cli_data_dir).unwrap();
39+
let context_paths = LauncherPaths::migrate(core.global_options.cli_data_dir.clone()).unwrap();
4040
let context_args = core.clone();
4141

4242
// gets a command context without installing the global logger

cli/src/constants.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ pub const TUNNEL_ACTIVITY_NAME: &str = concatcp!(PRODUCT_NAME_LONG, " Tunnel");
7575

7676
const NONINTERACTIVE_VAR: &str = "VSCODE_CLI_NONINTERACTIVE";
7777

78+
/// Default data CLI data directory.
79+
pub const DEFAULT_DATA_PARENT_DIR: &str = match option_env!("VSCODE_CLI_DEFAULT_PARENT_DATA_DIR") {
80+
Some(n) => n,
81+
None => ".vscode-oss",
82+
};
83+
7884
pub fn get_default_user_agent() -> String {
7985
format!(
8086
"vscode-server-launcher/{}",

cli/src/state.rs

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
extern crate dirs;
77

88
use std::{
9-
fs::{create_dir, read_to_string, remove_dir_all, write},
9+
fs::{create_dir_all, read_to_string, remove_dir_all, write},
1010
path::{Path, PathBuf},
1111
sync::{Arc, Mutex},
1212
};
1313

1414
use serde::{de::DeserializeOwned, Serialize};
1515

1616
use crate::{
17-
constants::VSCODE_CLI_QUALITY,
17+
constants::{DEFAULT_DATA_PARENT_DIR, VSCODE_CLI_QUALITY},
1818
download_cache::DownloadCache,
1919
util::errors::{wrap, AnyError, NoHomeForLauncherError, WrappedError},
2020
};
@@ -107,8 +107,38 @@ where
107107
}
108108

109109
impl LauncherPaths {
110-
pub fn new(root: &Option<String>) -> Result<LauncherPaths, AnyError> {
111-
let root = root.as_deref().unwrap_or("~/.vscode-cli");
110+
/// todo@conno4312: temporary migration from the old CLI data directory
111+
pub fn migrate(root: Option<String>) -> Result<LauncherPaths, AnyError> {
112+
if root.is_some() {
113+
return Self::new(root);
114+
}
115+
116+
let home_dir = match dirs::home_dir() {
117+
None => return Self::new(root),
118+
Some(d) => d,
119+
};
120+
121+
let old_dir = home_dir.join(".vscode-cli");
122+
let mut new_dir = home_dir;
123+
new_dir.push(DEFAULT_DATA_PARENT_DIR);
124+
new_dir.push("cli");
125+
if !old_dir.exists() || new_dir.exists() {
126+
return Self::new_for_path(new_dir);
127+
}
128+
129+
if let Err(e) = std::fs::rename(&old_dir, &new_dir) {
130+
// no logger exists at this point in the lifecycle, so just log to stderr
131+
eprintln!(
132+
"Failed to migrate old CLI data directory, will create a new one ({})",
133+
e
134+
);
135+
}
136+
137+
Self::new_for_path(new_dir)
138+
}
139+
140+
pub fn new(root: Option<String>) -> Result<LauncherPaths, AnyError> {
141+
let root = root.unwrap_or_else(|| format!("~/{}/cli", DEFAULT_DATA_PARENT_DIR));
112142
let mut replaced = root.to_owned();
113143
for token in HOME_DIR_ALTS {
114144
if root.contains(token) {
@@ -120,14 +150,16 @@ impl LauncherPaths {
120150
}
121151
}
122152

123-
if !Path::new(&replaced).exists() {
124-
create_dir(&replaced)
125-
.map_err(|e| wrap(e, format!("error creating directory {}", &replaced)))?;
153+
Self::new_for_path(PathBuf::from(replaced))
154+
}
155+
156+
fn new_for_path(root: PathBuf) -> Result<LauncherPaths, AnyError> {
157+
if !root.exists() {
158+
create_dir_all(&root)
159+
.map_err(|e| wrap(e, format!("error creating directory {}", root.display())))?;
126160
}
127161

128-
Ok(LauncherPaths::new_without_replacements(PathBuf::from(
129-
replaced,
130-
)))
162+
Ok(LauncherPaths::new_without_replacements(root))
131163
}
132164

133165
pub fn new_without_replacements(root: PathBuf) -> LauncherPaths {

0 commit comments

Comments
 (0)