profile
viewpoint

amiramw/grunt-contrib-sassjs 8

Compile Sass to CSS using https://github.com/medialize/sass.js

amiramw/animalKeys 0

keyboard with animabls

amiramw/cloud-language-servers-container 0

Server side wrapper that provides HTTP REST/websocket APIs on top of LSP implementations

amiramw/eclipse.jdt.ls 0

Java language server

amiramw/grunt-sass 0

Compile Sass to CSS

amiramw/jasmine.github.io 0

Jasmine doc site

push eventeclipse-theia/theia

vince-fugnitto

commit sha 1f842ea7693e95aef9bda2c394a0249a0ce300d5

api-samples: add new command to output api version The following commit adds a new command to the `api-samples` to output the supported vscode api version for development purposes. The api version is changeable by specifying a cli argument such as: `yarn start --vscode-api-version={version}` Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>

view details

push time in 4 minutes

push eventeclipse-theia/theia

vince-fugnitto

commit sha 78862872818b75ed86e2b98b8e2a0ed90cbf7900

vsx: add 'engines.vscode' handling The following commit updates the logic when searching and installing vscode extensions from `open-vsx` by verifying for compatibility using the `engines.vscode` property. The changes include: - ability to read the default vscode api version from the `cli` or `default`. - ability to determine the compatible version from the search result list. - checks for compatibility. Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>

view details

vince-fugnitto

commit sha 0f5a1c56318ea6586e951a2d54d39fd948ba9f41

api-samples: add new command to output api version The following commit adds a new command to the `api-samples` to output the supported vscode api version for development purposes. The api version is changeable by specifying a cli argument such as: `yarn start --vscode-api-version={version}` Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>

view details

push time in 7 minutes

push eventeclipse-theia/theia

Artem Zatsarynnyi

commit sha d3b8df68b92de5651b98f1f2a16adfb11ba5350f

workspace.workspaceFolders API should return undefined when no folder is open Signed-off-by: Artem Zatsarynnyi <azatsary@redhat.com>

view details

Tomer Epstein

commit sha 329a3ef0ef33392aac0f2dda98c25132de56e8b0

Fix Issue 8463 - calling extension activate() by other extension doesn't work. Signed-off-by: Tomer Epstein <tomer.epstein@sap.com>

view details

Stefan Dirix

commit sha 6bc8d7593822a30c02bbc725387da21c0ecbe554

Adjust return value in 'FileSystemProvider' API doc Signed-off-by: Stefan Dirix <sdirix@eclipsesource.com> Contributed on behalf of STMicroelectronics

view details

Paul Maréchal

commit sha fe4062e66aec9f4131a09bb0ffb6bea9544bd8a2

watchers: use singleton server Theia spawns as many nsfw servers as there are clients, maybe more. This commit replaces this behaviour by centralizing everything into the same service process in order to optimize resources (watch handles are a limited resource on a given Linux host). Some notes on the current design: - Everytime someone requests to watch an `(uri, options)` couple we will re-use the same watch handle (and actual nsfw instance). This allows for resource allocation optimizations. - Since a given service can only serve a single client, I added an event dispatcher named `FileSystemWatcherServiceDispatcher`. You must register yourself with some unique id you will use to make requests. - The new `.watchUriChanges` function now takes a `clientId` so that when events are sent to the dispatcher it then gets routed back to your own client. - Added a `--nsfw-watcher-verbose` backend argument to enable verbose logging for the watcher server. Signed-off-by: Paul Maréchal <paul.marechal@ericsson.com>

view details

Artem Zatsarynnyi

commit sha 3edd11b91969ed5fffd5d46e625553c9db836e37

Eclipse Theia is a framework Signed-off-by: Artem Zatsarynnyi <azatsary@redhat.com>

view details

vince-fugnitto

commit sha c66c0550d95598aa1f0d903d21bf40e01667d374

test: update deprecations in tests The following commit updates the tests to fix any deprecations, and other linting warnings. Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com> Co-authored-by: marechal-p <paul.marechal@ericsson.com>

view details

vince-fugnitto

commit sha a57df3e819e3bbfb7312348987b62e0190117dbb

ext-scripts: reduce verbosity The following commit reduces the verbosity of the `build` command so the build log is not polluted but still displays warnings and errors. Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>

view details

vince-fugnitto

commit sha 04cf597f00adb76eafd0621aae923a065f053926

repo: reduce verbosity during build The following commit reduces the `verbosity` during a build of the project, while still displaying warnings, and errors. The verbose build does not display any relevant information, and polutes the log, as well as during CI. Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>

view details

Artem Zatsarynnyi

commit sha aeb85a46f89154474ee14a5551b14935dfbdde04

Rename menu Debug->Run Signed-off-by: Artem Zatsarynnyi <azatsary@redhat.com>

view details

Shahar Harari

commit sha 60def5302c271db3cdb8212f2e1a18af814d9599

core: Allow customizing CommandQuickOpenItem Signed-off-by: Shahar Harari <shahar.harari@sap.com>

view details

赵梦欢

commit sha ecfe920698e4eea5afd379ca361b263c3fc970a0

core: Workaround for Electron not installing a handler to ignore SIGPIPE error Signed-off-by: zhaomenghuan <zhaomenghuan02@meituan.com>

view details

Jonas Helming

commit sha 4f3faa0c02c3b2778d2f3fb485698dfd7d5daa57

Added documentation for key binding, contributions and registry fixes #8636 Contributed on behalf of STMicroelectronics Signed-off-by: Jonas Helming <jhelming@eclipsesource.com>

view details

Stefan Dirix

commit sha 12a856397ae4ab1650dc42a969ea76b84bb42175

Add API documentation for 'PreferenceService' Document 'PreferenceService', 'PreferenceProxy' and related interfaces, classes and functions. Signed-off-by: Stefan Dirix <sdirix@eclipsesource.com> Contributed on behalf of STMicroelectronics

view details

Stefan Dirix

commit sha 9d4b9e49bd6c52b1ac0e297fc63ade39e18df4d6

Add API documentation to '@theia/preview' * Document preview-handler.ts * Add custom preview guide to README.md Signed-off-by: Stefan Dirix <sdirix@eclipsesource.com> Contributed on behalf of STMicroelectronics

view details

Tobias Ortmayr

commit sha f205aa59f0b7ec5e34ac6be2683e7b12c299caec

Add documentation for widget manager & open handler FIxes #8643 - Document 'WidgetManager' and related interfaces - Document 'WidgetOpenHandler' and related interfaces Signed-off-by: Tobias Ortmayr <tortmayr@eclipsesource.com> Contributed on behalf of STMicroelectronics

view details

vince-fugnitto

commit sha 22a0a5a2964ad54887aabe180c049f9a08ccc94f

repo: fix misc typos The following pull-request fixes miscellaneous typos found across the repository in preparation for the release. Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>

view details

vince-fugnitto

commit sha 067d2c9223817000f4a855f26effc8cef0ac0e44

eslint: add 'no-tabs' rule The following commit adds the `no-tabs` eslint rule to enforce that `spaces` should always be used as according to the project rules, and `editorconfig` properties. The rule will now display errors for use of `tabs` over `spaces`, and it ensures that new pull-requests do not break this pattern, and cause unecessary changes when formatting the documents or performing a `save`. Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>

view details

vince-fugnitto

commit sha b774c551016eeef5d7d0ae32ae470b5aad417520

eslint: update `ignorePatterns` The following commit updates the `ignorePatterns` to include `*.d.ts` files maintained by the project and exclude `lib` folders. Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>

view details

vince-fugnitto

commit sha deccec686f295f2b758133048f5a1a3479ca4e8a

explorer: fixed 'doOpenNode' implementation The following commit fixes an issue with the `explorer` where the workspace folder node is incorrectly opened (despite not being visible) causing an issue where the explorer is empty. Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>

