Skip to content

Commit

Permalink
monaco: upgrade to 1.72.x
Browse files Browse the repository at this point in the history
The commit upgrades monaco to `v1.72.2`.

Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>
  • Loading branch information
vince-fugnitto committed Oct 20, 2022
1 parent 7f51450 commit 84a2a0e
Show file tree
Hide file tree
Showing 36 changed files with 352 additions and 191 deletions.
2 changes: 1 addition & 1 deletion examples/api-samples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@theia/file-search": "1.30.0",
"@theia/filesystem": "1.30.0",
"@theia/monaco": "1.30.0",
"@theia/monaco-editor-core": "1.67.2",
"@theia/monaco-editor-core": "1.72.2",
"@theia/output": "1.30.0",
"@theia/search-in-workspace": "1.30.0",
"@theia/toolbar": "1.30.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/bulk-edit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"@theia/editor": "1.30.0",
"@theia/filesystem": "1.30.0",
"@theia/monaco": "1.30.0",
"@theia/monaco-editor-core": "1.67.2",
"@theia/monaco-editor-core": "1.72.2",
"@theia/workspace": "1.30.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dependencies": {
"@theia/core": "1.30.0",
"@theia/monaco": "1.30.0",
"@theia/monaco-editor-core": "1.67.2",
"@theia/monaco-editor-core": "1.72.2",
"anser": "^2.0.1"
},
"publishConfig": {
Expand Down
10 changes: 7 additions & 3 deletions packages/core/src/browser/context-key-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ import { injectable } from 'inversify';
import { Disposable } from '../common';
import { Emitter, Event } from '../common/event';

export interface ContextKey<T> {
export type ContextKeyValue = null | undefined | boolean | number | string
| Array<null | undefined | boolean | number | string>
| Record<string, null | undefined | boolean | number | string>;

export interface ContextKey<T extends ContextKeyValue = ContextKeyValue> {
set(value: T | undefined): void;
reset(): void;
get(): T | undefined;
Expand All @@ -41,7 +45,7 @@ export const ContextKeyService = Symbol('ContextKeyService');
export interface ContextKeyService extends Disposable {
readonly onDidChange: Event<ContextKeyChangeEvent>;

createKey<T>(key: string, defaultValue: T | undefined): ContextKey<T>;
createKey<T extends ContextKeyValue>(key: string, defaultValue: T | undefined): ContextKey<T>;

/**
* Whether the expression is satisfied. If `context` provided, the service will attempt to retrieve a context object associated with that element.
Expand Down Expand Up @@ -82,7 +86,7 @@ export class ContextKeyServiceDummyImpl implements ContextKeyService {
this.onDidChangeEmitter.fire(event);
}

createKey<T>(key: string, defaultValue: T | undefined): ContextKey<T> {
createKey<T extends ContextKeyValue>(key: string, defaultValue: T | undefined): ContextKey<T> {
return ContextKey.None;
}
/**
Expand Down
12 changes: 5 additions & 7 deletions packages/core/src/browser/resource-context-key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import { injectable, inject, postConstruct } from 'inversify';
import URI from '../common/uri';
import { URI as Uri } from 'vscode-uri';
import { ContextKeyService, ContextKey } from './context-key-service';
import { LanguageService } from './language-service';

Expand All @@ -29,7 +28,7 @@ export class ResourceContextKey {
@inject(ContextKeyService)
protected readonly contextKeyService: ContextKeyService;

protected resource: ContextKey<Uri>;
protected resource: ContextKey<string>;
protected resourceSchemeKey: ContextKey<string>;
protected resourceFileName: ContextKey<string>;
protected resourceExtname: ContextKey<string>;
Expand All @@ -40,7 +39,7 @@ export class ResourceContextKey {

@postConstruct()
protected init(): void {
this.resource = this.contextKeyService.createKey<Uri>('resource', undefined);
this.resource = this.contextKeyService.createKey<string>('resource', undefined);
this.resourceSchemeKey = this.contextKeyService.createKey<string>('resourceScheme', undefined);
this.resourceFileName = this.contextKeyService.createKey<string>('resourceFilename', undefined);
this.resourceExtname = this.contextKeyService.createKey<string>('resourceExtname', undefined);
Expand All @@ -50,13 +49,12 @@ export class ResourceContextKey {
this.resourceSet = this.contextKeyService.createKey<boolean>('resourceSet', false);
}

get(): URI | undefined {
const codeUri = this.resource.get();
return codeUri && new URI(codeUri);
get(): string | undefined {
return this.resource.get();
}

set(resourceUri: URI | undefined): void {
this.resource.set(resourceUri?.['codeUri']);
this.resource.set(resourceUri?.toString()); // TODO: TEST.
this.resourceSchemeKey.set(resourceUri?.scheme);
this.resourceFileName.set(resourceUri?.path.base);
this.resourceExtname.set(resourceUri?.path.ext);
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/browser/shell/application-shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ export class ApplicationShell extends Widget {
}

protected initFocusKeyContexts(): void {
const sideBarFocus = this.contextKeyService.createKey('sideBarFocus', false);
const panelFocus = this.contextKeyService.createKey('panelFocus', false);
const sideBarFocus = this.contextKeyService.createKey<boolean>('sideBarFocus', false);
const panelFocus = this.contextKeyService.createKey<boolean>('panelFocus', false);
const updateFocusContextKeys = () => {
const area = this.activeWidget && this.getAreaFor(this.activeWidget);
sideBarFocus.set(area === 'left');
Expand Down
2 changes: 1 addition & 1 deletion packages/debug/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"@theia/filesystem": "1.30.0",
"@theia/markers": "1.30.0",
"@theia/monaco": "1.30.0",
"@theia/monaco-editor-core": "1.67.2",
"@theia/monaco-editor-core": "1.72.2",
"@theia/output": "1.30.0",
"@theia/process": "1.30.0",
"@theia/task": "1.30.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { Disposable, dispose } from '@theia/monaco-editor-core/esm/vs/base/commo
import { isAbsolute } from '@theia/monaco-editor-core/esm/vs/base/common/path';
import { Constants } from '@theia/monaco-editor-core/esm/vs/base/common/uint';
import { applyFontInfo } from '@theia/monaco-editor-core/esm/vs/editor/browser/config/domFontInfo';
import { createStringBuilder } from '@theia/monaco-editor-core/esm/vs/editor/common/core/stringBuilder';
import { StringBuilder } from '@theia/monaco-editor-core/esm/vs/editor/common/core/stringBuilder';
import { ITextModel } from '@theia/monaco-editor-core/esm/vs/editor/common/model';
import { ITextModelService } from '@theia/monaco-editor-core/esm/vs/editor/common/services/resolverService';
import { IThemeService } from '@theia/monaco-editor-core/esm/vs/platform/theme/common/themeService';
Expand Down Expand Up @@ -92,14 +92,14 @@ export class InstructionRenderer extends Disposable implements ITableRenderer<Di
column.currentElement.element = element;
const instruction = element.instruction;
column.sourcecode.innerText = '';
const sb = createStringBuilder(1000);
const sb = new StringBuilder(1000);

if (this._disassemblyView.isSourceCodeRender && instruction.location?.path && instruction.line) {
const sourceURI = this.getUriFromSource(instruction);

if (sourceURI) {
let textModel: ITextModel | undefined = undefined;
const sourceSB = createStringBuilder(10000);
const sourceSB = new StringBuilder(10000);
const ref = await this.textModelService.createModelReference(sourceURI);
textModel = ref.object.textEditorModel;
column.cellDisposable.push(ref);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ export class DebugBreakpointWidget implements Disposable {
}
}
}];
(this._input.getControl() as unknown as StandaloneCodeEditor).setDecorations('Debug breakpoint placeholder', DebugBreakpointWidget.PLACEHOLDER_DECORATION, decorations);
(this._input.getControl() as unknown as StandaloneCodeEditor)
.setDecorationsByType('Debug breakpoint placeholder', DebugBreakpointWidget.PLACEHOLDER_DECORATION, decorations);
}
protected get placeholder(): string {
if (this.context === 'logMessage') {
Expand Down
4 changes: 2 additions & 2 deletions packages/debug/src/browser/editor/debug-editor-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ export class DebugEditorModel implements Disposable {
this.createInlineValueDecorations()
]);
const codeEditor = this.editor.getControl() as unknown as StandaloneCodeEditor;
codeEditor.removeDecorations(INLINE_VALUE_DECORATION_KEY);
codeEditor.setDecorations('Inline debug decorations', INLINE_VALUE_DECORATION_KEY, inlineValueDecorations);
codeEditor.removeDecorations([INLINE_VALUE_DECORATION_KEY]);
codeEditor.setDecorationsByType('Inline debug decorations', INLINE_VALUE_DECORATION_KEY, inlineValueDecorations);
this.editorDecorations = this.deltaDecorations(this.editorDecorations, newFrameDecorations);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import * as monaco from '@theia/monaco-editor-core';
import { CancellationTokenSource } from '@theia/monaco-editor-core/esm/vs/base/common/cancellation';
import { DEFAULT_WORD_REGEXP } from '@theia/monaco-editor-core/esm/vs/editor/common/core/wordHelper';
import { IDecorationOptions } from '@theia/monaco-editor-core/esm/vs/editor/common/editorCommon';
import { InlineValueContext, StandardTokenType } from '@theia/monaco-editor-core/esm/vs/editor/common/languages';
import { StandardTokenType } from '@theia/monaco-editor-core/esm/vs/editor/common/encodedTokenAttributes';
import { InlineValueContext } from '@theia/monaco-editor-core/esm/vs/editor/common/languages';
import { ITextModel } from '@theia/monaco-editor-core/esm/vs/editor/common/model';
import { ILanguageFeaturesService } from '@theia/monaco-editor-core/esm/vs/editor/common/services/languageFeatures';
import { StandaloneServices } from '@theia/monaco-editor-core/esm/vs/editor/standalone/browser/standaloneServices';
Expand Down
Loading

0 comments on commit 84a2a0e

Please sign in to comment.