eclipse-theia / theia

Eclipse Theia is a cloud & desktop IDE framework implemented in TypeScript.
http://theia-ide.org
Eclipse Public License 2.0
19.29k stars 2.45k forks source link

Open With... not working on folders #13838

Open bhufmann opened 1 week ago

bhufmann commented 1 week ago

Bug Description:

Open With -> Trace Viewer of the Theia Trace Viewer doesn't work anymore starting with Theia version 1.50.0. This feature allowed users to open traces that are files as well as traces that are folders. The limitation should be put back or alternatively make OpenWidthHandler configurable for files or folders or both (default files only):

this.openWithService.registerHandler({
            id: this.id + '-open-with',
            label: this.label,
            providerName: 'Theia Trace Viewer',
            appliesToFiles: true, // <----- suggestion
            appliesToFolders: true, // <----- suggestion
            canHandle: (uri: URI) => this.canHandle(uri),
            open: (uri: URI) => this.open(uri)
        });

Steps to Reproduce:

  1. Build and run the Theia trace viewer with PR https://github.com/eclipse-cdt-cloud/theia-trace-extension/pull/1087
  2. Right mouse-click on a folder
  3. "Open With..." is not shown

Additional Information

JonasHelming commented 1 week ago

@msujew

msujew commented 1 week ago

Sure, that sounds pretty reasonable to me. @bhufmann Interested in contributing something for this?

bhufmann commented 1 week ago

I'm not really familiar with Theia internals. It would be probably faster if you @msujew implement it :-)

I had a quick look, and thought it would be just updating getHandler() and check if the URI points to folder and check if the handler is configured for folders and then include it or not. What is a quick way to check if the uri points to a file or folder? Please let me know.