mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
strict null work in extHostTypes, #61543
This commit is contained in:
parent
a8838578af
commit
714b18d16c
|
@ -545,6 +545,7 @@
|
|||
"./vs/vscode.d.ts",
|
||||
"./vs/vscode.proposed.d.ts",
|
||||
"./vs/workbench/api/node/extHostExtensionActivator.ts",
|
||||
// "./vs/workbench/api/node/extHostTypes.ts",
|
||||
"./vs/workbench/api/shared/tasks.ts",
|
||||
"./vs/workbench/browser/actions/toggleActivityBarVisibility.ts",
|
||||
"./vs/workbench/browser/actions/toggleCenteredLayout.ts",
|
||||
|
@ -729,4 +730,4 @@
|
|||
"exclude": [
|
||||
"./typings/require-monaco.d.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -876,7 +876,7 @@ export interface DocumentSymbolProvider {
|
|||
provideDocumentSymbols(model: model.ITextModel, token: CancellationToken): ProviderResult<DocumentSymbol[]>;
|
||||
}
|
||||
|
||||
export type TextEdit = { range: IRange; text: string; eol?: model.EndOfLineSequence; } | { range: undefined; text: undefined; eol: model.EndOfLineSequence; };
|
||||
export type TextEdit = { range: IRange; text: string; eol?: model.EndOfLineSequence; };
|
||||
|
||||
/**
|
||||
* Interface used to format a model
|
||||
|
|
|
@ -425,8 +425,8 @@ export abstract class BaseEditorSimpleWorker {
|
|||
lastEol = eol;
|
||||
}
|
||||
|
||||
if (!range) {
|
||||
// eol-change only
|
||||
if (Range.isEmpty(range) && !text) {
|
||||
// empty change
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -463,7 +463,7 @@ export abstract class BaseEditorSimpleWorker {
|
|||
}
|
||||
|
||||
if (typeof lastEol === 'number') {
|
||||
result.push({ eol: lastEol, text: undefined, range: undefined });
|
||||
result.push({ eol: lastEol, text: '', range: { startLineNumber: 0, startColumn: 0, endLineNumber: 0, endColumn: 0 } });
|
||||
}
|
||||
|
||||
return Promise.resolve(result);
|
||||
|
|
4
src/vs/monaco.d.ts
vendored
4
src/vs/monaco.d.ts
vendored
|
@ -5148,10 +5148,6 @@ declare namespace monaco.languages {
|
|||
range: IRange;
|
||||
text: string;
|
||||
eol?: editor.EndOfLineSequence;
|
||||
} | {
|
||||
range: undefined;
|
||||
text: undefined;
|
||||
eol: editor.EndOfLineSequence;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -447,7 +447,7 @@ export class TextEdit {
|
|||
}
|
||||
|
||||
static setEndOfLine(eol: EndOfLine): TextEdit {
|
||||
let ret = new TextEdit(undefined, undefined);
|
||||
let ret = new TextEdit(new Range(new Position(0, 0), new Position(0, 0)), '');
|
||||
ret.newEol = eol;
|
||||
return ret;
|
||||
}
|
||||
|
@ -513,8 +513,8 @@ export interface IFileOperationOptions {
|
|||
|
||||
export interface IFileOperation {
|
||||
_type: 1;
|
||||
from: URI;
|
||||
to: URI;
|
||||
from?: URI;
|
||||
to?: URI;
|
||||
options?: IFileOperationOptions;
|
||||
}
|
||||
|
||||
|
@ -567,7 +567,7 @@ export class WorkspaceEdit implements vscode.WorkspaceEdit {
|
|||
for (let i = 0; i < this._edits.length; i++) {
|
||||
const element = this._edits[i];
|
||||
if (element._type === 2 && element.uri.toString() === uri.toString()) {
|
||||
this._edits[i] = undefined;
|
||||
this._edits[i] = undefined!; // will be coalesced down below
|
||||
}
|
||||
}
|
||||
this._edits = coalesce(this._edits);
|
||||
|
@ -606,8 +606,8 @@ export class WorkspaceEdit implements vscode.WorkspaceEdit {
|
|||
return values(textEdits);
|
||||
}
|
||||
|
||||
_allEntries(): ([URI, TextEdit[]] | [URI, URI, IFileOperationOptions])[] {
|
||||
let res: ([URI, TextEdit[]] | [URI, URI, IFileOperationOptions])[] = [];
|
||||
_allEntries(): ([URI, TextEdit[]] | [URI?, URI?, IFileOperationOptions?])[] {
|
||||
let res: ([URI, TextEdit[]] | [URI?, URI?, IFileOperationOptions?])[] = [];
|
||||
for (let edit of this._edits) {
|
||||
if (edit._type === 1) {
|
||||
res.push([edit.from, edit.to, edit.options]);
|
||||
|
@ -938,7 +938,7 @@ export class SymbolInformation {
|
|||
if (locationOrUri instanceof Location) {
|
||||
this.location = locationOrUri;
|
||||
} else if (rangeOrContainer instanceof Range) {
|
||||
this.location = new Location(locationOrUri, rangeOrContainer);
|
||||
this.location = new Location(locationOrUri!, rangeOrContainer);
|
||||
}
|
||||
|
||||
SymbolInformation.validate(this);
|
||||
|
@ -1934,12 +1934,14 @@ export class FunctionBreakpoint extends Breakpoint {
|
|||
export class DebugAdapterExecutable implements vscode.DebugAdapterExecutable {
|
||||
readonly command: string;
|
||||
readonly args: string[];
|
||||
readonly options?: vscode.DebugAdapterExecutableOptions;
|
||||
readonly env?: { [key: string]: string };
|
||||
readonly cwd?: string;
|
||||
|
||||
constructor(command: string, args: string[], options?: vscode.DebugAdapterExecutableOptions) {
|
||||
constructor(command: string, args?: string[], env?: { [key: string]: string }, cwd?: string) {
|
||||
this.command = command;
|
||||
this.args = args || [];
|
||||
this.options = options;
|
||||
this.args = args;
|
||||
this.env = env;
|
||||
this.cwd = cwd;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue