Skip to content

Commit e7dcde4

Browse files
committed
Merge branch 'tyriar/233768' into tyriar/228971
2 parents 0be64db + 601f45a commit e7dcde4

File tree

80 files changed

+2041
-1241
lines changed

Some content is hidden

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

80 files changed

+2041
-1241
lines changed

build/lib/stylelint/vscode-known-variables.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,9 @@
835835
"--notebook-diff-view-viewport-slider",
836836
"--notebook-find-horizontal-padding",
837837
"--notebook-find-width",
838+
"--notebook-editor-font-family",
839+
"--notebook-editor-font-size",
840+
"--notebook-editor-font-weight",
838841
"--outline-element-color",
839842
"--separator-border",
840843
"--status-border-top-color",

cli/src/bin/code/legacy_args.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::collections::HashMap;
77

88
use cli::commands::args::{
99
CliCore, Commands, DesktopCodeOptions, ExtensionArgs, ExtensionSubcommand,
10-
InstallExtensionArgs, ListExtensionArgs, UninstallExtensionArgs,
10+
InstallExtensionArgs, ListExtensionArgs, UninstallExtensionArgs, DownloadExtensionArgs,
1111
};
1212

1313
/// Tries to parse the argv using the legacy CLI interface, looking for its
@@ -64,6 +64,7 @@ pub fn try_parse_legacy(
6464
// Now translate them to subcommands.
6565
// --list-extensions -> ext list
6666
// --update-extensions -> update
67+
// --download-extension -> ext download <id>
6768
// --install-extension=id -> ext install <id>
6869
// --uninstall-extension=id -> ext uninstall <id>
6970
// --status -> status
@@ -79,6 +80,17 @@ pub fn try_parse_legacy(
7980
})),
8081
..Default::default()
8182
})
83+
} else if let Some(exts) = args.get("download-extension") {
84+
Some(CliCore {
85+
subcommand: Some(Commands::Extension(ExtensionArgs {
86+
subcommand: ExtensionSubcommand::Download(DownloadExtensionArgs {
87+
id: exts.to_vec(),
88+
location: get_first_arg_value("location"),
89+
}),
90+
desktop_code_options,
91+
})),
92+
..Default::default()
93+
})
8294
} else if let Some(exts) = args.remove("install-extension") {
8395
Some(CliCore {
8496
subcommand: Some(Commands::Extension(ExtensionArgs {

cli/src/commands/args.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,8 @@ pub enum ExtensionSubcommand {
272272
Uninstall(UninstallExtensionArgs),
273273
/// Update the installed extensions.
274274
Update,
275+
/// Download an extension.
276+
Download(DownloadExtensionArgs),
275277
}
276278

277279
impl ExtensionSubcommand {
@@ -305,6 +307,16 @@ impl ExtensionSubcommand {
305307
ExtensionSubcommand::Update => {
306308
target.push("--update-extensions".to_string());
307309
}
310+
ExtensionSubcommand::Download(args) => {
311+
for id in args.id.iter() {
312+
target.push(format!("--download-extension={id}"));
313+
}
314+
if let Some(location) = &args.location {
315+
if !location.is_empty() {
316+
target.push(format!("--location={location}"));
317+
}
318+
}
319+
}
308320
}
309321
}
310322
}
@@ -347,6 +359,21 @@ pub struct UninstallExtensionArgs {
347359
pub id: Vec<String>,
348360
}
349361

362+
#[derive(Args, Debug, Clone)]
363+
pub struct DownloadExtensionArgs {
364+
/// Id of the extension to download. The identifier of an
365+
/// extension is '${publisher}.${name}'. Should provide '--location' to specify the location to download the VSIX.
366+
/// To download a specific version provide '@${version}'.
367+
/// For example: 'vscode.csharp@1.2.3'.
368+
#[clap(name = "ext-id")]
369+
pub id: Vec<String>,
370+
371+
/// Specify the location to download the VSIX.
372+
#[clap(long, value_name = "location")]
373+
pub location: Option<String>,
374+
375+
}
376+
350377
#[derive(Args, Debug, Clone)]
351378
pub struct VersionArgs {
352379
#[clap(subcommand)]

cli/src/tunnels/control_server.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,6 @@ fn handle_challenge_issue(
10621062

10631063
let mut auth_state = auth_state.lock().unwrap();
10641064
if let AuthState::WaitingForChallenge(Some(s)) = &*auth_state {
1065-
println!("looking for token {}, got {:?}", s, params.token);
10661065
match &params.token {
10671066
Some(t) if s != t => return Err(CodeError::AuthChallengeBadToken.into()),
10681067
None => return Err(CodeError::AuthChallengeBadToken.into()),

extensions/emmet/package-lock.json

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

extensions/typescript-language-features/src/languageFeatures/copilotRelated.ts

Lines changed: 0 additions & 84 deletions
This file was deleted.

extensions/typescript-language-features/src/languageProvider.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ export default class LanguageProvider extends Disposable {
9191
import('./languageFeatures/sourceDefinition').then(provider => this._register(provider.register(this.client, this.commandManager))),
9292
import('./languageFeatures/tagClosing').then(provider => this._register(provider.register(selector, this.description, this.client))),
9393
import('./languageFeatures/typeDefinitions').then(provider => this._register(provider.register(selector, this.client))),
94-
import('./languageFeatures/copilotRelated').then(provider => this._register(provider.register(selector, this.client))),
9594
]);
9695
}
9796

extensions/typescript-language-features/src/typescriptService.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ interface StandardTsServerRequests {
7777
'getMoveToRefactoringFileSuggestions': [Proto.GetMoveToRefactoringFileSuggestionsRequestArgs, Proto.GetMoveToRefactoringFileSuggestions];
7878
'linkedEditingRange': [Proto.FileLocationRequestArgs, Proto.LinkedEditingRangeResponse];
7979
'mapCode': [Proto.MapCodeRequestArgs, Proto.MapCodeResponse];
80-
'copilotRelated': [Proto.FileRequestArgs, Proto.CopilotRelatedResponse];
8180
'getPasteEdits': [Proto.GetPasteEditsRequestArgs, Proto.GetPasteEditsResponse];
8281
'preparePasteEdits': [Proto.PreparePasteEditsRequestArgs, Proto.PreparePasteEditsResponse];
8382
}

resources/completions/bash/code

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ _@@APPNAME@@()
4949
--list-extensions --show-versions --install-extension
5050
--uninstall-extension --enable-proposed-api --verbose --log -s
5151
--status -p --performance --prof-startup --disable-extensions
52-
--disable-extension --inspect-extensions --update-extensions
52+
--disable-extension --inspect-extensions --update-extensions --download-extension
5353
--inspect-brk-extensions --disable-gpu' -- "$cur") )
5454
[[ $COMPREPLY == *= ]] && compopt -o nospace
5555
return

resources/completions/zsh/_code

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ arguments=(
2020
'--category[filters installed extension list by category, when using --list-extensions]'
2121
'--show-versions[show versions of installed extensions, when using --list-extensions]'
2222
'--install-extension[install an extension]:id or path:_files -g "*.vsix(-.)"'
23-
'--uninstall-extension[uninstall an extension]:id or path:_files -g "*.vsix(-.)"'
23+
'--uninstall-extension[uninstall an extension]:id'
2424
'--update-extensions[update the installed extensions]'
25+
'--download-extension[download an extension]:id'
2526
'--enable-proposed-api[enables proposed API features for extensions]::extension id: '
2627
'--verbose[print verbose output (implies --wait)]'
2728
'--log[log level to use]:level [info]:(critical error warn info debug trace off)'

src/vs/base/browser/markdownRenderer.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -556,8 +556,11 @@ export function renderStringAsPlaintext(string: IMarkdownString | string) {
556556
}
557557

558558
/**
559-
* Strips all markdown from `markdown`. For example `# Header` would be output as `Header`.
560-
* provide @param withCodeBlocks to retain code blocks
559+
* Strips all markdown from `markdown`
560+
*
561+
* For example `# Header` would be output as `Header`.
562+
*
563+
* @param withCodeBlocks Include the ``` of code blocks as well
561564
*/
562565
export function renderMarkdownAsPlaintext(markdown: IMarkdownString, withCodeBlocks?: boolean) {
563566
// values that are too long will freeze the UI
@@ -567,7 +570,10 @@ export function renderMarkdownAsPlaintext(markdown: IMarkdownString, withCodeBlo
567570
}
568571

569572
const html = marked.parse(value, { async: false, renderer: withCodeBlocks ? plainTextWithCodeBlocksRenderer.value : plainTextRenderer.value });
570-
return sanitizeRenderedMarkdown({ isTrusted: false }, html).toString().replace(/&(#\d+|[a-zA-Z]+);/g, m => unescapeInfo.get(m) ?? m);
573+
return sanitizeRenderedMarkdown({ isTrusted: false }, html)
574+
.toString()
575+
.replace(/&(#\d+|[a-zA-Z]+);/g, m => unescapeInfo.get(m) ?? m)
576+
.trim();
571577
}
572578

573579
const unescapeInfo = new Map<string, string>([
@@ -583,7 +589,7 @@ function createRenderer(): marked.Renderer {
583589
const renderer = new marked.Renderer();
584590

585591
renderer.code = ({ text }: marked.Tokens.Code): string => {
586-
return text;
592+
return escape(text);
587593
};
588594
renderer.blockquote = ({ text }: marked.Tokens.Blockquote): string => {
589595
return text + '\n';
@@ -622,7 +628,7 @@ function createRenderer(): marked.Renderer {
622628
return text;
623629
};
624630
renderer.codespan = ({ text }: marked.Tokens.Codespan): string => {
625-
return text;
631+
return escape(text);
626632
};
627633
renderer.br = (_: marked.Tokens.Br): string => {
628634
return '\n';
@@ -641,11 +647,12 @@ function createRenderer(): marked.Renderer {
641647
};
642648
return renderer;
643649
}
644-
const plainTextRenderer = new Lazy<marked.Renderer>((withCodeBlocks?: boolean) => createRenderer());
650+
const plainTextRenderer = new Lazy<marked.Renderer>(createRenderer);
651+
645652
const plainTextWithCodeBlocksRenderer = new Lazy<marked.Renderer>(() => {
646653
const renderer = createRenderer();
647654
renderer.code = ({ text }: marked.Tokens.Code): string => {
648-
return `\n\`\`\`\n${text}\n\`\`\`\n`;
655+
return `\n\`\`\`\n${escape(text)}\n\`\`\`\n`;
649656
};
650657
return renderer;
651658
});

0 commit comments

Comments
 (0)