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

Pass ignore patterns obtained from ST to the file watcher #1823

Merged
merged 4 commits into from
Aug 15, 2021

Conversation

rchl
Copy link
Member

@rchl rchl commented Aug 14, 2021

No description provided.

sublime_pattern_to_glob(pattern, is_directory_pattern=False, root_path=root_path)
for pattern in globalprefs().get('file_exclude_patterns')
]
return folder_excludes + file_excludes + ['**/node_modules/**']
Copy link
Member Author

@rchl rchl Aug 14, 2021

Choose a reason for hiding this comment

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

I guess it's kinda weird that I'm forcing node_modules to be ignored but it's kinda the "right" thing to do as nothing should need to watch it and there would be a ton of events triggered on running "npm i" or similar otherwise.

for folder in self.get_workspace_folders():
ignores = config.get('ignores') or self._get_global_ignore_globs(folder.path)
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure how to exactly handle the situation when the ignores is specified in the config. Whether all of those should be combined or not. If we combine then there will be no way to opt-out of the excluded patterns.

Copy link
Member

Choose a reason for hiding this comment

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

I would leave as is. (I would just add a comment above with the explanation why they are not combined)

Comment on lines +76 to +79
"""
Convert a Sublime Text pattern (http://www.sublimetext.com/docs/file_patterns.html)
to a glob pattern that utilizes globstar extension.
"""
Copy link
Member

Choose a reason for hiding this comment

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

Should this be used in windows.py as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

How would you use it there? Convert to glob and then how match the glob to file path?

@rwols rwols merged commit ee14188 into main Aug 15, 2021
@rwols rwols deleted the fix/read-st-patterns branch August 15, 2021 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants