antfu / vscode-iconify

🙂 Iconify IntelliSense for VS Code
https://marketplace.visualstudio.com/items?itemName=antfu.iconify
MIT License
474 stars 36 forks source link

Reload when files `customCollectionJsonPaths` updated #89

Closed s3xysteak closed 2 weeks ago

s3xysteak commented 1 month ago

Clear and concise description of the problem

Assume the config is:

{
  "iconify.customCollectionJsonPaths": [
    "icons/test.json"
  ],
}

And the icons/test.json looks like:

{
  "icons": {
      "foo": {
         // ...
      }
  },
  "prefix": "test"
}

I can use i-test-foo to have the intellisense.

Now I update the icons/test.json:

{
  "icons": {
      "foo": {
         // ...
      },
      "bar": {
         // ...
      }
  },
  "prefix": "test"
}

To use i-test-bar, I have to use command Developer: Reload Window or restart the vscode. I think it will be so good if vscode-iconify could reload automatically when icons/test.json was updated.

Suggested solution

I am not familiar with reactive-vscode but I found a function useFsWatcher it provided, which looks like watch in node:fs. I think that could be helpful.

Alternative

No response

Additional context

No response

Validations