File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
YarnSpinner.LanguageServer/src/Server Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -244,6 +244,21 @@ private static Task<TextDocumentEdit> AddNodeToDocumentAsync(Workspace workspace
244244 }
245245 }
246246
247+ string body = "" ;
248+ if ( commandParams . Arguments . Count >= 3 )
249+ {
250+ if ( commandParams . Arguments [ 2 ] . Type == JTokenType . String )
251+ {
252+ body = ( string ) commandParams . Arguments [ 2 ] ;
253+ }
254+ else
255+ {
256+ workspace . ShowMessage ( "AddNodeToDocumentAsync: Argument 2 is expected to be a String" , MessageType . Error ) ;
257+
258+ return Task . FromResult < TextDocumentEdit > ( new ( ) ) ;
259+ }
260+ }
261+
247262 Uri yarnDocumentUri = new ( yarnDocumentUriString ) ;
248263
249264 var project = workspace . GetProjectsForUri ( yarnDocumentUri ) . FirstOrDefault ( ) ;
@@ -290,7 +305,7 @@ private static Task<TextDocumentEdit> AddNodeToDocumentAsync(Workspace workspace
290305
291306 newNodeText
292307 . AppendLine ( "---" )
293- . AppendLine ( )
308+ . AppendLine ( body )
294309 . AppendLine ( "===" ) ;
295310
296311 Position position ;
You can’t perform that action at this time.
0 commit comments