mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 03:54:24 +01:00
Merge remote-tracking branch 'origin/master' into alex/semantic-exploration
This commit is contained in:
@@ -66,8 +66,8 @@ export interface ShellExecutionDTO {
|
||||
options?: ShellExecutionOptionsDTO;
|
||||
}
|
||||
|
||||
export interface CustomExecution2DTO {
|
||||
customExecution: 'customExecution2';
|
||||
export interface CustomExecutionDTO {
|
||||
customExecution: 'customExecution';
|
||||
}
|
||||
|
||||
export interface TaskSourceDTO {
|
||||
@@ -84,11 +84,12 @@ export interface TaskHandleDTO {
|
||||
export interface TaskDTO {
|
||||
_id: string;
|
||||
name?: string;
|
||||
execution: ProcessExecutionDTO | ShellExecutionDTO | CustomExecution2DTO | undefined;
|
||||
execution: ProcessExecutionDTO | ShellExecutionDTO | CustomExecutionDTO | undefined;
|
||||
definition: TaskDefinitionDTO;
|
||||
isBackground?: boolean;
|
||||
source: TaskSourceDTO;
|
||||
group?: string;
|
||||
detail?: string;
|
||||
presentationOptions?: TaskPresentationOptionsDTO;
|
||||
problemMatchers: string[];
|
||||
hasDefinedMatchers: boolean;
|
||||
|
||||
@@ -7,6 +7,7 @@ import { URI } from 'vs/base/common/uri';
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
export interface WebviewInitData {
|
||||
readonly isExtensionDevelopmentDebug: boolean;
|
||||
readonly webviewResourceRoot: string;
|
||||
readonly webviewCspSource: string;
|
||||
}
|
||||
@@ -17,7 +18,13 @@ export function asWebviewUri(
|
||||
resource: vscode.Uri,
|
||||
): vscode.Uri {
|
||||
const uri = initData.webviewResourceRoot
|
||||
.replace('{{resource}}', resource.toString().replace(/^\S+?:/, ''))
|
||||
// Make sure we preserve the scheme of the resource but convert it into a normal path segment
|
||||
// The scheme is important as we need to know if we are requesting a local or a remote resource.
|
||||
.replace('{{resource}}', resource.scheme + withoutScheme(resource))
|
||||
.replace('{{uuid}}', uuid);
|
||||
return URI.parse(uri);
|
||||
}
|
||||
|
||||
function withoutScheme(resource: vscode.Uri): string {
|
||||
return resource.toString().replace(/^\S+?:/, '');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user