mirror of
https://github.com/Microsoft/vscode
synced 2024-09-14 06:08:12 +00:00
Fix TS 4.3 compile errors
For https://github.com/microsoft/TypeScript/issues/43419 - Works around type assertions not catching a method can modify the type - Add more explicit typings
This commit is contained in:
parent
47256436d8
commit
4dc2d399c7
|
@ -325,12 +325,18 @@ suite('IndexTreeModel', () => {
|
|||
assert.strictEqual(list[1].collapsible, false);
|
||||
|
||||
model.splice([0, 0], 1, [], options);
|
||||
assert.strictEqual(list[0].collapsible, false);
|
||||
assert.strictEqual(list[1], undefined);
|
||||
{
|
||||
const [first, second] = list;
|
||||
assert.strictEqual(first.collapsible, false);
|
||||
assert.strictEqual(second, undefined);
|
||||
}
|
||||
|
||||
model.splice([0, 0], 0, [{ element: 1 }], options);
|
||||
assert.strictEqual(list[0].collapsible, true);
|
||||
assert.strictEqual(list[1].collapsible, false);
|
||||
{
|
||||
const [first, second] = list;
|
||||
assert.strictEqual(first.collapsible, true);
|
||||
assert.strictEqual(second.collapsible, false);
|
||||
}
|
||||
}));
|
||||
|
||||
test('expand', () => withSmartSplice(options => {
|
||||
|
|
|
@ -8,13 +8,13 @@ import { MultilineTokens2, SparseEncodedTokens, TokensStore2 } from 'vs/editor/c
|
|||
import { Range } from 'vs/editor/common/core/range';
|
||||
import { TextModel } from 'vs/editor/common/model/textModel';
|
||||
import { IIdentifiedSingleEditOperation } from 'vs/editor/common/model';
|
||||
import { MetadataConsts, TokenMetadata, FontStyle } from 'vs/editor/common/modes';
|
||||
import { MetadataConsts, TokenMetadata, FontStyle, ColorId } from 'vs/editor/common/modes';
|
||||
import { createTextModel } from 'vs/editor/test/common/editorTestUtils';
|
||||
import { LineTokens } from 'vs/editor/common/core/lineTokens';
|
||||
|
||||
suite('TokensStore', () => {
|
||||
|
||||
const SEMANTIC_COLOR = 5;
|
||||
const SEMANTIC_COLOR: ColorId = 5;
|
||||
|
||||
function parseTokensState(state: string[]): { text: string; tokens: MultilineTokens2; } {
|
||||
let text: string[] = [];
|
||||
|
|
|
@ -189,7 +189,7 @@ suite('Marker Service', () => {
|
|||
endLineNumber: 1,
|
||||
endColumn: 5,
|
||||
message: 'test',
|
||||
severity: 0,
|
||||
severity: 0 as MarkerSeverity,
|
||||
source: 'me'
|
||||
};
|
||||
let service = new markerService.MarkerService();
|
||||
|
|
|
@ -341,7 +341,7 @@ export class LinuxExternalTerminalService implements IExternalTerminalService {
|
|||
/**
|
||||
* tries to turn OS errors into more meaningful error messages
|
||||
*/
|
||||
function improveError(err: Error): Error {
|
||||
function improveError(err: Error & { errno?: string, path?: string }): Error {
|
||||
if ('errno' in err && err['errno'] === 'ENOENT' && 'path' in err && typeof err['path'] === 'string') {
|
||||
return new Error(nls.localize('ext.term.app.not.found', "can't find terminal application '{0}'", err['path']));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue