未验证 提交 663a049f 编写于 作者: M Miguel Solorio 提交者: GitHub

Merge branch 'master' into aasim/fix/checkboxOutline

......@@ -64,6 +64,11 @@
"body": ["1. ${1:first}", "2. ${2:second}", "3. ${3:third}", "$0"],
"description": "Insert ordered list"
},
"Insert definition list": {
"prefix": "definition list",
"body": ["${1:term}", ": ${2:definition}", "$0"],
"description": "Insert definition list"
},
"Insert horizontal rule": {
"prefix": "horizontal rule",
"body": "----------\n",
......@@ -83,5 +88,5 @@
"prefix": "strikethrough",
"body": "~~${1:${TM_SELECTED_TEXT}}~~",
"description": "Insert strikethrough"
}
},
}
......@@ -23,7 +23,7 @@ export class ReferencesCodeLens extends vscode.CodeLens {
}
}
export abstract class TypeScriptBaseCodeLensProvider implements vscode.CodeLensProvider {
export abstract class TypeScriptBaseCodeLensProvider implements vscode.CodeLensProvider<ReferencesCodeLens> {
public static readonly cancelledCommand: vscode.Command = {
// Cancellation is not an error. Just show nothing until we can properly re-compute the code lens
......@@ -47,7 +47,7 @@ export abstract class TypeScriptBaseCodeLensProvider implements vscode.CodeLensP
return this.onDidChangeCodeLensesEmitter.event;
}
async provideCodeLenses(document: vscode.TextDocument, token: vscode.CancellationToken): Promise<vscode.CodeLens[]> {
async provideCodeLenses(document: vscode.TextDocument, token: vscode.CancellationToken): Promise<ReferencesCodeLens[]> {
const filepath = this.client.toOpenedFilePath(document);
if (!filepath) {
return [];
......
......@@ -19,11 +19,9 @@ const localize = nls.loadMessageBundle();
export default class TypeScriptImplementationsCodeLensProvider extends TypeScriptBaseCodeLensProvider {
public async resolveCodeLens(
inputCodeLens: vscode.CodeLens,
codeLens: ReferencesCodeLens,
token: vscode.CancellationToken,
): Promise<vscode.CodeLens> {
const codeLens = inputCodeLens as ReferencesCodeLens;
const args = typeConverters.Position.toFileLocationRequestArgs(codeLens.file, codeLens.range.start);
const response = await this.client.execute('implementation', args, token, { lowPriority: true, cancelOnResourceChange: codeLens.document });
if (response.type !== 'response' || !response.body) {
......
......@@ -26,8 +26,7 @@ export class TypeScriptReferencesCodeLensProvider extends TypeScriptBaseCodeLens
super(client, _cachedResponse);
}
public async resolveCodeLens(inputCodeLens: vscode.CodeLens, token: vscode.CancellationToken): Promise<vscode.CodeLens> {
const codeLens = inputCodeLens as ReferencesCodeLens;
public async resolveCodeLens(codeLens: ReferencesCodeLens, token: vscode.CancellationToken): Promise<vscode.CodeLens> {
const args = typeConverters.Position.toFileLocationRequestArgs(codeLens.file, codeLens.range.start);
const response = await this.client.execute('references', args, token, {
lowPriority: true,
......@@ -42,12 +41,9 @@ export class TypeScriptReferencesCodeLensProvider extends TypeScriptBaseCodeLens
}
const locations = response.body.refs
.filter(reference => !reference.isDefinition)
.map(reference =>
typeConverters.Location.fromTextSpan(this.client.toResource(reference.file), reference))
.filter(location =>
// Exclude original definition from references
!(location.uri.toString() === codeLens.document.toString() &&
location.range.start.isEqual(codeLens.range.start)));
typeConverters.Location.fromTextSpan(this.client.toResource(reference.file), reference));
codeLens.command = {
title: this.getCodeLensLabel(locations),
......
......@@ -225,7 +225,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IVerticalSashL
if (this._isVisible) {
let globalBufferTerm = await this._controller.getGlobalBufferTerm();
if (globalBufferTerm && globalBufferTerm !== this._state.searchString) {
this._state.change({ searchString: globalBufferTerm }, true);
this._state.change({ searchString: globalBufferTerm }, false);
this._findInput.select();
}
}
......
......@@ -84,7 +84,7 @@ export function getReindentEditOperations(model: ITextModel, startLineNumber: nu
}
if (currentLineText !== adjustedLineContent) {
indentEdits.push(EditOperation.replace(new Selection(startLineNumber, 1, startLineNumber, oldIndentation.length + 1), TextModel.normalizeIndentation(globalIndent, indentSize, insertSpaces)));
indentEdits.push(EditOperation.replaceMove(new Selection(startLineNumber, 1, startLineNumber, oldIndentation.length + 1), TextModel.normalizeIndentation(globalIndent, indentSize, insertSpaces)));
}
} else {
globalIndent = strings.getLeadingWhitespace(currentLineText);
......@@ -115,7 +115,7 @@ export function getReindentEditOperations(model: ITextModel, startLineNumber: nu
}
if (oldIndentation !== idealIndentForNextLine) {
indentEdits.push(EditOperation.replace(new Selection(lineNumber, 1, lineNumber, oldIndentation.length + 1), TextModel.normalizeIndentation(idealIndentForNextLine, indentSize, insertSpaces)));
indentEdits.push(EditOperation.replaceMove(new Selection(lineNumber, 1, lineNumber, oldIndentation.length + 1), TextModel.normalizeIndentation(idealIndentForNextLine, indentSize, insertSpaces)));
}
// calculate idealIndentForNextLine
......
......@@ -6860,6 +6860,21 @@ declare module 'vscode' {
* @param options Defines if existing files should be overwritten.
*/
copy(source: Uri, target: Uri, options?: { overwrite?: boolean }): Thenable<void>;
/**
* Check if a given file system supports writing files.
*
* Keep in mind that just because a file system supports writing, that does
* not mean that writes will always succeed. There may be permissions issues
* or other errors that prevent writing a file.
*
* @param scheme The scheme of the filesystem, for example `file` or `git`.
*
* @return `true` if the file system supports writing, `false` if it does not
* support writing (i.e. it is readonly), and `undefined` if VS Code does not
* know about the filesystem.
*/
isWritableFileSystem(scheme: string): boolean | undefined;
}
/**
......
......@@ -2141,28 +2141,6 @@ declare module 'vscode' {
}
//#endregion
//#region https://github.com/microsoft/vscode/issues/91697
export interface FileSystem {
/**
* Check if a given file system supports writing files.
*
* Keep in mind that just because a file system supports writing, that does
* not mean that writes will always succeed. There may be permissions issues
* or other errors that prevent writing a file.
*
* @param scheme The scheme of the filesystem, for example `file` or `git`.
*
* @return `true` if the file system supports writing, `false` if it does not
* support writing (i.e. it is readonly), and `undefined` if VS Code does not
* know about the filesystem.
*/
isWritableFileSystem(scheme: string): boolean | undefined;
}
//#endregion
//#region https://github.com/microsoft/vscode/issues/108929 FoldingRangeProvider.onDidChangeFoldingRanges @aeschli
export interface FoldingRangeProvider2 extends FoldingRangeProvider {
......
......@@ -355,7 +355,7 @@ export class DebugEditorContribution implements IDebugEditorContribution {
}
private hideHoverWidget(): void {
if (!this.hideHoverScheduler.isScheduled() && this.hoverWidget.isVisible()) {
if (!this.hideHoverScheduler.isScheduled() && this.hoverWidget.willBeVisible()) {
this.hideHoverScheduler.schedule();
}
this.showHoverScheduler.cancel();
......
......@@ -31,7 +31,7 @@ import { coalesce } from 'vs/base/common/arrays';
import { IAsyncDataSource } from 'vs/base/browser/ui/tree/tree';
import { VariablesRenderer } from 'vs/workbench/contrib/debug/browser/variablesView';
import { EvaluatableExpressionProviderRegistry } from 'vs/editor/common/modes';
import { CancellationToken } from 'vs/base/common/cancellation';
import { CancellationTokenSource } from 'vs/base/common/cancellation';
const $ = dom.$;
......@@ -70,6 +70,7 @@ export class DebugHoverWidget implements IContentWidget {
allowEditorOverflow = true;
private _isVisible: boolean;
private showCancellationSource?: CancellationTokenSource;
private domNode!: HTMLElement;
private tree!: AsyncDataTree<IExpression, IExpression, any>;
private showAtPosition: Position | null;
......@@ -161,13 +162,17 @@ export class DebugHoverWidget implements IContentWidget {
}
isHovered(): boolean {
return this.domNode.matches(':hover');
return !!this.domNode?.matches(':hover');
}
isVisible(): boolean {
return this._isVisible;
}
willBeVisible(): boolean {
return !!this.showCancellationSource;
}
getId(): string {
return DebugHoverWidget.ID;
}
......@@ -177,6 +182,8 @@ export class DebugHoverWidget implements IContentWidget {
}
async showAt(range: Range, focus: boolean): Promise<void> {
this.showCancellationSource?.cancel();
const cancellationSource = this.showCancellationSource = new CancellationTokenSource();
const session = this.debugService.getViewModel().focusedSession;
if (!session || !this.editor.hasModel()) {
......@@ -193,7 +200,7 @@ export class DebugHoverWidget implements IContentWidget {
const supports = EvaluatableExpressionProviderRegistry.ordered(model);
const promises = supports.map(support => {
return Promise.resolve(support.provideEvaluatableExpression(model, pos, CancellationToken.None)).then(expression => {
return Promise.resolve(support.provideEvaluatableExpression(model, pos, cancellationSource.token)).then(expression => {
return expression;
}, err => {
//onUnexpectedExternalError(err);
......@@ -236,7 +243,7 @@ export class DebugHoverWidget implements IContentWidget {
}
}
if (!expression || (expression instanceof Expression && !expression.available)) {
if (cancellationSource.token.isCancellationRequested || !expression || (expression instanceof Expression && !expression.available)) {
this.hide();
return;
}
......@@ -315,6 +322,11 @@ export class DebugHoverWidget implements IContentWidget {
hide(): void {
if (this.showCancellationSource) {
this.showCancellationSource.cancel();
this.showCancellationSource = undefined;
}
if (!this._isVisible) {
return;
}
......
......@@ -263,6 +263,8 @@ export class ExecutableDebugAdapter extends StreamDebugAdapter {
channel.append(sanitize(data));
}
});
} else {
this.serverProcess.stderr!.resume();
}
// finally connect to the DA
......
......@@ -1589,7 +1589,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
this.modelService, this.configurationResolverService, this.telemetryService,
this.contextService, this.environmentService,
AbstractTaskService.OutputChannelId, this.fileService, this.terminalInstanceService,
this.pathService, this.viewDescriptorService, this.logService,
this.pathService, this.viewDescriptorService, this.logService, this.configurationService,
(workspaceFolder: IWorkspaceFolder | undefined) => {
if (workspaceFolder) {
return this.getTaskSystemInfo(workspaceFolder.uri.scheme);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册