You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not quite sure how to express this, but the useIgnoreFiles option is quite complex and I'm not sure if it's necessary to be so complex. If I understand its purpose correctly, the findFiles2New API will by default do some filtering on top of the disk. In other words, it will respect whatever settings are defined in the workspace or defined by the user w.r.t. ignoring files.
Then, useIgnoreFiles is a mechanism to ask the vscode API to ignore the settings and be 100% transparent and just return whatever the disk has.
My question is: how could an extension author know if they should set useIgnoreFiles.parent to false? How about useIgnoreFiles.global? These two settings seem to be extremely personal to the user that has decided to check out the repository in a folder where they define an ignore file. Or maybe they have a global ignore file. But how could an extension author know what kind of setup they're dealing with?
So I'd suggest simplifying the API, allow extension authors to either opt for the "on disk" no-filters file search or for the "user configured" filter. Also, I think a better name for such a simplified setting might be respectUserDefinedFilters, respectConfigurationFilters or disableFilters, disableConfigurationFilters...
Edit: Looking at useExcludeSettings, the same situation appears. How should I, as an extension author, know which value to use ExcludeSettingOptions.FilesExclude vs ExcludeSettingOptions.SearchAndFilesExclude and why isn't there a ExcludeSettingOptions.SearchExclude.
I feel that the API is quite complex and I'm not sure if such complexity is required. Maybe you have use-cases in mind for all these settings?
The text was updated successfully, but these errors were encountered:
I actually had this discussion with others before #205692.
My question is: how could an extension author know if they should set useIgnoreFiles.parent to false? How about useIgnoreFiles.global? These two settings seem to be extremely personal to the user that has decided to check out the repository in a folder where they define an ignore file. Or maybe they have a global ignore file. But how could an extension author know what kind of setup they're dealing with?
I guess that these are options that ripgrep provides and are configured in settings, so we should give the extension authors the right to overwrite it. If I think about it more, it's less about "I need global ignore files" (for example) and more like "I want to make the searches consistent for everyone, regardless of which ignore settings that they have, so I'll give them a default value that makes sense to me"
Looking at useExcludeSettings, the same situation appears. How should I, as an extension author, know which value to use ExcludeSettingOptions.FilesExclude vs ExcludeSettingOptions.SearchAndFilesExclude and why isn't there a ExcludeSettingOptions.SearchExclude.
There isn't a ExcludeSettingOptions.SearchExclude because there's no way in the UI to do that. The search.excludes setting itself says that it inherits the files.excludes. I don't have a particular use case for this, but I'd imagine that using ExcludeSettingOptions.SearchAndFilesExclude is like saying "I'll only search where vscode usually looks when it does a workspace search (ie: ignore node modules)", whereas ExcludeSettingOptions.FilesExclude means "I only want to search in what is visible in the file explorer".
Testing #226670
I'm not quite sure how to express this, but the
useIgnoreFiles
option is quite complex and I'm not sure if it's necessary to be so complex. If I understand its purpose correctly, thefindFiles2New
API will by default do some filtering on top of the disk. In other words, it will respect whatever settings are defined in the workspace or defined by the user w.r.t. ignoring files.Then,
useIgnoreFiles
is a mechanism to ask the vscode API to ignore the settings and be 100% transparent and just return whatever the disk has.My question is: how could an extension author know if they should set
useIgnoreFiles.parent
to false? How aboutuseIgnoreFiles.global
? These two settings seem to be extremely personal to the user that has decided to check out the repository in a folder where they define an ignore file. Or maybe they have a global ignore file. But how could an extension author know what kind of setup they're dealing with?So I'd suggest simplifying the API, allow extension authors to either opt for the "on disk" no-filters file search or for the "user configured" filter. Also, I think a better name for such a simplified setting might be
respectUserDefinedFilters
,respectConfigurationFilters
ordisableFilters
,disableConfigurationFilters
...Edit: Looking at
useExcludeSettings
, the same situation appears. How should I, as an extension author, know which value to useExcludeSettingOptions.FilesExclude
vsExcludeSettingOptions.SearchAndFilesExclude
and why isn't there aExcludeSettingOptions.SearchExclude
.I feel that the API is quite complex and I'm not sure if such complexity is required. Maybe you have use-cases in mind for all these settings?
The text was updated successfully, but these errors were encountered: