File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -953,6 +953,9 @@ export class SDLContributions implements vscode.CompletionItemProvider {
953953 }
954954 let completions : vscode . CompletionItem [ ] = [ ] ;
955955 if ( info . type == "block" ) {
956+ if ( obj == dubSchema )
957+ provideRootSnippets ( completions ) ;
958+
956959 if ( obj . tags )
957960 Object . keys ( obj . tags ) . forEach ( key => {
958961 let item = new vscode . CompletionItem ( key ) ;
@@ -1131,3 +1134,16 @@ export class SDLContributions implements vscode.CompletionItemProvider {
11311134 return errors ;
11321135 }
11331136}
1137+
1138+ function provideRootSnippets ( res : vscode . CompletionItem [ ] )
1139+ {
1140+ let s = new vscode . CompletionItem ( "buildType \"unittest\"" , vscode . CompletionItemKind . Snippet ) ;
1141+ let str = `buildType "unittest" {
1142+ buildOptions "unittests" "debugMode" "debugInfo"
1143+ # dflags "-checkaction=context" # enables showing values in failing asserts
1144+ # dependency "my_ut_runner" version=""$0
1145+ }` ;
1146+ s . insertText = new vscode . SnippetString ( str ) ;
1147+ s . documentation = new vscode . MarkdownString ( "Block for configuring how unittests behave\n\n```sdl\n" + str + "\n```" ) ;
1148+ res . push ( s ) ;
1149+ }
You can’t perform that action at this time.
0 commit comments