Reputation: 4450
I want to hide auto generated dart files like .g.dart
, .freezed.dart
from vs code project. How to do that?
Upvotes: 13
Views: 7944
Reputation: 180885
In v1.67 you can create an entry in the
Explorer > File Nesting: Patterns
setting like so:
*.dart
$(capture).g.dart, $(capture).freezed.dart
explorer.fileNesting.enabled
: Controls whether file nesting is enabled
explorer.fileNesting.expand
: Controls whether file nests show as expanded by default
explorer.fileNesting.patterns
: Controls how files get nested
In addition the Explorer: Sort Order
setting has a new option:
foldersNestsFiles
: Files and folders are sorted by their names. Folders are displayed before files. Files with nested children are displayed before other files.
sortOrder.foldersNestsFiles
See also v1.67b Release Notes: File Nesting
Make sure you have Explorer > File Nesting: Enabled
true
Upvotes: 22
Reputation: 1683
create a folder
.vscode
create
settings.json
put this:
{
"files.exclude": {
"**/*.freezed.dart": true,
"**/*.g.dart": true
},
}
this make local configuration in your project.
Upvotes: 24
Reputation: 874
Type Ctrl/Cmd + Shift + p
, choose Preferences: Open Settings (JSON)
or Preferences: Open Workspace Settings (JSON)
and add:
"files.exclude": {
"**/*.freezed.dart": true,
"**/*.g.dart": true
},
You can add more patterns if you like. Here you can find more information about the patterns.
You can configure this in your workspace or user settings:
Open settings: Ctrl/Cmd + Shift + p
and search for 'Preferences: Open Settings'. You can choose from 'Workspace Settings' or your 'User Settings', depending on if you want to exclude the files just in your current project (workspace) or for all projects. And you can choose if you want to use the UI tool or to modify the settings json file manually.
Search for files.exclude
and you can add patterns you want to hide in the project explorer. In your case add **/*.freezed.dart
and **/*.g.dart
, but you can exclude any pattern you like.
Type Ctrl/Cmd + Shift + p
and search for 'Preferences: Open Settings (JSON)' or Preferences: Open Workspace Settings (JSON)
. Again, depending on if you want to exclude the files just in your current project (workspace) or for all projects.
Add this part to the json file:
"files.exclude": {
"**/*.freezed.dart": true,
"**/*.g.dart": true
},
Or add just the pattern lines, if files.exclude
is already present in the settings.json file.
Upvotes: 9
Reputation: 111
"On Mac. Open VSCode, Type Shift+Command+P, Preferences: Configure, Language Specific Settings, Choose the Language (Dart), Then add to file "
"files.exclude": { "/.git": true, "/.svn": true, "/.hg": true, "/CVS": true, "/.DS_Store": true, "/*.g.dart":true, }
Upvotes: 2