mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 03:29:00 +01:00
Merge branch 'master' into joh/cell-output
This commit is contained in:
@@ -144,6 +144,7 @@ export type CommentThreadChanges = Partial<{
|
||||
contextValue: string,
|
||||
comments: modes.Comment[],
|
||||
collapseState: modes.CommentThreadCollapsibleState;
|
||||
readOnly: boolean;
|
||||
}>;
|
||||
|
||||
export interface MainThreadCommentsShape extends IDisposable {
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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)
|
||||
};
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user