From e2bf52d77c869a1b13469280cc13d62967d49f57 Mon Sep 17 00:00:00 2001 From: Simon Graband Date: Tue, 4 May 2021 17:22:17 +0200 Subject: [PATCH] Transpile theia to es6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Transpiles theia to es6. To keep support of es5 based vscode extensions, the @es5ClassCompat tag was used. The tag was also applied to be used with theia es5 plugins. This is however yet to be tested. Contributed on behalf of STMicroelectronics Signed-off-by: Simon Graband Co-authored-by: Paul Maréchal --- configs/base.tsconfig.json | 2 +- .../src/generator/webpack-generator.ts | 20 ------ packages/core/src/browser/navigatable.ts | 4 +- packages/core/src/browser/saveable.ts | 4 +- .../core/src/browser/tree/tree-widget.tsx | 2 +- packages/monaco/src/typings/monaco/index.d.ts | 2 +- .../browser/plugin-contribution-handler.ts | 5 +- .../main/browser/view/tree-view-widget.tsx | 2 +- .../plugin-ext/src/plugin/command-registry.ts | 2 +- packages/plugin-ext/src/plugin/types-impl.ts | 70 +++++++++++++++---- packages/plugin/src/theia.d.ts | 40 +++++++++++ ...search-in-workspace-result-tree-widget.tsx | 2 +- .../browser/task-problem-matcher-registry.ts | 6 +- .../workspace-uri-contribution.spec.ts | 2 +- 14 files changed, 117 insertions(+), 46 deletions(-) diff --git a/configs/base.tsconfig.json b/configs/base.tsconfig.json index 7175a17cf0299..25840e002be94 100644 --- a/configs/base.tsconfig.json +++ b/configs/base.tsconfig.json @@ -14,7 +14,7 @@ "resolveJsonModule": true, "module": "commonjs", "moduleResolution": "node", - "target": "es5", + "target": "es6", "jsx": "react", "lib": [ "es6", diff --git a/dev-packages/application-manager/src/generator/webpack-generator.ts b/dev-packages/application-manager/src/generator/webpack-generator.ts index ed252f321fbe4..8bb652985100f 100644 --- a/dev-packages/application-manager/src/generator/webpack-generator.ts +++ b/dev-packages/application-manager/src/generator/webpack-generator.ts @@ -173,26 +173,6 @@ module.exports = { { test: /\\.plist$/, loader: "file-loader", - }, - { - test: /\\.js$/, - // include only es6 dependencies to transpile them to es5 classes - include: /vscode-ws-jsonrpc|vscode-jsonrpc|vscode-languageserver-protocol|vscode-languageserver-types/, - use: { - loader: 'babel-loader', - options: { - presets: ['@babel/preset-env'], - plugins: [ - // reuse runtime babel lib instead of generating it in each js file - '@babel/plugin-transform-runtime', - // ensure that classes are transpiled - '@babel/plugin-transform-classes' - ], - // see https://github.com/babel/babel/issues/8900#issuecomment-431240426 - sourceType: 'unambiguous', - cacheDirectory: true - } - } } ] }, diff --git a/packages/core/src/browser/navigatable.ts b/packages/core/src/browser/navigatable.ts index 49efbbadc5c42..9429dc76ee007 100644 --- a/packages/core/src/browser/navigatable.ts +++ b/packages/core/src/browser/navigatable.ts @@ -45,14 +45,14 @@ export namespace NavigatableWidget { return arg instanceof BaseWidget && Navigatable.is(arg); } export function* getAffected( - widgets: IterableIterator | ArrayLike, + widgets: Iterable, context: MaybeArray ): IterableIterator<[URI, T & NavigatableWidget]> { const uris = Array.isArray(context) ? context : [context]; return get(widgets, resourceUri => uris.some(uri => uri.isEqualOrParent(resourceUri))); } export function* get( - widgets: IterableIterator | ArrayLike, + widgets: Iterable, filter: (resourceUri: URI) => boolean = () => true ): IterableIterator<[URI, T & NavigatableWidget]> { for (const widget of widgets) { diff --git a/packages/core/src/browser/saveable.ts b/packages/core/src/browser/saveable.ts index ad4ca17f276f9..cea603bfaa8f2 100644 --- a/packages/core/src/browser/saveable.ts +++ b/packages/core/src/browser/saveable.ts @@ -161,11 +161,11 @@ export namespace SaveableWidget { export function is(widget: Widget | undefined): widget is SaveableWidget { return !!widget && 'closeWithoutSaving' in widget; } - export function getDirty(widgets: IterableIterator | ArrayLike): IterableIterator { + export function getDirty(widgets: Iterable): IterableIterator { return get(widgets, Saveable.isDirty); } export function* get( - widgets: IterableIterator | ArrayLike, + widgets: Iterable, filter: (widget: T) => boolean = () => true ): IterableIterator { for (const widget of widgets) { diff --git a/packages/core/src/browser/tree/tree-widget.tsx b/packages/core/src/browser/tree/tree-widget.tsx index 085f2a9f6df73..f510b9d73d4bb 100644 --- a/packages/core/src/browser/tree/tree-widget.tsx +++ b/packages/core/src/browser/tree/tree-widget.tsx @@ -976,7 +976,7 @@ export class TreeWidget extends ReactWidget implements StatefulWidget { decorations.push(node.decorationData); } if (this.decorations.has(node.id)) { - decorations.push(...this.decorations.get(node.id)); + decorations.push(...this.decorations.get(node.id) || []); } return decorations.sort(TreeDecoration.Data.comparePriority); } diff --git a/packages/monaco/src/typings/monaco/index.d.ts b/packages/monaco/src/typings/monaco/index.d.ts index a0f65fe3e9987..938a6798827af 100644 --- a/packages/monaco/src/typings/monaco/index.d.ts +++ b/packages/monaco/src/typings/monaco/index.d.ts @@ -525,7 +525,7 @@ declare module monaco.actions { * Retrieves all the registered menu items for the given menu. * @param menuId - see https://github.com/theia-ide/vscode/blob/standalone/0.20.x/src/vs/platform/actions/common/actions.ts#L67 */ - getMenuItems(menuId: 7 /* EditorContext */ | 8 /* EditorContextPeek */ | 25 /* MenubarSelectionMenu */): IMenuItem | ISubmenuItem[]; + getMenuItems(menuId: 7 /* EditorContext */ | 8 /* EditorContextPeek */ | 25 /* MenubarSelectionMenu */): Iterable | Iterable; } // https://github.com/theia-ide/vscode/blob/standalone/0.20.x/src/vs/platform/actions/common/actions.ts#L51 diff --git a/packages/plugin-ext/src/main/browser/plugin-contribution-handler.ts b/packages/plugin-ext/src/main/browser/plugin-contribution-handler.ts index 589c37cf1bc4f..eb57a0d1e48c3 100644 --- a/packages/plugin-ext/src/main/browser/plugin-contribution-handler.ts +++ b/packages/plugin-ext/src/main/browser/plugin-contribution-handler.ts @@ -296,8 +296,9 @@ export class PluginContributionHandler { } } - if (contributions.colors) { - pushContribution('colors', () => this.colors.register(...contributions.colors)); + const colors = contributions.colors; + if (colors) { + pushContribution('colors', () => this.colors.register(...colors)); } if (contributions.taskDefinitions) { diff --git a/packages/plugin-ext/src/main/browser/view/tree-view-widget.tsx b/packages/plugin-ext/src/main/browser/view/tree-view-widget.tsx index cfb5468717370..35275ea828201 100644 --- a/packages/plugin-ext/src/main/browser/view/tree-view-widget.tsx +++ b/packages/plugin-ext/src/main/browser/view/tree-view-widget.tsx @@ -281,7 +281,7 @@ export class TreeViewWidget extends TreeViewWelcomeWidget { }); const children = this.getCaption(node); - return React.createElement('div', attrs, ...children); + return React.createElement('div', attrs, children); } protected getCaption(node: TreeNode): React.ReactNode { diff --git a/packages/plugin-ext/src/plugin/command-registry.ts b/packages/plugin-ext/src/plugin/command-registry.ts index a5e877d93256f..93d283a1762e8 100644 --- a/packages/plugin-ext/src/plugin/command-registry.ts +++ b/packages/plugin-ext/src/plugin/command-registry.ts @@ -102,7 +102,7 @@ export class CommandRegistryImpl implements CommandRegistryExt { // Using the KnownCommand exclusions, convert the commands manually return KnownCommands.map(id, args, (mappedId: string, mappedArgs: any[] | undefined, mappedResult: KnownCommands.ConversionFunction) => { const mr: KnownCommands.ConversionFunction = mappedResult; - return this.proxy.$executeCommand(mappedId, ...mappedArgs).then((result: any) => { + return this.proxy.$executeCommand(mappedId, ...mappedArgs || []).then((result: any) => { if (!result) { return undefined; } diff --git a/packages/plugin-ext/src/plugin/types-impl.ts b/packages/plugin-ext/src/plugin/types-impl.ts index d12a97bb6dfa3..71f0aab2cef7f 100644 --- a/packages/plugin-ext/src/plugin/types-impl.ts +++ b/packages/plugin-ext/src/plugin/types-impl.ts @@ -24,14 +24,16 @@ import { UUID } from '@theia/core/shared/@phosphor/coreutils'; import { illegalArgument } from '../common/errors'; -import * as theia from '@theia/plugin'; +import type * as theia from '@theia/plugin'; import { URI } from '@theia/core/shared/vscode-uri'; import { relative } from '../common/paths-util'; import { startsWithIgnoreCase } from '@theia/core/lib/common/strings'; import { MarkdownString, isMarkdownString } from './markdown-string'; import { SymbolKind } from '../common/plugin-api-rpc-model'; import { FileSystemProviderErrorCode, markAsFileSystemProviderError } from '@theia/filesystem/lib/common/files'; +import { es5ClassCompat } from '../common/types'; +@es5ClassCompat export class Disposable { private disposable: undefined | (() => void); @@ -125,6 +127,7 @@ export enum SourceControlInputBoxValidationType { Information = 2 } +@es5ClassCompat export class ColorTheme implements theia.ColorTheme { constructor(public readonly kind: ColorThemeKind) { } } @@ -151,6 +154,7 @@ export namespace TextEditorSelectionChangeKind { } } +@es5ClassCompat export class Position { private _line: number; private _character: number; @@ -308,6 +312,7 @@ export class Position { } } +@es5ClassCompat export class Range { protected _start: Position; protected _end: Position; @@ -439,6 +444,7 @@ export class Range { } +@es5ClassCompat export class Selection extends Range { private _anchor: Position; private _active: Position; @@ -490,6 +496,7 @@ export enum EnvironmentVariableMutatorType { Prepend = 3 } +@es5ClassCompat export class SnippetString { static isSnippetString(thing: {}): thing is SnippetString { @@ -571,11 +578,13 @@ export class SnippetString { } } +@es5ClassCompat export class ThemeColor { constructor(public id: string) { } } +@es5ClassCompat export class ThemeIcon { static readonly File: ThemeIcon = new ThemeIcon('file'); @@ -634,6 +643,7 @@ export enum ConfigurationTarget { Memory } +@es5ClassCompat export class RelativePattern { base: string; @@ -664,6 +674,7 @@ export enum IndentAction { Outdent = 3 } +@es5ClassCompat export class TextEdit { protected _range: Range; @@ -772,6 +783,7 @@ export enum CompletionItemKind { TypeParameter = 24 } +@es5ClassCompat export class CompletionItem implements theia.CompletionItem { label: string; @@ -794,6 +806,7 @@ export class CompletionItem implements theia.CompletionItem { } } +@es5ClassCompat export class CompletionList { isIncomplete?: boolean; @@ -818,16 +831,7 @@ export enum DebugConsoleMode { MergeWithParent = 1 } -export class DiagnosticRelatedInformation { - location: Location; - message: string; - - constructor(location: Location, message: string) { - this.location = location; - this.message = message; - } -} - +@es5ClassCompat export class Location { uri: URI; range: Range; @@ -853,6 +857,17 @@ export class Location { } } +@es5ClassCompat +export class DiagnosticRelatedInformation { + location: Location; + message: string; + + constructor(location: Location, message: string) { + this.location = location; + this.message = message; + } +} + export enum DiagnosticTag { Unnecessary = 1, } @@ -861,6 +876,7 @@ export enum CompletionItemTag { Deprecated = 1, } +@es5ClassCompat export class Diagnostic { range: Range; message: string; @@ -888,6 +904,7 @@ export enum MarkerTag { Unnecessary = 1, } +@es5ClassCompat export class ParameterInformation { label: string | [number, number]; documentation?: string | MarkdownString; @@ -898,6 +915,7 @@ export class ParameterInformation { } } +@es5ClassCompat export class SignatureInformation { label: string; documentation?: string | MarkdownString; @@ -916,6 +934,7 @@ export enum SignatureHelpTriggerKind { ContentChange = 3, } +@es5ClassCompat export class SignatureHelp { signatures: SignatureInformation[]; activeSignature: number; @@ -926,6 +945,7 @@ export class SignatureHelp { } } +@es5ClassCompat export class Hover { public contents: MarkdownString[] | theia.MarkedString[]; @@ -955,6 +975,7 @@ export enum DocumentHighlightKind { Write = 2 } +@es5ClassCompat export class DocumentHighlight { public range: Range; @@ -971,6 +992,7 @@ export class DocumentHighlight { export type Definition = Location | Location[]; +@es5ClassCompat export class DocumentLink { range: Range; @@ -991,6 +1013,7 @@ export class DocumentLink { } } +@es5ClassCompat export class CodeLens { range: Range; @@ -1030,6 +1053,7 @@ export enum CodeActionTriggerKind { Automatic = 2, } +@es5ClassCompat export class CodeActionKind { private static readonly sep = '.'; @@ -1066,6 +1090,7 @@ export enum TextDocumentSaveReason { FocusOut = 3 } +@es5ClassCompat export class CodeAction { title: string; @@ -1118,6 +1143,7 @@ export interface FileTextEdit { metadata?: WorkspaceEditMetadata; } +@es5ClassCompat export class WorkspaceEdit implements theia.WorkspaceEdit { private _edits = new Array(); @@ -1230,6 +1256,7 @@ export class WorkspaceEdit implements theia.WorkspaceEdit { } } +@es5ClassCompat export class TreeItem { label?: string | theia.TreeItemLabel; @@ -1267,6 +1294,7 @@ export enum SymbolTag { Deprecated = 1 } +@es5ClassCompat export class SymbolInformation { static validate(candidate: SymbolInformation): void { @@ -1311,6 +1339,7 @@ export class SymbolInformation { } } +@es5ClassCompat export class DocumentSymbol { static validate(candidate: DocumentSymbol): void { @@ -1355,6 +1384,7 @@ export interface QuickInputButton { readonly tooltip?: string | undefined; } +@es5ClassCompat export class QuickInputButtons { static readonly Back: QuickInputButton = { iconPath: { @@ -1377,6 +1407,7 @@ export enum FileChangeType { Deleted = 3, } +@es5ClassCompat export class FileSystemError extends Error { static FileExists(messageOrUri?: string | URI): FileSystemError { @@ -1459,6 +1490,7 @@ export class ProgressOptions { this.location = location; } } + export class Progress { /** * Report a progress update. @@ -1484,6 +1516,7 @@ export enum ProgressLocation { Notification = 15 } +@es5ClassCompat export class ProcessExecution { private executionProcess: string; private arguments: string[]; @@ -1563,6 +1596,7 @@ export enum TaskRevealKind { Never = 3 } +@es5ClassCompat export class ShellExecution { private shellCommandLine: string; private shellCommand: string | theia.ShellQuotedString; @@ -1656,6 +1690,7 @@ export class CustomExecution { } } +@es5ClassCompat export class TaskGroup { private groupId: string; @@ -1699,6 +1734,7 @@ export enum TaskScope { Workspace = 2 } +@es5ClassCompat export class Task { private taskDefinition: theia.TaskDefinition; private taskScope: theia.TaskScope.Global | theia.TaskScope.Workspace | theia.WorkspaceFolder | undefined; @@ -1888,6 +1924,7 @@ export class Task2 extends Task { detail?: string; } +@es5ClassCompat export class DebugAdapterExecutable { /** * The command or path of the debug adapter executable. @@ -1924,6 +1961,7 @@ export class DebugAdapterExecutable { /** * Represents a debug adapter running as a socket based server. */ +@es5ClassCompat export class DebugAdapterServer { /** @@ -1958,6 +1996,7 @@ export enum LogLevel { /** * The base class of all breakpoint types. */ +@es5ClassCompat export class Breakpoint { /** * Is breakpoint enabled. @@ -1999,6 +2038,7 @@ export class Breakpoint { /** * A breakpoint specified by a source location. */ +@es5ClassCompat export class SourceBreakpoint extends Breakpoint { /** * The source and line position of this breakpoint. @@ -2017,6 +2057,7 @@ export class SourceBreakpoint extends Breakpoint { /** * A breakpoint specified by a function name. */ +@es5ClassCompat export class FunctionBreakpoint extends Breakpoint { /** * The name of the function to which this breakpoint is attached. @@ -2032,6 +2073,7 @@ export class FunctionBreakpoint extends Breakpoint { } } +@es5ClassCompat export class Color { readonly red: number; readonly green: number; @@ -2046,6 +2088,7 @@ export class Color { } } +@es5ClassCompat export class ColorInformation { range: Range; color: Color; @@ -2062,6 +2105,7 @@ export class ColorInformation { } } +@es5ClassCompat export class ColorPresentation { label: string; textEdit?: TextEdit; @@ -2081,6 +2125,7 @@ export enum ColorFormat { HSL = 2 } +@es5ClassCompat export class FoldingRange { start: number; end: number; @@ -2099,6 +2144,7 @@ export enum FoldingRangeKind { Region = 3 } +@es5ClassCompat export class SelectionRange { range: Range; @@ -2204,6 +2250,7 @@ export class CallHierarchyOutgoingCall { } } +@es5ClassCompat export class TimelineItem { timestamp: number; label: string; @@ -2234,7 +2281,6 @@ export class SemanticTokensLegend { function isStrArrayOrUndefined(arg: any): arg is string[] | undefined { return ((typeof arg === 'undefined') || (Array.isArray(arg) && arg.every(e => typeof e === 'string'))); } - export class SemanticTokensBuilder { private _prevLine: number; diff --git a/packages/plugin/src/theia.d.ts b/packages/plugin/src/theia.d.ts index d931e0f4660c4..c6ae0254b6353 100644 --- a/packages/plugin/src/theia.d.ts +++ b/packages/plugin/src/theia.d.ts @@ -21,6 +21,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import './theia-proposed'; +import { es5ClassCompat } from '../common/types'; /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable max-len */ @@ -32,6 +33,7 @@ declare module '@theia/plugin' { */ export const version: string; + @es5ClassCompat export class Disposable { constructor(func: () => void); @@ -225,6 +227,7 @@ declare module '@theia/plugin' { /** * Represents a line and character position. */ + @es5ClassCompat export class Position { /** @@ -335,6 +338,7 @@ declare module '@theia/plugin' { /** * Pair of two positions. */ + @es5ClassCompat export class Range { /** * Start position. @@ -420,6 +424,7 @@ declare module '@theia/plugin' { /** * Represents a text selection in an editor. */ + @es5ClassCompat export class Selection extends Range { /** @@ -460,6 +465,7 @@ declare module '@theia/plugin' { * A snippet string is a template which allows to insert text * and to control the editor cursor when insertion happens. */ + @es5ClassCompat export class SnippetString { /** @@ -714,6 +720,7 @@ declare module '@theia/plugin' { * The MarkdownString represents human readable text that supports formatting via the * markdown syntax. Standard markdown is supported, also tables, but no embedded html. */ + @es5ClassCompat export class MarkdownString { /** @@ -2557,6 +2564,7 @@ declare module '@theia/plugin' { * A reference to one of the workbench colors. * Using a theme color is preferred over a custom color as it gives theme authors and users the possibility to change the color. */ + @es5ClassCompat export class ThemeColor { /** * Creates a reference to a theme color. @@ -2568,6 +2576,7 @@ declare module '@theia/plugin' { * A reference to a named icon. Currently only [File](#ThemeIcon.File) and [Folder](#ThemeIcon.Folder) are supported. * Using a theme icon is preferred over a custom icon as it gives theme authors the possibility to change the icons. */ + @es5ClassCompat export class ThemeIcon { /** * Reference to a icon representing a file. The icon is taken from the current file icon theme or a placeholder icon. @@ -4456,6 +4465,7 @@ declare module '@theia/plugin' { /** * Represents a color theme. */ + @es5ClassCompat export interface ColorTheme { /** * The kind of this color theme: light, dark or high contrast. @@ -4466,6 +4476,7 @@ declare module '@theia/plugin' { /** * Predefined buttons for [QuickPick](#QuickPick) and [InputBox](#InputBox). */ + @es5ClassCompat export class QuickInputButtons { /** @@ -5194,6 +5205,7 @@ declare module '@theia/plugin' { * This class has factory methods for common error-cases, like `FileNotFound` when * a file or folder doesn't exist, use them like so: `throw vscode.FileSystemError.FileNotFound(someUri);` */ + @es5ClassCompat export class FileSystemError extends Error { /** @@ -6035,6 +6047,7 @@ declare module '@theia/plugin' { * relatively to a base path. The base path can either be an absolute file path * or a [workspace folder](#WorkspaceFolder). */ + @es5ClassCompat export class RelativePattern { /** @@ -6257,6 +6270,7 @@ declare module '@theia/plugin' { * Represents a parameter of a callable-signature. A parameter can * have a label and a doc-comment. */ + @es5ClassCompat export class ParameterInformation { /** @@ -6286,6 +6300,7 @@ declare module '@theia/plugin' { * can have a label, like a function-name, a doc-comment, and * a set of parameters. */ + @es5ClassCompat export class SignatureInformation { /** @@ -6319,6 +6334,7 @@ declare module '@theia/plugin' { * callable. There can be multiple signatures but only one * active and only one active parameter. */ + @es5ClassCompat export class SignatureHelp { /** @@ -6517,6 +6533,7 @@ declare module '@theia/plugin' { * Represents information about programming constructs like variables, classes, * interfaces etc. */ + @es5ClassCompat export class SymbolInformation { /** @@ -6570,6 +6587,7 @@ declare module '@theia/plugin' { * symbols can be hierarchical and they have two ranges: one that encloses its definition and one that points to * its most interesting range, e.g. the range of an identifier. */ + @es5ClassCompat export class DocumentSymbol { /** @@ -6637,6 +6655,7 @@ declare module '@theia/plugin' { /** * Represents a color in RGBA space. */ + @es5ClassCompat export class Color { /** @@ -6673,6 +6692,7 @@ declare module '@theia/plugin' { /** * Represents a color range from a document. */ + @es5ClassCompat export class ColorInformation { /** @@ -6702,6 +6722,7 @@ declare module '@theia/plugin' { * the constant `Red`, the hex-value `#ff0000`, or in rgba and hsla forms. In csharp other representations * apply, e.g `System.Drawing.Color.Red`. */ + @es5ClassCompat export class ColorPresentation { /** @@ -6764,6 +6785,7 @@ declare module '@theia/plugin' { * A line based folding range. To be valid, start and end line must a zero or larger and smaller than the number of lines in the document. * Invalid ranges will be ignored. */ + @es5ClassCompat export class FoldingRange { /** @@ -6874,6 +6896,7 @@ declare module '@theia/plugin' { * A text edit represents edits that should be applied * to a document. */ + @es5ClassCompat export class TextEdit { /** @@ -6995,6 +7018,7 @@ declare module '@theia/plugin' { * @see [CompletionItemProvider.provideCompletionItems](#CompletionItemProvider.provideCompletionItems) * @see [CompletionItemProvider.resolveCompletionItem](#CompletionItemProvider.resolveCompletionItem) */ + @es5ClassCompat export class CompletionItem { /** @@ -7128,6 +7152,7 @@ declare module '@theia/plugin' { * Represents a collection of [completion items](#CompletionItem) to be presented * in the editor. */ + @es5ClassCompat export class CompletionList { /** @@ -7198,6 +7223,7 @@ declare module '@theia/plugin' { * Represents a location inside a resource, such as a line * inside a text file. */ + @es5ClassCompat export class Location { /** @@ -7304,6 +7330,7 @@ declare module '@theia/plugin' { * Represents a diagnostic, such as a compiler error or warning. Diagnostic objects * are only valid in the scope of a file. */ + @es5ClassCompat export class Diagnostic { /** @@ -7439,6 +7466,7 @@ declare module '@theia/plugin' { * A CodeAction must set either [`edit`](#edit) and/or a [`command`](#command). * If both are supplied, the `edit` is applied first, then the command is executed. */ + @es5ClassCompat export class CodeAction { /** @@ -7594,6 +7622,7 @@ declare module '@theia/plugin' { * Code action kinds are used by VS Code for UI elements such as the refactoring context menu. Users * can also trigger code actions with a specific kind with the `editor.action.codeAction` command. */ + @es5ClassCompat export class CodeActionKind { /** * Empty kind. @@ -7751,6 +7780,7 @@ declare module '@theia/plugin' { * * Use the [applyEdit](#workspace.applyEdit)-function to apply a workspace edit. */ + @es5ClassCompat export class WorkspaceEdit { /** @@ -7952,6 +7982,7 @@ declare module '@theia/plugin' { * A document link is a range in a text document that links to an internal or external resource, like another * text document or a web site. */ + @es5ClassCompat export class DocumentLink { /** @@ -8713,6 +8744,7 @@ declare module '@theia/plugin' { * A hover represents additional information for a symbol or word. Hovers are * rendered in a tooltip-like widget. */ + @es5ClassCompat export class Hover { /** @@ -8782,6 +8814,7 @@ declare module '@theia/plugin' { * special attention. Usually a document highlight is visualized by changing * the background color of its range. */ + @es5ClassCompat export class DocumentHighlight { /** @@ -9288,6 +9321,7 @@ declare module '@theia/plugin' { /** * Represents a debug adapter running as a socket based server. */ + @es5ClassCompat export class DebugAdapterServer { /** @@ -9372,6 +9406,7 @@ declare module '@theia/plugin' { /** * The base class of all breakpoint types. */ + @es5ClassCompat export class Breakpoint { /** * The unique ID of the breakpoint. @@ -9400,6 +9435,7 @@ declare module '@theia/plugin' { /** * A breakpoint specified by a source location. */ + @es5ClassCompat export class SourceBreakpoint extends Breakpoint { /** * The source and line position of this breakpoint. @@ -9415,6 +9451,7 @@ declare module '@theia/plugin' { /** * A breakpoint specified by a function name. */ + @es5ClassCompat export class FunctionBreakpoint extends Breakpoint { /** * The name of the function to which this breakpoint is attached. @@ -9789,6 +9826,7 @@ declare module '@theia/plugin' { Workspace = 2 } + @es5ClassCompat export class TaskGroup { /** The clean task group */ @@ -9864,6 +9902,7 @@ declare module '@theia/plugin' { showReuseMessage?: boolean; } + @es5ClassCompat export class Task { /** @@ -10475,6 +10514,7 @@ declare module '@theia/plugin' { * A selection range represents a part of a selection hierarchy. A selection range * may have a parent selection range that contains it. */ + @es5ClassCompat export class SelectionRange { /** diff --git a/packages/search-in-workspace/src/browser/search-in-workspace-result-tree-widget.tsx b/packages/search-in-workspace/src/browser/search-in-workspace-result-tree-widget.tsx index b2e414c094765..a6bda829812ca 100644 --- a/packages/search-in-workspace/src/browser/search-in-workspace-result-tree-widget.tsx +++ b/packages/search-in-workspace/src/browser/search-in-workspace-result-tree-widget.tsx @@ -1075,7 +1075,7 @@ export class SearchInWorkspaceResultTreeWidget extends TreeWidget { protected getExcludeGlobs(excludeOptions?: string[]): string[] { const excludePreferences = this.filesystemPreferences['files.exclude']; const excludePreferencesGlobs = Object.keys(excludePreferences).filter(key => !!excludePreferences[key]); - return [...new Set([...excludePreferencesGlobs, ...excludeOptions])]; + return [...new Set([...excludePreferencesGlobs, ...excludeOptions || []])]; } /** diff --git a/packages/task/src/browser/task-problem-matcher-registry.ts b/packages/task/src/browser/task-problem-matcher-registry.ts index 179639812d496..651ad7ba60a78 100644 --- a/packages/task/src/browser/task-problem-matcher-registry.ts +++ b/packages/task/src/browser/task-problem-matcher-registry.ts @@ -144,7 +144,11 @@ export class ProblemMatcherRegistry { patterns.push(ProblemPattern.fromProblemPatternContribution(matcher.pattern)); } } else if (baseMatcher) { - patterns.push(...baseMatcher.pattern); + if (Array.isArray(baseMatcher.pattern)) { + patterns.push(...baseMatcher.pattern); + } else { + patterns.push(baseMatcher.pattern); + } } let deprecated: boolean | undefined = matcher.deprecated; diff --git a/packages/workspace/src/browser/workspace-uri-contribution.spec.ts b/packages/workspace/src/browser/workspace-uri-contribution.spec.ts index 22b524d2e4cd4..46661f03372af 100644 --- a/packages/workspace/src/browser/workspace-uri-contribution.spec.ts +++ b/packages/workspace/src/browser/workspace-uri-contribution.spec.ts @@ -46,7 +46,7 @@ beforeEach(() => { container = new Container(); container.bind(ApplicationShell).toConstantValue({ currentChanged: new Signal({}), - widgets: () => [] + widgets: [] // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any); container.bind(WidgetManager).toConstantValue({