OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library analysis_server.src.utilities.documentation; | |
6 | |
7 String getDartDocSummary(String str) { | 5 String getDartDocSummary(String str) { |
8 if (str == null) { | 6 if (str == null) { |
9 return null; | 7 return null; |
10 } | 8 } |
11 List<String> lines = str.split('\n'); | 9 List<String> lines = str.split('\n'); |
12 StringBuffer sb = new StringBuffer(); | 10 StringBuffer sb = new StringBuffer(); |
13 bool firstLine = true; | 11 bool firstLine = true; |
14 for (String line in lines) { | 12 for (String line in lines) { |
15 if (sb.length != 0 && line.isEmpty) { | 13 if (sb.length != 0 && line.isEmpty) { |
16 return sb.toString(); | 14 return sb.toString(); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 if (!firstLine) { | 58 if (!firstLine) { |
61 sb.write('\n'); | 59 sb.write('\n'); |
62 } | 60 } |
63 firstLine = false; | 61 firstLine = false; |
64 sb.write(line); | 62 sb.write(line); |
65 } | 63 } |
66 str = sb.toString(); | 64 str = sb.toString(); |
67 // done | 65 // done |
68 return str; | 66 return str; |
69 } | 67 } |
OLD | NEW |