weirongxu / coc-explorer

📁 Explorer for coc.nvim
MIT License
1.15k stars 45 forks source link

[BUG] hiddenRules does not work as expected #588

Closed wxdrizzle closed 5 months ago

wxdrizzle commented 5 months ago

Describe the bug Thank you so much for this extremely helpful plugin!! My everyday's work relies on it and it works very well for almost all the functions. But seems that the setting explorer.file.hiddenRules does not work as expected. I will be very very grateful if you can take a look and provide any help for this.

I have the following configuration:

    "explorer.file.showHiddenFiles": false,
    "explorer.file.hiddenRules": {
        "extensions": [".git", "idea", "vim", "pytest_cache", "DS_Store", "vimspector.json"],
        "filenames": ["__pycache__", "pyrightconfig", "LICENSE"]
    },

and it worked very well before (for at least two years). But recently the behavior became strange, probably after I updated the plugin, as shown below:

image

It shows .git, __pychache__, .DS_Store, .gitignore; it can hide pyrightconfig.json successfully and show it after I pressed "g.". For .git I guessed maybe I need to use git rather than .git, but it still does not work.

Result from CocInfo

versions

vim version: NVIM v0.9.5 node version: v21.7.1 coc.nvim version: 0.0.82-c3ae5c3b 2024-05-23 20:39:40 +0800 coc.nvim directory: /Users/drizzle/.config/nvim/plugged/coc.nvim term: WarpTerminal platform: darwin

Log of coc.nvim

2024-06-18T12:36:15.450 INFO (pid:60724) [plugin] - coc.nvim initialized with node: v21.7.1 after 409 2024-06-18T12:36:15.451 INFO (pid:60724) [services] - LanguageClient Pyright Server state change: stopped => starting 2024-06-18T12:36:15.457 INFO (pid:60724) [language-client-index] - Language server "pyright" started with 60776 2024-06-18T12:36:15.599 INFO (pid:60724) [services] - LanguageClient Pyright Server state change: starting => running 2024-06-18T12:36:15.601 INFO (pid:60724) [services] - service pyright started 2024-06-18T12:36:15.709 INFO (pid:60724) [attach] - receive notification: runCommand [ 'explorer' ] 2024-06-18T12:36:15.730 INFO (pid:60724) [attach] - receive notification: doAutocmd [ 2, 2 ] 2024-06-18T12:36:28.940 INFO (pid:60724) [attach] - receive notification: showInfo []

Steps to reproduce Steps to reproduce the behavior:

  1. In a new folder, create two subfolders __pychache__ and .git. Create files .lvimrc, .DS_Store, .gitignore, and a main file main.py.
  2. nvim main.py
  3. Go to CocConfig, enter the settings above.
  4. Exit nvim, and do nvim main.py again.
  5. Show coc-explorer
  6. We can still see those files that should have been hidden.

Expected behavior

The files mentioned above (except for main.py) should be hidden in the file tree. Particularly, .gitignore should be hidden because I never modified patternMatches in explorer.file.hiddenRules.

wxdrizzle commented 5 months ago

I have tried to install an older version. I can confirm that this issue can be resolved by installing v0.26.7, and once I installed v0.27.0 the issue appears. So probably this is related to changes made by v0.27.0.

wxdrizzle commented 5 months ago

Confirmed that the new version 0.27.3 resolved this. Thank you for the quick support!!