Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yarn upgrade
Browse files Browse the repository at this point in the history
Upgrade all our dependencies, according to our already specified ranges.

I had to tigthen some constraints because the latest version of some
packages cause issues. Notably, the typescript compiler has an issue on
3.6.3 but not 3.5.3, so I constrained it such as it wouldn't ever match
the version that causes issues.

In the long run, we should be more careful with the version ranges we
use, especially with runtime dependencies.

Signed-off-by: Paul Maréchal <paul.marechal@ericsson.com>
paul-marechal committed Nov 12, 2019
1 parent 8f11551 commit 10f1485
Showing 31 changed files with 3,585 additions and 2,151 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ cache:
# All directories need to be listed here, because Travis does not support globs.
# Auto generated by scripts/prepare-travis
# start_cache_directories
- /tmp/vscode-ripgrep-cache-1.2.4
- /tmp/vscode-ripgrep-cache-1.5.7
- dev-packages/application-manager/node_modules
- dev-packages/application-package/node_modules
- dev-packages/electron/node_modules
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@
"@types/node": "~10.3.6",
"@types/sinon": "^2.3.5",
"@types/temp": "^0.8.29",
"@types/webdriverio": "^4.7.0",
"@types/uuid": "^3.4.3",
"@types/webdriverio": "^4.7.0",
"chai": "^4.1.0",
"chai-string": "^1.4.0",
"concurrently": "^3.5.0",
@@ -38,7 +38,7 @@
"tslint-language-service": "^0.9.9",
"typedoc": "^0.15.0-0",
"typedoc-plugin-external-module-map": "^1.0.0",
"typescript": "^3.1.3",
"typescript": "~3.5.3",
"uuid": "^3.2.1",
"wdio-mocha-framework": "0.6.4",
"wdio-selenium-standalone-service": "0.0.12",
4 changes: 2 additions & 2 deletions packages/console/src/browser/ansi-console-item.tsx
Original file line number Diff line number Diff line change
@@ -16,8 +16,8 @@

import * as React from 'react';
import { ConsoleItem } from './console-session';
import { ansiToHtml } from 'anser';
import { Severity } from '@theia/core/lib/common/severity';
import Anser from 'anser';