view details

Toma Puljak

commit sha 5cd46036317b98e779325ea94ff817808dd9f1a9

Changed srcElement to target in mini browser Signed-off-by: Toma Puljak <toma.puljak@hotmail.com>

view details

push time in 12 minutes

pull request commenteclipse-theia/theia

vsx-registry: implement extension compatibility handling

@vince-fugnitto any news about this effort?

@amiramw it was blocked by limitations in the open-vsx api which did not easily allow clients to determine extension compatibility (using the engines.vscode field at the moment) without multiple requests which has some performance concerns (ex: on startup). I will need to see what is required and propose changes to the api to make it easier for clients.

vince-fugnitto

comment created time in 27 minutes

pull request commenteclipse-theia/theia

Make FileSystemCommands.UPLOAD to return FileUploadResult

@vince-fugnitto you may merge.

tomer-epstein

comment created time in 4 hours

pull request commenteclipse-theia/theia

7989-refactor-preview: Support for Refactor Preview functionality

@benoitf @akosyakov @vinokurig @amiramw @marechal-p As per @vince-fugnitto remark - any additional review would be appreciated.

Thanks, -Dan

danarad05

comment created time in 5 hours

Pull request review commenteclipse-theia/theia

7989-refactor-preview: Support for Refactor Preview functionality

     outline-offset: calc(-1*var(--theia-border-width));     outline-color: var(--theia-focusBorder); }++.monaco-editor .rename-box.preview input {+    color: var(--theia-editor-foreground);+}

@vince-fugnitto Fixed. Please review again. Thanks

danarad05

comment created time in 5 hours

PR opened eclipse-theia/theia-example

