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
Copy file name to clipboardExpand all lines: README.md
+34-3Lines changed: 34 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,16 @@ like `ctrl+alt+n` on Windows
29
29
30
30
## Creating multiple files
31
31
32
-
Creating multiple files in one prompt requires you to use a comma in the input field. The comma can be top level, or can be nested within a set of curly brackets(`{}`)
32
+
Creating multiple files in one prompt requires you to use a comma in the input field. The comma can be top level, or can be nested within a set of curly brackets(`{}`); e.g.
These follow the same rules as the rest of the extension: if it matches an alias, it will be created from the given directory the alias is associated with.
35
44
Otherwise it will be based on the current file.
@@ -42,17 +51,27 @@ Otherwise it will be based on the current file.
**NOTE**: by default the aliases begin with `$`, this is to mimic bundlers to some degree, but there is no hard rule that your aliases must begin with the the `$` symbol.
59
+
48
60
## Aliases
49
61
50
-
Aliases should be unique among themselves and ***not*** nested. Both the shortcut and the expanded value should end with slashes
62
+
Aliases should be unique among themselves and ***not*** nested. Both the shortcut and the expanded value should end with slashes.
63
+
64
+
### Wildcard Matches
65
+
Wildcard matches have been implemented recently, extending the syntax and unlocking setups for monorepos or specific nested file structures.
66
+
67
+
The key for a wildcard match should contain one or more asterisks (`*`), and the replacement matcher should use the dollar sign, followed by a corresponding match number, e.g.
68
+
`"@*/*/": "${workspaceRoot}/packages/$1/src/$2/`. These matches should still follow other rules for aliases.
51
69
52
70
### ✅ Examples of good aliases
53
71
54
72
```json
55
73
"lnf.aliases": {
74
+
"$src/*/": "${workspaceRoot}/src/$1/",
56
75
"$src/": "${workspaceRoot}/src/",
57
76
"$lib/": "${workspaceRoot}/lib/"
58
77
}
@@ -64,6 +83,18 @@ Aliases should be unique among themselves and ***not*** nested. Both the shortcu
64
83
"lnf.aliases": {
65
84
"$src/": "${workspaceRoot}/src",
66
85
// This item will never be matched because the extensions exists on first match
67
-
"$src/lib": "${workspaceRoot}/src/lib"
86
+
"$src/*/": "${workspaceRoot}/src/$1/",
87
+
"$src/lib/": "${workspaceRoot}/src/lib/"
88
+
}
89
+
```
90
+
91
+
## Workspaces
92
+
93
+
If you are working a repository that utilizes workspaces, where there are multiple
94
+
packages and apps, it can be useful to have it so that your aliases become aware of that.
0 commit comments