export class AnsiConsoleItem implements ConsoleItem {

@@ -27,7 +27,7 @@ export class AnsiConsoleItem implements ConsoleItem {
public readonly content: string,
public readonly severity?: Severity
) {
this.htmlContent = ansiToHtml(this.content, {
this.htmlContent = Anser.ansiToHtml(this.content, {
use_classes: true,
remove_empty: true
});
2 changes: 1 addition & 1 deletion packages/core/src/browser/logger-frontend-module.ts
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ export const loggerFrontendModule = new ContainerModule(bind => {
const loggerWatcher = ctx.container.get(LoggerWatcher);
const connection = ctx.container.get(WebSocketConnectionProvider);
const target = connection.createProxy<ILoggerServer>(loggerPath, loggerWatcher.getLoggerClient());
function get<K extends keyof ILoggerServer>(_: ILoggerServer, property: K): ILoggerServer[K] {
function get<K extends keyof ILoggerServer>(_: ILoggerServer, property: K): ILoggerServer[K] | ILoggerServer['log'] {
if (property === 'log') {
return (name, logLevel, message, params) => {
ConsoleLogger.log(name, logLevel, message, params);
2 changes: 1 addition & 1 deletion packages/core/src/browser/shell/shell-layout-restorer.ts
Original file line number Diff line number Diff line change
@@ -307,7 +307,7 @@ export class ShellLayoutRestorer implements CommandContribution {
const widget = await this.widgetManager.getOrCreateWidget(desc.constructionOptions.factoryId, desc.constructionOptions.options);
if (StatefulWidget.is(widget) && desc.innerWidgetState !== undefined) {
try {
let oldState;
let oldState: object;
if (typeof desc.innerWidgetState === 'string') {
const parseContext = new ShellLayoutRestorer.ParseContext();
oldState = this.parse(desc.innerWidgetState, parseContext);
3 changes: 1 addition & 2 deletions packages/core/src/browser/widgets/widget.ts
Original file line number Diff line number Diff line change
@@ -102,8 +102,7 @@ export class BaseWidget extends Widget {
this.scrollBar.destroy();
this.scrollBar = undefined;
}
// tslint:disable-next-line:no-null-keyword
container.style.overflow = null;
container.style.overflow = 'initial';
}));
})();
}
2 changes: 1 addition & 1 deletion packages/core/src/common/event.ts
Original file line number Diff line number Diff line change
@@ -148,7 +148,7 @@ export interface EmitterOptions {
onLastListenerRemove?: Function;
}

export class Emitter<T> {
export class Emitter<T = any> {

private static _noop = function (): void { };

1 change: 1 addition & 0 deletions packages/core/src/common/index.ts
Original file line number Diff line number Diff line change
@@ -36,6 +36,7 @@ export * from './progress-service-protocol';
export * from './selection';
export * from './strings';
export * from './application-error';
export * from './lsp-types';

import { environment } from '@theia/application-package/lib/environment';
export { environment };
31 changes: 31 additions & 0 deletions packages/core/src/common/lsp-types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/********************************************************************************
* Copyright (C) 2019 Ericsson and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the Eclipse
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
* with the GNU Classpath Exception which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/

import { Range } from 'vscode-languageserver-protocol';

export interface TextDocumentContentChangeDelta {
readonly range: Range;
readonly rangeLength?: number;
readonly text: string;
}
export namespace TextDocumentContentChangeDelta {

// tslint:disable-next-line:no-any
export function is(arg: any): arg is TextDocumentContentChangeDelta {
return !!arg && typeof arg['text'] === 'string' && (typeof arg['rangeLength'] === 'number' || typeof arg['rangeLength'] === 'undefined') && Range.is(arg['range']);
}

}
2 changes: 1 addition & 1 deletion packages/core/src/common/resource.ts
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
********************************************************************************/

import { injectable, inject, named } from 'inversify';
import { TextDocumentContentChangeEvent } from 'vscode-languageserver-types';
import { TextDocumentContentChangeEvent } from 'vscode-languageserver-protocol';
import URI from '../common/uri';
import { ContributionProvider } from './contribution-provider';
import { Event, Emitter } from './event';
8 changes: 8 additions & 0 deletions packages/core/src/common/uri-command-handler.ts
Original file line number Diff line number Diff line change
@@ -62,6 +62,13 @@ export namespace UriAwareCommandHandler {
}

}
/**
* @todo Create different classes for single and multi-uris. State can be
* corrupt if the developer does something like:
* ```ts
* new UriAwareCommandHandler<URI[]>(selectionService, handler, { multi: false })
* ```
*/
export class UriAwareCommandHandler<T extends MaybeArray<URI>> implements CommandHandler {

constructor(
@@ -73,6 +80,7 @@ export class UriAwareCommandHandler<T extends MaybeArray<URI>> implements Comman
// tslint:disable-next-line:no-any
protected getUri(...args: any[]): T | undefined {
if (args && args[0] instanceof URI) {
// @ts-ignore we want to always return URIs
return this.isMulti() ? [args[0]] : args[0];
}
const { selection } = this.selectionService;
Original file line number Diff line number Diff line change
@@ -80,7 +80,7 @@ export const ConnectionContainerModule: symbol & { create(callback: ConnectionCo
path,
onConnection: connection => serviceFactory.listen(connection)
});
return bind(serviceIdentifier).toConstantValue(service);
return bind(serviceIdentifier).toConstantValue(service as any);
};
const bindBackendService: BindBackendService = (path, serviceIdentifier, onActivation) => {
bind(ConnectionHandler).toDynamicValue(context =>
3 changes: 1 addition & 2 deletions packages/cpp/src/browser/cpp-protocol.ts
Original file line number Diff line number Diff line change
@@ -14,8 +14,7 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/

import { RequestType } from 'vscode-jsonrpc';
import { TextDocumentIdentifier } from '@theia/languages/lib/browser';
import { RequestType, TextDocumentIdentifier } from '@theia/languages/lib/browser';

export namespace SwitchSourceHeaderRequest {
export const type = new RequestType<TextDocumentIdentifier, string | undefined, void, void>('textDocument/switchSourceHeader');
17 changes: 3 additions & 14 deletions packages/editor/src/browser/editor.ts
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
import { Position, Range, Location } from 'vscode-languageserver-types';
import * as lsp from 'vscode-languageserver-types';
import URI from '@theia/core/lib/common/uri';
import { Event, Disposable } from '@theia/core/lib/common';
import { Event, Disposable, TextDocumentContentChangeDelta } from '@theia/core/lib/common';
import { Saveable, Navigatable } from '@theia/core/lib/browser';
import { EditorDecoration } from './decorations';

@@ -33,19 +33,8 @@ export interface TextEditorDocument extends lsp.TextDocument, Saveable, Disposab
getLineMaxColumn(lineNumber: number): number;
}

export interface TextDocumentContentChangeDelta extends lsp.TextDocumentContentChangeEvent {
readonly range: Range;
readonly rangeLength: number;
}

export namespace TextDocumentContentChangeDelta {

// tslint:disable-next-line:no-any
export function is(arg: any): arg is TextDocumentContentChangeDelta {
return !!arg && typeof arg['text'] === 'string' && typeof arg['rangeLength'] === 'number' && Range.is(arg['range']);
}

}
// Refactoring
export { TextDocumentContentChangeDelta };

export interface TextDocumentChangeEvent {
readonly document: TextEditorDocument;
2 changes: 1 addition & 1 deletion packages/filesystem/src/browser/file-resource.ts
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
********************************************************************************/

import { injectable, inject } from 'inversify';
import { TextDocumentContentChangeEvent } from 'vscode-languageserver-types';
import { TextDocumentContentChangeEvent } from 'vscode-languageserver-protocol';
import {
Resource, ResourceResolver, Emitter, Event, DisposableCollection, ResourceError
} from '@theia/core';
2 changes: 1 addition & 1 deletion packages/filesystem/src/common/filesystem.ts
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/

import { TextDocumentContentChangeEvent } from 'vscode-languageserver-types';
import { TextDocumentContentChangeEvent } from 'vscode-languageserver-protocol';
import { JsonRpcServer, ApplicationError } from '@theia/core/lib/common';
import { injectable } from 'inversify';
export const fileSystemPath = '/services/filesystem';
10 changes: 7 additions & 3 deletions packages/filesystem/src/node/node-filesystem.ts
Original file line number Diff line number Diff line change
@@ -23,8 +23,10 @@ import * as os from 'os';
import * as touch from 'touch';
import * as drivelist from 'drivelist';
import { injectable, inject, optional } from 'inversify';
import { TextDocumentContentChangeEvent, TextDocument } from 'vscode-languageserver-types';
import { TextDocument } from 'vscode-languageserver-types';
import { TextDocumentContentChangeEvent } from 'vscode-languageserver-protocol';
import URI from '@theia/core/lib/common/uri';
import { TextDocumentContentChangeDelta } from '@theia/core/lib/common/lsp-types';
import { FileUri } from '@theia/core/lib/node/file-uri';
import { FileStat, FileSystem, FileSystemClient, FileSystemError, FileMoveOptions, FileDeleteOptions, FileAccess } from '../common/filesystem';
import * as iconv from 'iconv-lite';
@@ -138,11 +140,13 @@ export class FileSystemNode implements FileSystem {
protected applyContentChanges(content: string, contentChanges: TextDocumentContentChangeEvent[]): string {
let document = TextDocument.create('', '', 1, content);
for (const change of contentChanges) {
let newContent = change.text;
if (change.range) {
let newContent: string;
if (TextDocumentContentChangeDelta.is(change)) {
const start = document.offsetAt(change.range.start);
const end = document.offsetAt(change.range.end);
newContent = document.getText().substr(0, start) + change.text + document.getText().substr(end);
} else {
newContent = change.text;
}
document = TextDocument.create(document.uri, document.languageId, document.version, newContent);
}
3 changes: 1 addition & 2 deletions packages/java/src/browser/java-protocol.ts
Original file line number Diff line number Diff line change
@@ -14,8 +14,7 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/

import { RequestType, NotificationType } from 'vscode-jsonrpc';
import { TextDocumentIdentifier, Command, MessageType, ExecuteCommandParams } from '@theia/languages/lib/browser';
import { RequestType, NotificationType, TextDocumentIdentifier, Command, MessageType, ExecuteCommandParams } from '@theia/languages/lib/browser';

export interface StatusReport {
message: string;
Original file line number Diff line number Diff line change
@@ -24,13 +24,13 @@ import {
ServerCapabilities,
Disposable,
DocumentSelector
} from '../';
} from '../language-client-services';
import { SemanticHighlight, SemanticHighlightingParams } from './semantic-highlighting-protocol';

// NOTE: This module can be removed, or at least can be simplified once the semantic highlighting will become the part of the LSP.
// https://github.com/Microsoft/vscode-languageserver-node/issues/368

export class SemanticHighlightFeature extends TextDocumentFeature<TextDocumentRegistrationOptions> {
export class SemanticHighlightFeature extends TextDocumentFeature<{}, TextDocumentRegistrationOptions> {

protected readonly languageId: string;
protected readonly toDispose: DisposableCollection;
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/

import { NotificationType } from 'vscode-jsonrpc';
import { NotificationType } from '../';
import { VersionedTextDocumentIdentifier } from '..';

// NOTE: This module can be removed, once the semantic highlighting will become the part of the LSP.
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ import { TypeHierarchyRequest } from './typehierarchy-protocol';
/**
* Text document feature for handling super- and subtype hierarchies through the LSP.
*/
export class TypeHierarchyFeature extends TextDocumentFeature<TextDocumentRegistrationOptions> {
export class TypeHierarchyFeature extends TextDocumentFeature<{}, TextDocumentRegistrationOptions> {

constructor(readonly client: ILanguageClient) {
super(client, TypeHierarchyRequest.type);
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/

import { RequestType } from 'vscode-jsonrpc';
import { RequestType } from '../language-client-services';
import { SymbolKind, Range } from 'vscode-languageserver-types';
import { TextDocumentPositionParams, TextDocumentRegistrationOptions, StaticRegistrationOptions } from 'vscode-languageserver';

Original file line number Diff line number Diff line change
@@ -77,7 +77,7 @@ export abstract class BaseLanguageServerContribution implements LanguageServerCo
command: string, args?: string[], options?: cp.SpawnOptions): Promise<IConnection> {

const process = await this.spawnProcessAsync(command, args, options);
const [outSock, inSock] = await Promise.all([outSocket, inSocket]);
const [outSock, inSock] = await Promise.all<net.Socket>([outSocket, inSocket]);
return createProcessSocketConnection(process.process!, outSock, inSock);
}

3 changes: 2 additions & 1 deletion packages/monaco/src/browser/monaco-editor-model.ts
Original file line number Diff line number Diff line change
@@ -14,7 +14,8 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/

import { TextDocumentSaveReason, Position, TextDocumentContentChangeEvent } from 'vscode-languageserver-types';
import { Position } from 'vscode-languageserver-types';
import { TextDocumentSaveReason, TextDocumentContentChangeEvent } from 'vscode-languageserver-protocol';
import { MonacoToProtocolConverter, ProtocolToMonacoConverter } from 'monaco-languageclient';
import { TextEditorDocument } from '@theia/editor/lib/browser';
import { DisposableCollection, Disposable, Emitter, Event, Resource, CancellationTokenSource, CancellationToken, ResourceError } from '@theia/core';
2 changes: 1 addition & 1 deletion packages/plugin-ext/src/common/rpc-protocol.ts
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ export class ProxyIdentifier<T> {
public readonly id: string;
constructor(public readonly isMain: boolean, id: string | T) {
// TODO this is nasty, rewrite this
this.id = id.toString();
this.id = (id as any).toString();
}
}

2 changes: 1 addition & 1 deletion packages/preview/package.json
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
"@theia/languages": "^0.12.0",
"@theia/mini-browser": "^0.12.0",
"@types/highlight.js": "^9.12.2",
"@types/markdown-it": "^0.0.4",
"@types/markdown-it": "*",
"@types/markdown-it-anchor": "^4.0.1",
"highlight.js": "^9.12.0",
"markdown-it": "^8.4.0",
Original file line number Diff line number Diff line change
@@ -206,10 +206,10 @@ export class MarkdownPreviewHandler implements PreviewHandler {
return attribute ? Number.parseInt(attribute) : undefined;
}

protected engine: markdownit.MarkdownIt | undefined;
protected getEngine(): markdownit.MarkdownIt {
protected engine: markdownit | undefined;
protected getEngine(): markdownit {
if (!this.engine) {
const engine: markdownit.MarkdownIt = this.engine = markdownit({
const engine: markdownit = this.engine = markdownit({
html: true,
linkify: true,
highlight: (str, lang) => {
2 changes: 1 addition & 1 deletion packages/scm/src/browser/scm-widget.tsx
Original file line number Diff line number Diff line change
@@ -224,7 +224,7 @@ export class ScmWidget extends ReactWidget implements StatefulWidget {
}
}

protected setInputValue = (event: React.ChangeEvent<HTMLTextAreaElement> | string) => {
protected setInputValue = (event: React.FormEvent<HTMLTextAreaElement> | React.ChangeEvent<HTMLTextAreaElement> | string) => {
const repository = this.scmService.selectedRepository;
if (repository) {
repository.input.value = typeof event === 'string' ? event : event.currentTarget.value;
4 changes: 2 additions & 2 deletions packages/task/src/node/task-abstract-line-matcher.ts
Original file line number Diff line number Diff line change
@@ -111,7 +111,7 @@ export abstract class AbstractLineMatcher {
if (trim) {
value = value.trim();
}
data[property] += endOfLine + value;
(data[property] as string) += endOfLine + value;
}
}

@@ -123,7 +123,7 @@ export abstract class AbstractLineMatcher {
if (trim) {
value = value.trim();
}
data[property] = value;
(data[property] as string) = value;
}
}
}
2 changes: 1 addition & 1 deletion packages/task/src/node/task-server.slow-spec.ts
Original file line number Diff line number Diff line change
@@ -413,7 +413,7 @@ function createTaskConfigTaskLongRunning(processType: ProcessType): TaskConfigur
}

function checkSuccessfullProcessExit(taskInfo: TaskInfo, taskWatcher: TaskWatcher): Promise<object> {
const p = new Promise((resolve, reject) => {
const p = new Promise<object>((resolve, reject) => {
const toDispose = taskWatcher.onTaskExit((event: TaskExitedEvent) => {
if (event.taskId === taskInfo.taskId && event.code === 0) {
toDispose.dispose();
Loading

0 comments on commit 10f1485

Please sign in to comment.