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
+5-23Lines changed: 5 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,12 +12,12 @@ Every powershell file is considered a possible command.
12
12
When you write a special comment in your code it will add the result to the file:
13
13
14
14
```csharp
15
-
//lsb: collection of IWhatever
15
+
//lsb: collection.ps1 "IWhatever"
16
16
```
17
17
18
18
It will parse that line and convert it into the following command:
19
19
```
20
-
collection.ps1 -of IWhatever
20
+
collection.ps1 "IWhatever"
21
21
```
22
22
23
23
The powershell script will then output some things to stdout which will be collected:
@@ -31,35 +31,17 @@ public class WhateverCollection {
31
31
}
32
32
```
33
33
34
-
The text will then end up below the comment:
34
+
The comment will then be replaced by the content the script delivered:
35
35
```
36
-
// lsb: collection of IWhatever
37
36
public class WhateverCollection {
38
37
private List<IWhatever> data = new List<IWhatever>();
39
38
40
39
public WhateverCollection()
41
40
{
42
41
}
43
42
}
44
-
// end ļsb
45
43
```
46
44
47
-
You can now change your command as often as you like. The text between the `lsb` command line and `end lsb` will be replaced every time
48
-
the file is saved again.
49
-
50
-
When you like your code, simply add an exclamation mark to the end of the lsb command line:
51
-
```
52
-
// lsb: collection of IWhatever!
53
-
public class WhateverCollection {
54
-
private List<IWhatever> data = new List<IWhatever>();
55
-
56
-
public WhateverCollection()
57
-
{
58
-
}
59
-
}
60
-
// end ļsb
61
-
```
62
-
63
-
This will remove the lsb line itself as well as the `end lsb` line leaving the new code block where it is.
64
-
45
+
This "template plugin" allows for a lot of automation since we are using powershell in the backend which is fully fledged and can tap into the .net framework as a huge library.
65
46
47
+
Also it works with any editor you like, as long as it allows for auto-reloading changes that have taken place outside of the editor. VSCode and Visual Studio both do.
0 commit comments