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

update monaco editor to 0.12.x #1681

Merged
merged 6 commits into from
Apr 30, 2018
Merged

update monaco editor to 0.12.x #1681

merged 6 commits into from
Apr 30, 2018

Conversation

AlexTugarev
Copy link
Contributor

@AlexTugarev AlexTugarev commented Apr 10, 2018

I've started to update monaco, also because this includes updates of libraries and fixes issues like the broken java model sync. The work is suspended now due to some critical monaco issues, cf [1]. Especially the broken find references [2] is a show stopper.

[1] https://github.com/Microsoft/monaco-editor/milestone/11
[2] microsoft/monaco-editor#779


@AlexTugarev
Copy link
Contributor Author

There is some movement in the upstream, microsoft/monaco-editor#779 was fixed. Let's see if there is a new release on its way.

@@ -1,58 +1,51 @@
{
"name": "@theia/monaco",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlexTugarev please could you fix formatting in json files, should be 2 spaces

@AlexTugarev AlexTugarev changed the title WIP update monaco editor to 0.11.x WIP update monaco editor to 0.12.x Apr 11, 2018
@AlexTugarev
Copy link
Contributor Author

[email protected] was released. I'll give it a try.

global.monaco.modes = modes;
global.monaco.cancellation = cancellation;
debugger;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity; what's that and what does this line do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debugger is a leftover here. it's a breakpoint in code. bad habit, I know, but it was helpful, as chrome was not willing to install breakpoint here.
I'll remove it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bad habit

Not at all, it was in WIP anyway. I wanted to squeeze some knowledge. Thanks!

@@ -209,7 +209,7 @@ export namespace EditorDecorationStyle {
const index = styleSheet.insertRule('.' + selector + '{}', 0);
const rules = styleSheet.cssRules || styleSheet.rules;
const rule = rules.item(index);
if (rule.type === CSSRule.STYLE_RULE) {
if (rule && rule.type === CSSRule.STYLE_RULE) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is your tsc --version? Is this related: #1621?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's 2.7.2, but code-insiders is ahead and sometimes it fails to pick ts from node_modules. that change would still be ok with 2.7.x, I'll check that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, and please, ignore me; I was curious. Thanks!

@@ -39,7 +39,7 @@ const { mode } = yargs.option('mode', {
const development = mode === 'development';${this.ifMonaco(() => `

const monacoEditorPath = development ? '${this.resolve('monaco-editor-core', 'dev/vs')}' : '${this.resolve('monaco-editor-core', 'min/vs')}';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to take a look at #1542 and the referenced microsoft/monaco-editor#18. Basically, this means we no longer need to copy all the monaco files separately, but bundle it into our main artefact.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, but it is out of the scope of this PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How out of scope? This is only available on Monaco 0.11+ and we should do it upon the upgrade. I'm aware that this is not a blocker, but this is not out of scope either.

Copy link
Member

@akosyakov akosyakov Apr 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do it with another PR, there are things to consider before switching from AMD to ESM, like the build speed. We had bad experience in monaco-languageclient. We want to consider it separately without blocking usage of the latest Monaco.

@AlexTugarev AlexTugarev force-pushed the at/update-monaco branch 3 times, most recently from 54bfb15 to 04b983a Compare April 19, 2018 06:52
@AlexTugarev
Copy link
Contributor Author

@kittaakos, have dealt with keybindings before? I think editor and diffEditor should be different contexts.

    Collided keybinding is ignored;  [ '{"command":"monaco.editor.action.wordHighlight.next","keybinding":"f7","context":"editorTextFocus"}',
      ' collided with ',
      '{"command":"monaco.editor.action.diffReview.next","keybinding":"f7","context":"editorTextFocus"}' ]
    Collided keybinding is ignored;  [ '{"command":"monaco.editor.action.wordHighlight.prev","keybinding":"shift+f7","context":"editorTextFocus"}',
      ' collided with ',
      '{"command":"monaco.editor.action.diffReview.prev","keybinding":"shift+f7","context":"editorTextFocus"}' ]

@AlexTugarev
Copy link
Contributor Author

Did we consider inDiffEditor before? There are no keybinding conflicts with previous versions of monaco.

screen shot 2018-04-19 at 09 12 25

cc. @akosyakov

@AlexTugarev
Copy link
Contributor Author

JDT LS integration is broken.

screen shot 2018-04-19 at 09 36 14

@akosyakov
Copy link
Member

@AlexTugarev logging warning instead of throwing is fine with me

@AlexTugarev
Copy link
Contributor Author

@akosyakov, I did not get that.

logging warning instead of throwing is fine with me

which error do you refer to?

@AlexTugarev
Copy link
Contributor Author

created PR TypeFox/monaco-languageclient#74 to resolve issues with suggest widget.

@AlexTugarev AlexTugarev force-pushed the at/update-monaco branch 4 times, most recently from 96a0a52 to a85ef4a Compare April 26, 2018 10:40
@AlexTugarev AlexTugarev changed the title WIP update monaco editor to 0.12.x update monaco editor to 0.12.x Apr 26, 2018
Copy link
Contributor

@svenefftinge svenefftinge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, Alex! Thank you :)

/// <reference types='monaco-editor-core/monaco'/>

declare module monaco.instantiation {
export interface IInstantiationService {
}
}

declare module monaco.editor {
declare namespace monaco.editor {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlexTugarev Could you explain why it should be changed? (just out of curiosity)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a left over. I just tried out something while fixing typings. The monaco.editor is just a global spread and it should not be necessary to declare it a module. We also never import it, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akosyakov maybe we need to change it with the transition to ESM version of monaco. I've reverted it here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

monaco is module, not namespace, it is a way how to augment modules.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akosyakov it used to be declare module monaco but they changed it to declare namespace monaco.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was changed sometimes between 0.11.1 and 0.11.6, I don't remember

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, then it makes sense :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reverted it, but it won't be a problem. We'll revise it when it comes to using ESM.

@AlexTugarev AlexTugarev force-pushed the at/update-monaco branch 3 times, most recently from f684585 to 14bdac0 Compare April 27, 2018 14:45
Signed-off-by: Alex Tugarev <[email protected]>
Signed-off-by: Alex Tugarev <[email protected]>
@svenefftinge
Copy link
Contributor

Tested again. Looks still good to me.

@AlexTugarev AlexTugarev merged commit a34acb8 into master Apr 30, 2018
@AlexTugarev AlexTugarev deleted the at/update-monaco branch April 30, 2018 15:31
This was referenced Apr 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants