mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-28 17:23:19 -05:00
Merge from vscode 3a6dcb42008d509900b3a3b2d695564eeb4dbdac (#5098)
This commit is contained in:
@@ -40,7 +40,7 @@ import { OcticonLabel } from 'vs/base/browser/ui/octiconLabel/octiconLabel';
|
||||
import { normalizeGitHubUrl } from 'vs/code/electron-browser/issue/issueReporterUtil';
|
||||
import { Button } from 'vs/base/browser/ui/button/button';
|
||||
import { withUndefinedAsNull } from 'vs/base/common/types';
|
||||
import { SystemInfo } from 'vs/platform/diagnostics/common/diagnosticsService';
|
||||
import { SystemInfo, isRemoteDiagnosticError } from 'vs/platform/diagnostics/common/diagnosticsService';
|
||||
|
||||
const MAX_URL_LENGTH = platform.isWindows ? 2081 : 5400;
|
||||
|
||||
@@ -940,15 +940,24 @@ export class IssueReporter extends Disposable {
|
||||
</table>`;
|
||||
|
||||
systemInfo.remoteData.forEach(remote => {
|
||||
renderedData += `
|
||||
<hr>
|
||||
<table>
|
||||
<tr><td>Remote</td><td>${remote.hostName}</td></tr>
|
||||
<tr><td>OS</td><td>${remote.machineInfo.os}</td></tr>
|
||||
<tr><td>CPUs</td><td>${remote.machineInfo.cpus}</td></tr>
|
||||
<tr><td>Memory (System)</td><td>${remote.machineInfo.memory}</td></tr>
|
||||
<tr><td>VM</td><td>${remote.machineInfo.vmHint}</td></tr>
|
||||
</table>`;
|
||||
if (isRemoteDiagnosticError(remote)) {
|
||||
renderedData += `
|
||||
<hr>
|
||||
<table>
|
||||
<tr><td>Remote</td><td>${remote.hostName}</td></tr>
|
||||
<tr><td></td><td>${remote.errorMessage}</td></tr>
|
||||
</table>`;
|
||||
} else {
|
||||
renderedData += `
|
||||
<hr>
|
||||
<table>
|
||||
<tr><td>Remote</td><td>${remote.hostName}</td></tr>
|
||||
<tr><td>OS</td><td>${remote.machineInfo.os}</td></tr>
|
||||
<tr><td>CPUs</td><td>${remote.machineInfo.cpus}</td></tr>
|
||||
<tr><td>Memory (System)</td><td>${remote.machineInfo.memory}</td></tr>
|
||||
<tr><td>VM</td><td>${remote.machineInfo.vmHint}</td></tr>
|
||||
</table>`;
|
||||
}
|
||||
});
|
||||
|
||||
target.innerHTML = renderedData;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
import { assign } from 'vs/base/common/objects';
|
||||
import { IssueType, ISettingSearchResult, IssueReporterExtensionData } from 'vs/platform/issue/common/issue';
|
||||
import { SystemInfo } from 'vs/platform/diagnostics/common/diagnosticsService';
|
||||
import { SystemInfo, isRemoteDiagnosticError } from 'vs/platform/diagnostics/common/diagnosticsService';
|
||||
|
||||
export interface IssueReporterData {
|
||||
issueType: IssueType;
|
||||
@@ -76,7 +76,8 @@ ${this.getInfos()}
|
||||
|
||||
private getRemoteOSes(): string {
|
||||
if (this._data.systemInfo && this._data.systemInfo.remoteData.length) {
|
||||
return this._data.systemInfo.remoteData.map(remote => `Remote OS version: ${remote.machineInfo.os}`).join('\n') + '\n';
|
||||
return this._data.systemInfo.remoteData
|
||||
.map(remote => isRemoteDiagnosticError(remote) ? remote.errorMessage : `Remote OS version: ${remote.machineInfo.os}`).join('\n') + '\n';
|
||||
}
|
||||
|
||||
return '';
|
||||
@@ -169,7 +170,10 @@ ${this.getInfos()}
|
||||
|VM|${this._data.systemInfo.vmHint}|`;
|
||||
|
||||
this._data.systemInfo.remoteData.forEach(remote => {
|
||||
md += `
|
||||
if (isRemoteDiagnosticError(remote)) {
|
||||
md += `\n\n${remote.errorMessage}`;
|
||||
} else {
|
||||
md += `
|
||||
|
||||
|Item|Value|
|
||||
|---|---|
|
||||
@@ -178,6 +182,7 @@ ${this.getInfos()}
|
||||
|CPUs|${remote.machineInfo.cpus}|
|
||||
|Memory (System)|${remote.machineInfo.memory}|
|
||||
|VM|${remote.machineInfo.vmHint}|`;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -3,9 +3,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<!-- // {{SQL CARBON EDIT}}
|
||||
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src 'self' https: data: vscode-remote:; media-src 'none'; child-src 'self'; object-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; connect-src 'self' https:; font-src 'self' https:;">
|
||||
-->
|
||||
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src 'self' https: data: vscode-remote:; media-src 'none'; child-src 'self'; object-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; connect-src 'self' https:; font-src 'self' https: vscode-remote:;">
|
||||
</head>
|
||||
<body class="vs-dark" aria-label="">
|
||||
</body>
|
||||
|
||||
@@ -1190,46 +1190,62 @@ export class WindowsManager implements IWindowsMainService {
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure we are not asked to open a workspace or folder that is already opened
|
||||
if (cliArgs.length && cliArgs.some(path => !!findWindowOnWorkspaceOrFolderUri(WindowsManager.WINDOWS, URI.file(path)))) {
|
||||
cliArgs = [];
|
||||
if (!Array.isArray(extensionDevelopmentPath)) {
|
||||
extensionDevelopmentPath = [extensionDevelopmentPath];
|
||||
}
|
||||
|
||||
if (folderUris.length && folderUris.some(uri => !!findWindowOnWorkspaceOrFolderUri(WindowsManager.WINDOWS, this.argToUri(uri)))) {
|
||||
folderUris = [];
|
||||
let authority = '';
|
||||
for (let p of extensionDevelopmentPath) {
|
||||
if (p.match(/^[a-zA-Z][a-zA-Z0-9\+\-\.]+:/)) {
|
||||
const url = URI.parse(p);
|
||||
if (url.scheme === Schemas.vscodeRemote) {
|
||||
if (authority) {
|
||||
if (url.authority !== authority) {
|
||||
this.logService.error('more than one extension development path authority');
|
||||
}
|
||||
} else {
|
||||
authority = url.authority;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (fileUris.length && fileUris.some(uri => !!findWindowOnWorkspaceOrFolderUri(WindowsManager.WINDOWS, this.argToUri(uri)))) {
|
||||
fileUris = [];
|
||||
}
|
||||
// Make sure that we do not try to open:
|
||||
// - a workspace or folder that is already opened
|
||||
// - a workspace or file that has a different authority as the extension development.
|
||||
|
||||
cliArgs = cliArgs.filter(path => {
|
||||
const uri = URI.file(path);
|
||||
if (!!findWindowOnWorkspaceOrFolderUri(WindowsManager.WINDOWS, uri)) {
|
||||
return false;
|
||||
}
|
||||
return uri.authority === authority;
|
||||
});
|
||||
|
||||
folderUris = folderUris.filter(uri => {
|
||||
const u = this.argToUri(uri);
|
||||
if (!!findWindowOnWorkspaceOrFolderUri(WindowsManager.WINDOWS, u)) {
|
||||
return false;
|
||||
}
|
||||
return u ? u.authority === authority : false;
|
||||
});
|
||||
|
||||
fileUris = fileUris.filter(uri => {
|
||||
const u = this.argToUri(uri);
|
||||
if (!!findWindowOnWorkspaceOrFolderUri(WindowsManager.WINDOWS, u)) {
|
||||
return false;
|
||||
}
|
||||
return u ? u.authority === authority : false;
|
||||
});
|
||||
|
||||
openConfig.cli._ = cliArgs;
|
||||
openConfig.cli['folder-uri'] = folderUris;
|
||||
openConfig.cli['file-uri'] = fileUris;
|
||||
|
||||
if (Array.isArray(extensionDevelopmentPath)) {
|
||||
let authority: string | undefined = undefined;
|
||||
for (let p of extensionDevelopmentPath) {
|
||||
const match = p.match(/^vscode-remote:\/\/([^\/]+)/);
|
||||
if (match) {
|
||||
const auth = URI.parse(p).authority;
|
||||
if (authority) {
|
||||
if (auth !== authority) {
|
||||
console.log('more than one authority');
|
||||
}
|
||||
} else {
|
||||
authority = auth;
|
||||
}
|
||||
}
|
||||
}
|
||||
// if there are no files or folders cli args left, use the "remote" cli argument
|
||||
if (!cliArgs.length && !folderUris.length && !fileUris.length) {
|
||||
if (authority) {
|
||||
openConfig.cli['remote'] = authority;
|
||||
}
|
||||
|
||||
} else {
|
||||
const match = extensionDevelopmentPath.match(/^vscode-remote:\/\/([^\/]+)/);
|
||||
if (match) {
|
||||
openConfig.cli['remote'] = URI.parse(extensionDevelopmentPath).authority;
|
||||
openConfig.cli.remote = authority;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1581,7 +1597,8 @@ export class WindowsManager implements IWindowsMainService {
|
||||
cli = { ...cli, remote };
|
||||
}
|
||||
const forceReuseWindow = options && options.reuseWindow;
|
||||
return this.open({ context, cli, forceEmpty: true, forceReuseWindow });
|
||||
const forceNewWindow = !forceReuseWindow;
|
||||
return this.open({ context, cli, forceEmpty: true, forceNewWindow, forceReuseWindow });
|
||||
}
|
||||
|
||||
openNewTabbedWindow(context: OpenContext): ICodeWindow[] {
|
||||
|
||||
Reference in New Issue
Block a user