AtomMaterialUI / a-file-icon-idea

Atom Material Icons for JetBrains - Replace File and UI Icons for better visual grepping.
http://www.material-theme.com/docs/configuration/icons-settings/#atom-material-icons-plugin
MIT License
220 stars 27 forks source link

TypeScript files have RxJS icons #341

Closed lsalazarm99 closed 1 year ago

lsalazarm99 commented 1 year ago

Describe the bug TypeScript files have RxJS icons. Even after using the "Reset Default Associations" buttons, they still have RxJS icons.

The pattern for RxJS icons is rxjs\.[jt]s$. The pattern for TypeScript is .*\.(ts|tslint)$.

To Reproduce

  1. Install the plugin.
  2. Create a TS file.

Expected Behavior TypeScript files have TypeScript icons.

Environment WebStorm 2022.3.1 Build #WS-223.8214.51, built on December 20, 2022 Runtime version: 17.0.5+1-b653.23 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Windows 11 10.0 GC: G1 Young Generation, G1 Old Generation Memory: 2048M Cores: 12 Registry: debugger.new.tool.window.layout=true ide.experimental.ui=true ide.balloon.shadow.size=0

Non-Bundled Plugins: com.markskelton.one-dark-theme (5.7.2) ru.adelf.idea.dotenv (2022.3) com.almightyalpaca.intellij.plugins.discord (1.11.0) com.mallowigi (84.0.0)

welcome[bot] commented 1 year ago

Thanks for opening your first issue here! Be sure to follow the issue template!

mallowigi commented 1 year ago

This is probably because you have a parent folder from one of the usual rxjs folders: actions, entities...

Correct me if I'm wrong. And you can disable it in the custom associations.

lsalazarm99 commented 1 year ago

Well, even the TypeScript files in the root of my project (which is not named as any RxJS folder) have the RxJS icon. 😞

Thanks for the workaround too!

mallowigi commented 1 year ago

Ok I think I found the cause... stupid typo

pattern=".*/(repos?|repository|repositories)?/.*\.[tj]sx?$"

The ? makes the whole folder optional xD

I'll fix it tomorrow and try to fasten the deployment

azappa commented 1 year ago

I've updated the plugin today but seems the bug still be there.

mallowigi commented 1 year ago

Can you check in the custom associations if the aforementioned faulty association is still there?

IGassmann commented 1 year ago

This is also happening because all my local repositories are located in the directory: /Users/[username]/Repositories/.

@mallowigi, the solution might be to exclude from the pattern matching the parent path segments from the project directory and instead only match it against path segments that are within the project directory.

My TypeScript project is located at: /Users/[username]/Repositories/my-typescript-project/. My TypeScript file is at the path: /Users/[username]/Repositories/my-typescript-project/src/index.tsx.

The "NgRx Repositories Files" pattern (*/(repos?|repository|repositories)/.*\.[tj]sx?$) is matching against the full absolute path of where my TypeScript file is located.

Instead of match the pattern against:

/Users/[username]/Repositories/my-typescript-project/src/index.tsx.

...match it against:

/src/index.tsx.

mallowigi commented 1 year ago

Aha good catch... currently it looks in all subfolders of the parent pattern...

It's a bit problematic to restrict the scope, JB doesn't have a concept of scope to begin with. But one solution would be to restrict the children.

So instead of /(repos?|repository|repositories)/.*\.[tj]sx?$ it would be more like /(repos?|repository|repositories)/[^/]*\.[tj]sx?$

This would only target immediate children

mallowigi commented 1 year ago

But to do so would require to change all parent folder patterns... if you could do a PR that would be truly helpful ^^

stale[bot] commented 1 year ago

This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.