Prepare auto-updating installer with default plugins and customizations
  • add preinstalled theiaPlugins to package-json of electron-app (preparation for #5)
  • add lerna to enable a multi-package repository for electron app + customization packages
  • add a custom main js that sets the environment variable for preinstalled plugins
  • add a customization module for the installer at theia-example-updater. This may be used to enable updates (#13), to customize the about dialog (#10), and to customize the getting started page (#9)

Signed-off-by: Johannes Faltermeier jfaltermeier@eclipsesource.com Signed-off-by: Lucas Koehler lkoehler@eclipsesource.com Contributed on behalf of STMicroelectronics

<!-- Thank you for your Pull Request. Please provide a description and review the requirements below.

Contributors guide: https://github.com/theia-ide/theia/blob/master/CONTRIBUTING.md -->

What it does

<!-- Include relevant issues and describe how they are addressed. -->

How to test

<!-- Explain how a reviewer can reproduce a bug, test new functionality or verify performance improvements. -->

Review checklist

Reminder for reviewers

+14654 -89

0 comment

26 changed files

pr created time in 5 hours

push eventeclipse-theia/theia

Jérome Perrin

commit sha e3e323ec3b600832276d006de4f3190eaf6c214b

download-plugins: fix logging of failures Because Array.forEach(f) calls f with (currentValue, index, array), the output was not only the messages, but also the index and full array. Signed-off-by: Jérome Perrin <perrinjerome@gmail.com>

view details

push time in 10 hours

PR merged eclipse-theia/theia

download-plugins: fix logging of failures builtins theia-cli

<!-- Thank you for your Pull Request. Please provide a description and review the requirements below.

Contributors guide: https://github.com/theia-ide/theia/blob/master/CONTRIBUTING.md -->

What it does

<!-- Include relevant issues and describe how they are addressed. --> Because Array.forEach(f) calls f with (currentValue, index, array), the output was not only the messages, but also the index and full array.

This changes to log only the message.

How to test

<!-- Explain how a reviewer can reproduce a bug, test new functionality or verify performance improvements. -->

Change theiaPlugins in package.json to something like this:

  "theiaPlugins": {
    "error-404": "https://open-vsx.org/404.vsix",
    "another-error": "https://open-vsx.org/404.vsix"
  }

run yarn download:plugins. Without this change, in the output there is the index and the array of failures, it looks like this: image

After this change, the output is:

image

Review checklist

Reminder for reviewers

+1 -1

1 comment

1 changed file

perrinjerome

pr closed time in 10 hours

issue commenteclipse-theia/theia

vscode: support 'custom data' for HTML / CSS

Looking forward to support for it, theia looks great so far, such support would make it greater. Thanks.

bkelley13

comment created time in 10 hours

issue closedeclipse-theia/theia

ci: replace travis with github actions

<!-- Please provide a detailed description of the bug. -->

Bug Description:

Currently, there is no longer CI for master and pull-requests since we have exhausted our allocated credits (~1000 min) for travis. A potential replacement would be to migrate to github actions which is currently free for open-source projects. We also currently use workflows in this repository and others.

image

Alternatively, if anyone has other solutions besides github actions we can take a look into it.

Additional Information:

  • https://github.com/eclipse-theia/theia/pull/8765#issuecomment-731377516
  • https://github.com/eclipse-theia/theia/pull/8745#issuecomment-731378232

closed time in 11 hours

vince-fugnitto

issue commenteclipse-theia/theia

ci: replace travis with github actions

@vince-fugnitto Good enough to close this issue?

Thank you @kittaakos and @marechal-p for resolving the issue 👍

vince-fugnitto

comment created time in 11 hours

pull request commenteclipse-theia/theia

download-plugins: fix logging of failures

I rebased to solve conflicts, now that https://github.com/eclipse-theia/theia/pull/8788 is merged

perrinjerome

comment created time in 11 hours

issue commenteclipse-theia/theia

vscode: support 'custom data' for HTML / CSS

@bkelley13 I updated the title, and provided some links so the issue can offer more information. The custom data contribution is not yet supported in the framework.

bkelley13

comment created time in 11 hours

push eventeclipse-theia/theia

Jérome Perrin

commit sha e616c941929ebc228208f96f5f752002e828851f

download-plugins: raise error in case of errors downloading plugins If something went wrong while downloading plugins, the build should be interrupted, instead of creating an environment where some plugins might be missing. A new --ignore-errors flag is added to retain the previous behavior of not failing the build in case of download errors. Signed-off-by: Jérome Perrin <perrinjerome@gmail.com>

view details

push time in 11 hours

PR merged eclipse-theia/theia

download-plugins: raise error in case of errors downloading plugins theia-cli

<!-- Thank you for your Pull Request. Please provide a description and review the requirements below.

Contributors guide: https://github.com/theia-ide/theia/blob/master/CONTRIBUTING.md -->

What it does

<!-- Include relevant issues and describe how they are addressed. -->

Fixes: #7819.

If something went wrong while downloading plugins, the build should be interrupted, instead of creating an environment where some plugins might be missing.

How to test

<!-- Explain how a reviewer can reproduce a bug, test new functionality or verify performance improvements. -->

One possible way is to add invalid entries in theiaPlugins from package.json, for example:

  "theiaPlugins": {
    "error-404": "https://open-vsx.org/404",
    "error-invalid-url": "not url"
  }

and use yarn download:plugins.

Without these changes, the command exits with success status code:

image

There are messages in red, yes, but the build report a success.

With the changes from this pull request, the command exit with error status code:

image

Review checklist

Reminder for reviewers

+17 -0

7 comments

3 changed files

perrinjerome

pr closed time in 11 hours

issue closedeclipse-theia/theia

As an extension developer I want yarn to fail fast if the VS Code extensions cannot be downloaded

<!-- Please provide a detailed description of the bug. -->

Bug Description:

Right now, https://open-vsx.org/ is down.

Screen Shot 2020-05-14 at 16 38 10

I want yarn to fail fast if the VS Code extension download phase has failed. Otherwise, I get a green build with a non-functional app.

Locally:

akos.kitta@Akoss-MacBook-Pro theia % rm -rf ./plugins 
akos.kitta@Akoss-MacBook-Pro theia % yarn download:plugins
yarn run v1.21.1
$ theia download:plugins
--- downloading plugins ---
+ vscode-builtin-node-debug: downloaded successfully 
x vscode-builtin-json: failed to download with: 502 Bad Gateway
x vscode-builtin-lua: failed to download with: 502 Bad Gateway
x vscode-builtin-csharp: failed to download with: 502 Bad Gateway
x vscode-builtin-yaml: failed to download with: 502 Bad Gateway
x vscode-builtin-groovy: failed to download with: 502 Bad Gateway
x vscode-builtin-clojure: failed to download with: 502 Bad Gateway
x vscode-builtin-hlsl: failed to download with: 502 Bad Gateway
x vscode-builtin-vb: failed to download with: 502 Bad Gateway
x vscode-builtin-gulp: failed to download with: 502 Bad Gateway
x vscode-builtin-handlebars: failed to download with: 502 Bad Gateway
x vscode-builtin-theme-defaults: failed to download with: 502 Bad Gateway
x vscode-builtin-markdown-language-features: failed to download with: 502 Bad Gateway
x vscode-builtin-scss: failed to download with: 502 Bad Gateway
x vscode-builtin-razor: failed to download with: 502 Bad Gateway
x vscode-builtin-fsharp: failed to download with: 502 Bad Gateway
x vscode-builtin-debug-auto-launch: failed to download with: 502 Bad Gateway
x vscode-builtin-docker: failed to download with: 502 Bad Gateway
x vscode-builtin-objective-c: failed to download with: 502 Bad Gateway
x vscode-builtin-bat: failed to download with: 502 Bad Gateway
x vscode-builtin-java: failed to download with: 502 Bad Gateway
x vscode-builtin-npm: failed to download with: 502 Bad Gateway
x vscode-builtin-configuration-editing: failed to download with: 502 Bad Gateway
x vscode-editorconfig: failed to download with: 502 Bad Gateway
x vscode-builtin-sql: failed to download with: 502 Bad Gateway
x vscode-builtin-shaderlab: failed to download with: 502 Bad Gateway
x vscode-builtin-theme-monokai-dimmed: failed to download with: 502 Bad Gateway
x vscode-builtin-emmet: failed to download with: 502 Bad Gateway
x vscode-builtin-less: failed to download with: 502 Bad Gateway
x vscode-builtin-go: failed to download with: 502 Bad Gateway
x vscode-builtin-grunt: failed to download with: 502 Bad Gateway
x vscode-builtin-merge-conflict: failed to download with: 502 Bad Gateway
x vscode-builtin-node-debug2: failed to download with: 502 Bad Gateway
x vscode-builtin-r: failed to download with: 502 Bad Gateway
x vscode-builtin-typescript: failed to download with: 502 Bad Gateway
x vscode-builtin-coffeescript: failed to download with: 502 Bad Gateway
x vscode-builtin-ini: failed to download with: 502 Bad Gateway
x vscode-builtin-theme-red: failed to download with: 502 Bad Gateway
x vscode-builtin-python: failed to download with: 502 Bad Gateway
x vscode-builtin-perl: failed to download with: 502 Bad Gateway
x vscode-builtin-shellscript: failed to download with: 502 Bad Gateway
x vscode-builtin-markdown: failed to download with: 502 Bad Gateway
x vscode-builtin-xml: failed to download with: 502 Bad Gateway
x vscode-builtin-javascript: failed to download with: 502 Bad Gateway
x vscode-builtin-theme-tomorrow-night-blue: failed to download with: 502 Bad Gateway
x vscode-builtin-theme-abyss: failed to download with: 502 Bad Gateway
x vscode-builtin-theme-quietlight: failed to download with: 502 Bad Gateway
x vscode-builtin-icon-theme-seti: failed to download with: 502 Bad Gateway
x vscode-builtin-typescript-language-features: failed to download with: 502 Bad Gateway
x vscode-builtin-theme-solarized-dark: failed to download with: 502 Bad Gateway
x vscode-builtin-swift: failed to download with: 502 Bad Gateway
x vscode-builtin-log: failed to download with: 502 Bad Gateway
x vscode-builtin-rust: failed to download with: 502 Bad Gateway
x vscode-builtin-make: failed to download with: 502 Bad Gateway
x vscode-eslint: failed to download with: 502 Bad Gateway
x vscode-builtin-ruby: failed to download with: 502 Bad Gateway
x vscode-builtin-pug: failed to download with: 502 Bad Gateway
x vscode-builtin-theme-monokai: failed to download with: 502 Bad Gateway
x vscode-builtin-theme-kimbie-dark: failed to download with: 502 Bad Gateway
x vscode-builtin-powershell: failed to download with: 502 Bad Gateway
x vscode-builtin-jake: failed to download with: 502 Bad Gateway
x vscode-references-view: failed to download with: 502 Bad Gateway
x vscode-builtin-html: failed to download with: 502 Bad Gateway
x vscode-builtin-cpp: failed to download with: 502 Bad Gateway
x vscode-builtin-css: failed to download with: 502 Bad Gateway
✨  Done in 55.92s.
akos.kitta@Akoss-MacBook-Pro theia % 

With GH Actions:

electron-app:     [path] external "path" 42 bytes {main} [built]
electron-app:     [util] external "util" 42 bytes {main} [built]
electron-app:         + 173 hidden modules
$ theia download:plugins
--- downloading plugins ---
x vscode-builtin-cpp: failed to download (after 5 attempts) { statusCode: 502, statusMessage: Bad Gateway }
x vscode-yaml: failed to download (after 5 attempts) { statusCode: 502, statusMessage: Bad Gateway }

<!-- Please provide clear steps to reproduce the bug. -->

Steps to Reproduce:

<!-- Please provide any additional information available. --> <!-- Additional information can be in the form of logs, screenshots, screencasts. -->

Additional Information

  • Operating System:
  • Theia Version:

closed time in 11 hours

kittaakos

pull request commenteclipse-theia/theia

download-plugins: raise error in case of errors downloading plugins

@vince-fugnitto thanks ! I rebased and resolved conflict on changelog

perrinjerome

comment created time in 12 hours

issue openedeclipse-theia/theia

customData for html not working

The extensions that offer html customData aren't showing popup insight for those html tags.

Bug Description:

<!-- Please provide clear steps to reproduce the bug. -->

Steps to Reproduce:

  1. Build the vscode extension for custom-data-sample from their vscode examples. (May need to update or remove publisher from package.json for this.)
  2. Install vsix.
  3. restart workspace so that extension is reloaded (the customData extensions require reloads after installation so that the pacakge.json customdata stuff is read and used by the html language extensions)
  4. Create an html file
  5. Type <my-
    You should see <my-button offered in insight, but you do not.

<!-- Please provide any additional information available. --> I can offer the above vsix file for testing, or you can try some other files that do this.

<!-- Additional information can be in the form of logs, screenshots, screencasts. -->

Additional Information

  • Operating System:
  • Theia Version:

created time in 13 hours

issue commenteclipse-theia/theia

ci: replace travis with github actions

@vince-fugnitto Good enough to close this issue?

vince-fugnitto

comment created time in 14 hours

issue commenteclipse-theia/theia

ci: replace travis with github actions

On Travis this type of glitch might have been handled by the retry. In short a small % of packages will take a little while to appear on npm, despite having been published successfully. In the case above it delayed enough for the check script to trip, but by the time I checked manually soon after, the package was visible on npm.

vince-fugnitto

comment created time in 14 hours

issue commenteclipse-theia/theia

ci: replace travis with github actions

Despite the failed status I think it worked:

   $ yarn info @theia/plugin-dev | grep "2020-12-02"
    modified: '2020-12-02T22:52:39.338Z',
    '1.9.0-next.f1e37fbd': '2020-12-02T22:52:35.351Z''
vince-fugnitto

comment created time in 15 hours

issue commenteclipse-theia/theia

ci: replace travis with github actions

I've restarted the latest job

vince-fugnitto

comment created time in 15 hours

issue commenteclipse-theia/theia

ci: replace travis with github actions

I think I have succeeded at setting the npm token, but we can confirm by confirming if next versions get published now I guess?

vince-fugnitto

comment created time in 15 hours

push eventeclipse-theia/theia

Vladyslav Zhukovskyi

commit sha 14726d663df269c9e3980f6593348edf479557c0

For testing purposes only Signed-off-by: Vladyslav Zhukovskyi <vzhukovs@redhat.com>

view details

push time in 15 hours

issue commenteclipse-theia/theia

Can't define menu items asynchronously

@akosyakov Please see here for a reproduction of this issue: https://github.com/bendavis78/theia-issue-6259.

In this example, the "Test Immediate" and "Test Async" menu items shoud show under the Help menu, however, only the "Test Immediate" menu item shows.

@injectable()
export class TheiaTest implements FrontendApplicationContribution {
    @inject(MenuModelRegistry) protected readonly menuModel: MenuModelRegistry;
    @inject(CommandRegistry) protected readonly commandRegistry: CommandRegistry;

    onStart(): void {}
    
    @postConstruct()
    init(): void {
        /**
         * Adding menu items immediately:
         */
        this.commandRegistry.registerCommand({ id: 'test-immediate-command' }, {
            execute: () => console.log('test immediate command')
        });
        this.menuModel.registerMenuAction(CommonMenus.HELP, {
            commandId: 'test-immediate-command',
            label: 'Test Immedate'
        });


        /**
         * Adding menu items asynchronously:
         */
        setTimeout(() => {
            this.commandRegistry.registerCommand({ id: 'test-async-command' }, {
                execute: () => console.log('test async command')
            });
            this.menuModel.registerMenuAction(CommonMenus.HELP, {
                commandId: 'test-async-command',
                label: 'Test Async'
            });
        }, 1000);
    }
}
smx-smx

comment created time in 17 hours

issue closedeclipse-theia/theia

Cannot register menu item asynchronously

When creating a MenuContribution + CommandContribution, I am unable to use asynchronous logic inside the registerCommands and registerMenus functions. When you use async in either function, the menus are not registered properly (they simply don't appear).

You can reproduce this by starting from generator-theia-extension using the "widget" template. Update the reigsterMenus or registerCommands functions to register asynchronously, like so:

    registerCommands(commands: CommandRegistry): void {
        setTimeout(() => {
            commands.registerCommand(TheiaTestCommand, {
                execute: () => super.openView({ activate: false, reveal: true })
            });
        });
    }

    registerMenus(menus: MenuModelRegistry): void {
        setTimeout(() => {
            super.registerMenus(menus);
        });
    }

I did some digging, and the issue appears to be with core/lib/browser/menu/browser-menu-plugin:292:

                if (!(commands.isVisible(node.action.commandId) && (!when || contextKeyService.match(when)))) {

The commands.isVisible(node.action.commandId) returns false because the command is not registered with the menu. The only place I can see where commands are registered with the menu is in MenuCommandRegistry.registerActionMenu(), and this is only called during BrowserMenuContribution.onStart().

closed time in 18 hours

bendavis78

issue commenteclipse-theia/theia

Cannot register menu item asynchronously

Duplicate of #6259.

bendavis78

comment created time in 18 hours

issue commenteclipse-theia/theia

Cannot register menu item asynchronously

@vince-fugnitto yes, that possibly could be a duplicate. You can go ahead and mark this as duplicate and I will respond on that issue.

bendavis78

comment created time in 18 hours

more