Skip to content

Commit

Permalink
🎨 Switch to picomatch
Browse files Browse the repository at this point in the history
  • Loading branch information
misode committed Jan 3, 2025
1 parent da865cd commit b3d28de
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 40 deletions.
70 changes: 35 additions & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"chokidar": "^3.5.2",
"decompress": "^4.2.1",
"follow-redirects": "^1.14.8",
"micromatch": "^4.0.8",
"picomatch": "^4.0.2",
"pako": "^2.0.4",
"rfdc": "^1.3.0",
"vscode-languageserver-textdocument": "^1.0.4",
Expand All @@ -28,7 +28,7 @@
"devDependencies": {
"@types/decompress": "^4.2.3",
"@types/follow-redirects": "^1.14.1",
"@types/micromatch": "^4.0.9",
"@types/picomatch": "^3.0.1",
"@types/pako": "^2.0.0",
"@types/whatwg-url": "^11.0.4"
},
Expand Down
6 changes: 5 additions & 1 deletion packages/core/src/service/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,11 @@ export const VanillaConfig: Config = {
env: {
dataSource: 'GitHub',
dependencies: ['@vanilla-datapack', '@vanilla-resourcepack', '@vanilla-mcdoc'],
exclude: ['.*/**'],
exclude: [
'.*/**',
'**/node_modules/**',
'**/__pycache__/**',
],
customResources: {},
feature: {
codeActions: true,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/service/Project.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as micromatch from 'micromatch'
import picomatch from 'picomatch'
import type { TextDocumentContentChangeEvent } from 'vscode-languageserver-textdocument'
import { TextDocument } from 'vscode-languageserver-textdocument'
import type { ExternalEventEmitter, Externals, FsWatcher, IntervalId } from '../common/index.js'
Expand Down Expand Up @@ -972,7 +972,7 @@ export class Project implements ExternalEventEmitter {
return false
}
for (const rel of fileUtil.getRels(uri, this.projectRoots)) {
if (micromatch.any(rel, this.config.env.exclude)) {
if (picomatch(this.config.env.exclude, { dot: true, posixSlashes: false })(rel)) {
return true
}
}
Expand Down

0 comments on commit b3d28de

Please sign in to comment.