Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to LSP 6.0.0 and Monaco 0.19.3 #7149

Merged
merged 11 commits into from
Mar 27, 2020
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const { mode, staticCompression } = yargs.option('mode', {
}).argv;
const development = mode === 'development';${this.ifMonaco(() => `

const monacoEditorCorePath = development ? '${this.resolve('@typefox/monaco-editor-core', 'dev/vs')}' : '${this.resolve('@typefox/monaco-editor-core', 'min/vs')}';
const monacoEditorCorePath = development ? '${this.resolve('@theia/monaco-editor-core', 'dev/vs')}' : '${this.resolve('@theia/monaco-editor-core', 'min/vs')}';
const monacoCssLanguagePath = '${this.resolve('monaco-css', 'release/min')}';
const monacoHtmlLanguagePath = '${this.resolve('monaco-html', 'release/min')}';`)}

Expand Down
9 changes: 7 additions & 2 deletions packages/console/src/browser/console-widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,12 @@ export class ConsoleWidget extends BaseWidget implements StatefulWidget {
const input = this._input = await this.createInput(inputWidget.node);
this.toDispose.push(input);
this.toDispose.push(input.getControl().onDidLayoutChange(() => this.resizeContent()));
this.toDispose.push(input.getControl().onDidChangeConfiguration(({ fontInfo }) => fontInfo && this.updateFont()));

// todo update font if fontInfo was changed only
// it's impossible at the moment, but will be fixed for next upgrade of monaco version
// see https://github.com/microsoft/vscode/commit/5084e8ca1935698c98c163e339ca664818786c6d
this.toDispose.push(input.getControl().onDidChangeConfiguration(() => this.updateFont()));

this.updateFont();
if (inputFocusContextKey) {
this.toDispose.push(input.onFocusChanged(() => inputFocusContextKey.set(this.hasInputFocus())));
Expand All @@ -121,7 +126,7 @@ export class ConsoleWidget extends BaseWidget implements StatefulWidget {
}

protected updateFont(): void {
const { fontFamily, fontSize, lineHeight } = this._input.getControl().getConfiguration().fontInfo;
const { fontFamily, fontSize, lineHeight } = this._input.getControl().getOption(monaco.editor.EditorOption.fontInfo);
this.content.node.style.fontFamily = fontFamily;
this.content.node.style.fontSize = fontSize + 'px';
this.content.node.style.lineHeight = lineHeight + 'px';
Expand Down
2 changes: 1 addition & 1 deletion packages/console/src/browser/monaco.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/

/// <reference types='@typefox/monaco-editor-core/monaco'/>
/// <reference types='@theia/monaco-editor-core/monaco'/>
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"route-parser": "^0.0.5",
"vscode-languageserver-types": "^3.15.0-next",
"vscode-uri": "^1.0.8",
"vscode-ws-jsonrpc": "^0.1.1",
"vscode-ws-jsonrpc": "^0.2.0",
"ws": "^7.1.2",
"yargs": "^11.1.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,7 @@ export abstract class QuickOpenBaseAction implements QuickOpenAction {
this.options.checked = value;
}

get radio(): boolean {
return this.options.radio || false;
}

set radio(value: boolean) {
this.options.radio = value;
}

abstract run(item?: QuickOpenItem): PromiseLike<void>;
abstract run(item?: QuickOpenItem): Promise<void>;

dispose(): void { }
}
3 changes: 1 addition & 2 deletions packages/core/src/common/quick-open-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,10 @@ export interface QuickOpenActionOptions {
class?: string | undefined;
enabled?: boolean;
checked?: boolean;
radio?: boolean;
}

export interface QuickOpenAction extends QuickOpenActionOptions, Disposable {
run(item?: QuickOpenItem): PromiseLike<void>;
run(item?: QuickOpenItem): Promise<void>;
}

export enum QuickTitleButtonSide {
Expand Down
6 changes: 4 additions & 2 deletions packages/debug/src/browser/debug-monaco-contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ monaco.languages.registerDocumentSymbolProvider('jsonc', {
kind: monaco.languages.SymbolKind.Object,
range: new monaco.Range(0, 0, 0, 0),
selectionRange: new monaco.Range(0, 0, 0, 0),
children
children,
tags: []
};
let name: string = '';
let lastProperty = '';
Expand Down Expand Up @@ -75,7 +76,8 @@ monaco.languages.registerDocumentSymbolProvider('jsonc', {
detail: '',
kind: monaco.languages.SymbolKind.Object,
range,
selectionRange: range
selectionRange: range,
tags: []
});
}
depthInObjects--;
Expand Down
4 changes: 2 additions & 2 deletions packages/debug/src/browser/editor/debug-exception-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class DebugExceptionWidget implements Disposable {
show({ info, lineNumber, column }: ShowDebugExceptionParams): void {
this.render(info);

const fontInfo = this.editor.getControl().getConfiguration().fontInfo;
const fontInfo = this.editor.getControl().getOption(monaco.editor.EditorOption.fontInfo);
this.zone.containerNode.style.fontSize = `${fontInfo.fontSize}px`;
this.zone.containerNode.style.lineHeight = `${fontInfo.lineHeight}px`;

Expand All @@ -75,7 +75,7 @@ export class DebugExceptionWidget implements Disposable {
{info.description && <div className='description'>{info.description}</div>}
{stackTrace && <div className='stack-trace'>{stackTrace}</div>}
</React.Fragment>, this.zone.containerNode, () => {
const lineHeight = this.editor.getControl().getConfiguration().lineHeight;
const lineHeight = this.editor.getControl().getOption(monaco.editor.EditorOption.lineHeight);
const heightInLines = Math.ceil(this.zone.containerNode.offsetHeight / lineHeight);
this.zone.layout(heightInLines);
});
Expand Down
Loading