-
Notifications
You must be signed in to change notification settings - Fork 85
Glob patterns #100
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
Glob patterns #100
Conversation
src/fetcher.ts
Outdated
const includeGlobPattern = vscode.workspace.getConfiguration().get('html-css-class-completion.includeGlobPattern'); | ||
const excludeGlobPattern = vscode.workspace.getConfiguration().get('html-css-class-completion.excludeGlobPattern'); | ||
|
||
return await vscode.workspace.findFiles(`${includeGlobPattern}.{${languages}}`, `${excludeGlobPattern}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the user decides to set the html-css-class-completion.includeGlobPattern
setting to something like **/*.scss
it will cause problems in the default pattern used inside the extension, resulting in something like **/*.scss.{css,html}
, therefore, invaliding the search as a whole.
The change I'd like to suggest is to replace the default include pattern used by the extension whenever the user sets it through the html-css-class-completion.includeGlobPattern
setting, just like you're doing for the excludeGlobPattern
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good points, i ll update my PR..
package.json
Outdated
}, | ||
"html-css-class-completion.excludeGlobPattern": { | ||
"type": "string", | ||
"default": "node_modules∕*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some people might be using npm to install front-end dependencies, it's better to keep ""
as the default value. The performance problems related to memory and CPU usage were minimized by this change #90 already.
package.json
Outdated
"properties": { | ||
"html-css-class-completion.includeGlobPattern": { | ||
"type": "string", | ||
"default": "**/*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the default value should be same as the one used internally by the extension: **/*.{css,html}
.
Sorry for taking this long to reply, I could only find some time to review it on my weekend. |
Pull request updated |
@zignd @pungggi How can I exactly use this configuration? I tried all of the following: "css-class-completion.includeGlobPattern": ".meteor/local/build/programs/web.browser/merged-stylesheets.css",
"html-css-class-completion.includeGlobPattern":
".meteor/local/build/programs/web.browser/merged-stylesheets.css",
"css-class-completion.includeGlobPattern": {
"default": ".meteor/local/build/programs/web.browser/merged-stylesheets.css",
}
"html-css-class-completion.includeGlobPattern": {
"default": ".meteor/local/build/programs/web.browser/merged-stylesheets.css",
} But none work. In the code it's referred to as
HTML-CSS-Class-Completion/package.json Line 35 in 043fe52
But in the readme it's css-class-completion.includeGlobPattern :https://github.com/zignd/HTML-CSS-Class-Completion#usage |
Hi @vfonic, I have not released it yet. For some reason and I can't remember why. Anyway, thanks pointing out the error in the README.md, I will fix it and release a version containing this feature right now. If you check the README.md in the Marketplace, you will notice it doesn't have this section. Regarding the usage, you need to use glob patterns, just like you do in the Search sidebar. You can also use multiple patterns and separate them by commas. |
not work... |
This will solve a lot of pending issues related to high cpu usage, crashes and the need to exclude some folders. Especially the node_modules folder that, how state in some comments, should be excluded by default.
The PR creates an config option to exclude and one to only include a path to parse.
They can defined as Glob Patterns.
These are the issues that eventually can be closed:
#91
#62
maybe #64 ?
#47
#31
#27