Bug 495891 - "exclude_patterns" does not work
Summary: "exclude_patterns" does not work
Status: RESOLVED WORKSFORME
Alias: None
Product: kate
Classification: Applications
Component: application (show other bugs)
Version: 24.08.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-06 19:01 UTC by Majid Madadi
Modified: 2024-11-06 22:12 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
quick open lists all package.json files inside node_modules folder (676.95 KB, image/png)
2024-11-06 19:01 UTC, Majid Madadi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Majid Madadi 2024-11-06 19:01:15 UTC
Created attachment 175594 [details]
quick open lists all package.json files inside node_modules folder

SUMMARY
I have created .kateproject file with the following content but "exclude_patterns": [ "^node_modules" ] does not work. Without being able to exclude node_module folder, using quick open (ctrl+shift+o) is useless as thousands of files are listed. My .kateproject file content is as follows:
```
{
  "exclude_patterns": ["^node_modules"]
}
```

OBSERVED RESULT
include node_modules

EXPECTED RESULT
exclude node_modules

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: 
KDE Plasma Version: 6.2.2
KDE Frameworks Version: 6.7.0
Qt Version: 6.8.0
Comment 1 Waqar Ahmed 2024-11-06 19:27:19 UTC
You need a better regex. See the base path (in front of package.json):

Projects/remix/remix-start/node_modules

The "^node_modules" will match only if "node_module" was at the top of your project i.e., "node_modules/package.json. Probably just 

{
  "exclude_patterns": ["Projects/remix/remix\-start/node_modules"]
}

will work
Comment 2 Majid Madadi 2024-11-06 22:12:30 UTC
(In reply to Waqar Ahmed from comment #1)
> You need a better regex. See the base path (in front of package.json):
> 
> Projects/remix/remix-start/node_modules
> 
> The "^node_modules" will match only if "node_module" was at the top of your
> project i.e., "node_modules/package.json. Probably just 
> 
> {
>   "exclude_patterns": ["Projects/remix/remix\-start/node_modules"]
> }
> 
> will work

It did not work. I also tested "*node_modules*" and it did not work.