Merge branch 'master' into joh/cell-output

This commit is contained in:
Johannes Rieken
2020-09-28 09:08:53 +02:00
78 changed files with 1810 additions and 1498 deletions

View File

@@ -144,6 +144,7 @@ export type CommentThreadChanges = Partial<{
contextValue: string,
comments: modes.Comment[],
collapseState: modes.CommentThreadCollapsibleState;
readOnly: boolean;
}>;
export interface MainThreadCommentsShape extends IDisposable {

View File

@@ -219,6 +219,7 @@ type CommentThreadModification = Partial<{
contextValue: string | undefined,
comments: vscode.Comment[],
collapsibleState: vscode.CommentThreadCollapsibleState
readOnly: boolean;
}>;
export class ExtHostCommentThread implements vscode.CommentThread {
@@ -263,6 +264,19 @@ export class ExtHostCommentThread implements vscode.CommentThread {
return this._range;
}
private _readonly: boolean = false;
set readOnly(state: boolean) {
if (this._readonly !== state) {
this._readonly = state;
this.modifications.readOnly = state;
this._onDidUpdateCommentThread.fire();
}
}
get readOnly() {
return this._readonly;
}
private _label: string | undefined;
get label(): string | undefined {
@@ -387,6 +401,9 @@ export class ExtHostCommentThread implements vscode.CommentThread {
if (modified('collapsibleState')) {
formattedModifications.collapseState = convertToCollapsibleState(this._collapseState);
}
if (modified('readOnly')) {
formattedModifications.readOnly = this.readOnly;
}
this.modifications = {};
this._proxy.$updateCommentThread(

View File

@@ -506,7 +506,7 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme
const host: IExtensionActivationHost = {
folders: folders.map(folder => folder.uri),
forceUsingSearch: localWithRemote,
exists: (path) => this._hostUtils.exists(path),
exists: (uri) => this._hostUtils.exists(uri.fsPath),
checkExists: (folders, includes, token) => this._mainThreadWorkspaceProxy.$checkExists(folders, includes, token)
};

View File

@@ -338,7 +338,9 @@ export namespace MarkdownString {
}
export function to(value: htmlContent.IMarkdownString): vscode.MarkdownString {
return new htmlContent.MarkdownString(value.value, { isTrusted: value.isTrusted, supportThemeIcons: value.supportThemeIcons });
const result = new types.MarkdownString(value.value, value.supportThemeIcons);
result.isTrusted = value.isTrusted;
return result;
}
export function fromStrict(value: string | types.MarkdownString): undefined | string | htmlContent.IMarkdownString {

View File

@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as path from 'vs/base/common/path';
import * as resources from 'vs/base/common/resources';
import { URI, UriComponents } from 'vs/base/common/uri';
import { CancellationTokenSource, CancellationToken } from 'vs/base/common/cancellation';
import * as errors from 'vs/base/common/errors';
@@ -19,7 +19,7 @@ export interface IExtensionActivationHost {
readonly folders: readonly UriComponents[];
readonly forceUsingSearch: boolean;
exists(path: string): Promise<boolean>;
exists(uri: URI): Promise<boolean>;
checkExists(folders: readonly UriComponents[], includes: string[], token: CancellationToken): Promise<boolean>;
}
@@ -69,7 +69,7 @@ export function checkActivateWorkspaceContainsExtension(host: IExtensionActivati
async function _activateIfFileName(host: IExtensionActivationHost, fileName: string, activate: (activationEvent: string) => void): Promise<void> {
// find exact path
for (const uri of host.folders) {
if (await host.exists(path.join(URI.revive(uri).fsPath, fileName))) {
if (await host.exists(resources.joinPath(URI.revive(uri), fileName))) {
// the file was found
activate(`workspaceContains:${fileName}`);
return;