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

Allow wildcards in files association #93

Closed
miguelsolorio opened this issue May 30, 2023 · 9 comments
Closed

Allow wildcards in files association #93

miguelsolorio opened this issue May 30, 2023 · 9 comments
Labels
feature request Request for new functionality
Milestone

Comments

@miguelsolorio
Copy link
Owner

It would be great to add * support for files association like:

  "symbols.files.associations": {
    "*.module.ts": "ts",
  }

as right now you have to match the exact name for it to work (app.module.ts), which can get tedious.

FYI @wladimirgrf

@miguelsolorio miguelsolorio added the feature request Request for new functionality label May 30, 2023
@wladimirgrf
Copy link
Contributor

Nice, it's a good feature, I can take a look at how to implement it.

@miguelsolorio
Copy link
Owner Author

Started looking into this and this is not supported by the VS Code extension API microsoft/vscode#12493

@wladimirgrf
Copy link
Contributor

Maybe there is a way to do it, material-icon-theme has that feature.

About the #92, did you test it? It work fine for you?

@miguelsolorio
Copy link
Owner Author

miguelsolorio commented May 31, 2023

They have the same issue material-extensions/vscode-material-icon-theme#330 and yes the current file association works, you have to match the name exactly.

Edit: Sorry, you are right in that they support this, it's the glob patterns that are not supported like **/**/*.json

@wladimirgrf
Copy link
Contributor

Yes, we can make the simplest version, it already solves most cases.
I asked about the last PR, because I'm testing the official extension and I need to reload the window every time I change the settings.json (to update the icons).

@miguelsolorio
Copy link
Owner Author

Ah, I thought that was the expected behavior? At least when I tested it with the material icons it also worked the same way (icon only changes after reload)

@wladimirgrf
Copy link
Contributor

hmm I see, I wasn't 100% sure how it would look after publishing.
This is the first extension project for VsCode that I work on.

The idea was to behave exactly like material-icons, as soon as the settings.json is updated so is the icon.

I will try to do this. If everything goes well I'll open another PR.

@zm-cttae
Copy link

zm-cttae commented Jun 11, 2023

*.module.ts is just a non-standard fileExtensions key - ".module.ts" to be fair!

@miguelsolorio
Copy link
Owner Author

miguelsolorio commented Jun 12, 2023

You can use * in files association using the following setting configuration thanks to @wladimirgrf's PR #101:

"symbols.files.associations": {
    "*.service.ts": "nest"
},

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

No branches or pull requests

3 participants