Skip to content

Commit cdcf5b8

Browse files
committed
Minor update for note tag
1 parent 98e52b5 commit cdcf5b8

3 files changed

Lines changed: 12 additions & 15 deletions

File tree

‎snippets/http.json‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,12 @@
7575
"# @name ${1:Request_Name}"
7676
],
7777
"description": "Define Request Variable"
78+
},
79+
"Request confirmation": {
80+
"prefix": "note",
81+
"body": [
82+
"# @note"
83+
],
84+
"description": "Add sending request confirmation"
7885
}
7986
}

‎src/controllers/requestController.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class RequestController {
5050
if (warnBeforeSend) {
5151
const note = name ? `Are you sure you want to send the request "${name}"?` : 'Are you sure you want to send this request?';
5252
const userConfirmed = await window.showWarningMessage(note, 'Yes', 'No');
53-
if ('Yes' !== userConfirmed) {
53+
if (userConfirmed !== 'Yes') {
5454
return;
5555
}
5656
}

‎syntaxes/http.tmLanguage‎

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
</dict>
125125
<dict>
126126
<key>match</key>
127-
<string>^\s*#{1,}\s*(?:((@)name)\s+(\S+))?.*$</string>
127+
<string>^\s*#{1,}\s*(?:((@)name)\s+(\S.*))$</string>
128128
<key>captures</key>
129129
<dict>
130130
<key>1</key>
@@ -148,7 +148,7 @@
148148
</dict>
149149
<dict>
150150
<key>match</key>
151-
<string>^\s*/{2,}\s*(?:((@)name)\s+(\S+))?.*$</string>
151+
<string>^\s*/{2,}\s*(?:((@)name)\s+(\S.*))$</string>
152152
<key>captures</key>
153153
<dict>
154154
<key>1</key>
@@ -172,7 +172,7 @@
172172
</dict>
173173
<dict>
174174
<key>match</key>
175-
<string>^\s*#{1,}\s*((@)note)?.*$</string>
175+
<string>^\s*#{1,}\s*((@)note)\s*$</string>
176176
<key>captures</key>
177177
<dict>
178178
<key>1</key>
@@ -185,18 +185,13 @@
185185
<key>name</key>
186186
<string>punctuation.definition.block.tag.metadata</string>
187187
</dict>
188-
<key>3</key>
189-
<dict>
190-
<key>name</key>
191-
<string>entity.name.type.instance.metadata</string>
192-
</dict>
193188
</dict>
194189
<key>name</key>
195190
<string>comment.source.sharp.http</string>
196191
</dict>
197192
<dict>
198193
<key>match</key>
199-
<string>^\s*/{2,}\s*((@)note)?.*$</string>
194+
<string>^\s*/{2,}\s*((@)note)\s*$</string>
200195
<key>captures</key>
201196
<dict>
202197
<key>1</key>
@@ -209,11 +204,6 @@
209204
<key>name</key>
210205
<string>punctuation.definition.block.tag.metadata</string>
211206
</dict>
212-
<key>3</key>
213-
<dict>
214-
<key>name</key>
215-
<string>entity.name.type.instance.metadata</string>
216-
</dict>
217207
</dict>
218208
<key>name</key>
219209
<string>comment.source.double-slash.http</string>

0 commit comments

Comments
 (0)