File tree Expand file tree Collapse file tree 4 files changed +25
-1
lines changed Expand file tree Collapse file tree 4 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,14 @@ vscode-hex-casting now supports Hex Casting 0.11.2 for Minecraft 1.20.1! This is
35
35
"hex-casting.disabledModIds" : [" hexal" , " moreiotas" ]
36
36
}
37
37
```
38
+ - Added support for setting the description of macros. Any lines starting with ` /// ` immediately after the macro definition will be included as Markdown. For example:
39
+ ```
40
+ #define My Macro (EAST aqweds) = int -> str
41
+ /// **Description line 1.**
42
+ /// More text on description line 1.
43
+ ///
44
+ /// Description line 2.
45
+ ```
38
46
39
47
### Changes
40
48
Original file line number Diff line number Diff line change @@ -962,10 +962,18 @@ async function refreshDirectivesAndDiagnostics(
962
962
return ;
963
963
}
964
964
965
+ let descriptionLines = [ ] ;
966
+ for ( let i = lineIndex + 1 ; i < document . lineCount ; i ++ ) {
967
+ const line = document . lineAt ( i ) . text . trim ( ) ;
968
+ if ( ! line . startsWith ( "///" ) ) break ;
969
+ descriptionLines . push ( line . slice ( 3 ) . trimStart ( ) ) ;
970
+ }
971
+
965
972
newMacroRegistryWithImports [ translation ] = newMacroRegistry [ translation ] = new MacroPatternInfo ( {
966
973
translation,
967
974
direction,
968
975
signature,
976
+ description : descriptionLines . join ( "\n" ) || undefined ,
969
977
inputs,
970
978
outputs,
971
979
} ) ;
Original file line number Diff line number Diff line change @@ -89,12 +89,14 @@ export class MacroPatternInfo {
89
89
translation,
90
90
direction,
91
91
signature,
92
+ description,
92
93
inputs,
93
94
outputs,
94
95
} : {
95
96
translation : string ;
96
97
direction ?: Direction ;
97
98
signature ?: string ;
99
+ description ?: string ;
98
100
inputs ?: string ;
99
101
outputs ?: string ;
100
102
} ) {
@@ -103,7 +105,7 @@ export class MacroPatternInfo {
103
105
this . signature = signature ?? null ;
104
106
this . operators = [
105
107
{
106
- description : null ,
108
+ description : description ?? null ,
107
109
inputs : inputs ?? null ,
108
110
outputs : outputs ?? null ,
109
111
book_url : null ,
Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ Imported
7
7
#define Foo's Reflection = int ->[str]*/
8
8
#define (e) = int->[str]
9
9
#define Foo's Reflection (northeast aqweds) = int->[str] //
10
+ /// **Description line 1.**
11
+ /// More text on description line 1.
12
+ ///
13
+ /// Description line 2.
10
14
#define Foo's Reflection1 (nse aaa) = int ->[str]
11
15
#define Foo's Reflection2 (w) = int -> [str]
12
16
#define Foo's Reflection3 (se d) = int ->
@@ -24,6 +28,8 @@ Imported
24
28
#define Foo's Purification3 (e)
25
29
#define Foo's Purification4 (e) =
26
30
#define Foo's Reflection12
31
+ /// description line 1
32
+ /// description line 2
27
33
#define Foo's Reflection13 = int -> int
28
34
#define Foo =
29
35
define Foo
You can’t perform that action at this time.
0 commit comments