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

[FR] fallback vs. shared commands #45

Open
huyz opened this issue Nov 7, 2022 · 5 comments
Open

[FR] fallback vs. shared commands #45

huyz opened this issue Nov 7, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@huyz
Copy link

huyz commented Nov 7, 2022

Right now it seems that this extension supports a fallback: if I have * as the extensionName and the current file's extension doesn't match any other rule, then this fallback rule works. That's great. (By the way, I didn't see that documented, so I had to guess and I was pleasantly surprised that it worked.)

However, I'd also like to have a set of editors that apply to all extensions, even if there is a match. For example, I want to have MacVim as an option for all extensions. But if I'm invoking on an md file, I will only get my configured MarkText as a command.

The workaround is for me is to duplicate the MacVim command under both the md and the * rules.

So in addition to supporting a * rule, maybe there should be a _common_ or _all_ rule

@tjx666
Copy link
Owner

tjx666 commented Nov 7, 2022

For example:

"openInExternalApp.openMapper": [
        {
            "extensionName": ["jsxbin", "jsx"],
            "apps": "Adobe Photoshop 2022",
        },
        {
            "extensionName": "shared",
            "apps": "MacVim"
        }
    ],

When I open .jsxbin file, will both open Photoshop and MacVim?

@tjx666 tjx666 added the enhancement New feature or request label Nov 7, 2022
@huyz
Copy link
Author

huyz commented Nov 7, 2022

Yes, like that. But of course with a special extensionName that isn't like to conflict; so something like noticeable like _ALL_

tjx666 pushed a commit that referenced this issue Nov 28, 2022
@tjx666
Copy link
Owner

tjx666 commented Nov 29, 2022

This is also supported in latest version by extensionName __ALL__

@huyz
Copy link
Author

huyz commented Nov 29, 2022

This doesn't work for me:

  "openInExternalApp.openMapper": [
    {
      "apps": [
        {
          "shellCommand": "mvim --servername Code --remote-tab-silent '+chdir ${fileWorkspaceFolder}|call cursor(${cursorLineNumber},${cursorColumnNumber})|call feedkeys(\"z.\")' '${file}'",
          "title": "MacVim"
        },
        {
          "shellCommand": "vimr --remote-tab-silent --nvim '+chdir ${fileWorkspaceFolder}|call cursor(${cursorLineNumber},${cursorColumnNumber})|normal z.' '${file}'",
          "title": "VimR"
        },
        {
          "shellCommand": "idea --line ${cursorLineNumber} '${fileWorkspaceFolder}' '${file}'",
          "title": "IntelliJ IDEA"
        }
      ],
      "extensionName": "__ALL__"
    },

It's not possible to have shellCommands be inherited?

@tjx666
Copy link
Owner

tjx666 commented Dec 24, 2022

You want all the apps to be executed? Anytime pr welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants