• Home
  • Raw
  • Download

Lines Matching refs:snippet

14 // Additionally, code inside of dartdoc snippet and sample blocks
15 // ({@tool snippet ...}{@end-tool}, and {@tool sample ...}{@end-tool})
138 /// line number of the start of the snippet is given instead of the actual error
155 /// A RegExp that matches the beginning of a dartdoc snippet or sample.
156 static final RegExp _dartDocSampleBeginRegex = RegExp(r'{@tool (sample|snippet)(?:| ([^}]*))}');
158 /// A RegExp that matches the end of a dartdoc snippet or sample.
268 /// Creates a name for the snippets tool to use for the snippet ID from a
302 /// Writes out the given [snippet] to an output file in the [_tempDirectory] and
304 File _writeSnippet(Snippet snippet) {
305 // Generate the snippet.
306 …final String snippetId = _createNameFromSource('snippet', snippet.start.filename, snippet.start.li…
308 // Now we have a filename like 'lib.src.material.foo_widget.123.dart' for each snippet.
310 inputFile.writeAsStringSync(snippet.input.join('\n'));
315 ...snippet.args,
317 print('Generating snippet for ${snippet.start?.filename}:${snippet.start?.line}');
321 'Unable to create snippet for ${snippet.start.filename}:${snippet.start.line} '
323 file: snippet.start.filename,
324 line: snippet.start.line,
344 // Whether or not we're in a snippet code sample (with template) specifically.
433 inSnippet = sampleMatch != null && sampleMatch[1] == 'snippet';
442 // There are arguments to the snippet tool to keep track of.
463 for (Snippet snippet in snippets) {
464 final File snippetFile = _writeSnippet(snippet);
465 snippet.contents = snippetFile.readAsLinesSync();
466 snippetMap[snippetFile.absolute.path] = snippet;
608 final bool isSnippet = path.basename(file.path).startsWith('snippet.');
656 snippet: snippets[file.path],
868 /// A class to represent a snippet in the dartdoc comments, marked by
869 /// "{@tool snippet ...}...{@end-tool}". Snippets are processed separately from
885 final StringBuffer buf = StringBuffer('snippet ${args.join(' ')}\n');
905 this.snippet,
913 final Snippet snippet;
919 } else if (snippet != null) {
920 return 'In snippet starting at '
921 '${snippet.start.filename}:${snippet.start.line}:${snippet.contents[line - 1]}\n'