Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add folder_include_patterns and file_include_patterns #129

Open
wants to merge 8 commits into
base: sublime-text-3
Choose a base branch
from
51 changes: 46 additions & 5 deletions source/file_management/file_management.rst
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,52 @@ and ``build_systems``, for project-specific build systems.


**Folders**
Each folder must have a ``path``,
and may optionally have a ``folder_exclude_patterns``
and ``file_exclude_patterns`` setting.
The path may be relative to the project directory,
or an absolute path.
Each folder must have a ``path``, that may be absolute or
relative. In the latter case it will be relative to the
project directory.

There are also the optional properties ``folder_include_patterns``,
``file_include_patterns``, ``folder_exclude_patterns``
and ``file_exclude_patterns``. They all admit an array of strings
as values, and understand basic globbing syntax, such as "*.html".

The ones that include files and folders, work by excluding
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are referring to the "patterns" here, not the settings. While it can be interpreted to be the patterns, explicitly mentioning it is better. (It confused me at first.)
Same for the second part of this paragraph.

everything first, so that in the end only what they specify
gets shown. After those, the ones that exclude folders apply,
though with lesser precedence.

Note that a pattern that includes any folder in the project
directory will not automatically include every of it's sub-folders,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*its

but including theese will include any other descendants.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This paragraph does not make 100% sense to me. Mind explaining?

Also *these

Edit: It appears you are explaining it below but it doesn't completely get through. I think we need to reword this.


For example, consider adding the following to a folder:

.. sourcecode:: javascript
{
"folders":
[
{
"path": ".",
"folder_include_patterns": ["foo"]
}
}

If the folder "foo" is included, that will by itself include
any other folder whose name starts with foo, whether it is in
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double spaces here

the project folder, or inside some other folder. But, the folder
"bar" inside the "folder "foo" that resides in the project folder
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-"

So, do you mean a folder foo/bar here? Writing that would be easier to understand than the long sentence.

Do it like so: :file:foo/bar``

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not being able to make :file:foo/bar`` work I'm afraid

will not be included automatically, whereas another folder called
"bar" or any other name in some other "foo" folder nested deeper
**wll** be included by this definition. If you want to include
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*will

every sub-folder form a folder residing in the project folder,
you can use something like "["foo", foo/*]".
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use literal blocks for this: ["foo", "foo/*"]


Note also that a rule like the one in the prevous example would
not let us exclude an already included "foo" sub-folder through
the use of "folder_exclude_patterns", no matter the specificity
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and below, please make use of literal blocks, so folder_exclude_patterns and :file:baz/bar/foo``.

of the rule (for example "baz/bar/foo"). Consider that includes
have precedence over includes.

Folders may also be given a ``name``
that will appear in the side bar.

Expand Down