| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 test.services.completion.toplevel; | 5 library test.services.completion.toplevel; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/protocol.dart'; | 7 import 'package:analysis_server/src/protocol.dart'; |
| 8 import 'package:analysis_server/src/services/completion/imported_computer.dart'; | 8 import 'package:analysis_server/src/services/completion/imported_computer.dart'; |
| 9 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 class X {foo(){^}}'''); | 46 class X {foo(){^}}'''); |
| 47 // pass true for full analysis to pick up unimported source | 47 // pass true for full analysis to pick up unimported source |
| 48 return computeFull(true).then((_) { | 48 return computeFull(true).then((_) { |
| 49 assertSuggestClass('A'); | 49 assertSuggestClass('A'); |
| 50 assertNotSuggested('x'); | 50 assertNotSuggested('x'); |
| 51 assertNotSuggested('_B'); | 51 assertNotSuggested('_B'); |
| 52 assertSuggestClass('C'); | 52 assertSuggestClass('C'); |
| 53 assertNotSuggested('D'); | 53 assertNotSuggested('D'); |
| 54 assertSuggestClass('EE'); | 54 assertSuggestClass('EE'); |
| 55 assertNotSuggested('F'); | 55 assertNotSuggested('F'); |
| 56 // Don't suggest library prefix as it is suggested by local computer | 56 assertSuggestLibraryPrefix('g'); |
| 57 // TODO (danrubel) modify so that imported_computer handles | |
| 58 // all aspects of import statement | |
| 59 assertNotSuggested('g'); | |
| 60 assertNotSuggested('G'); | 57 assertNotSuggested('G'); |
| 61 assertSuggestClass('H', CompletionRelevance.LOW); | 58 assertSuggestClass('H', CompletionRelevance.LOW); |
| 62 // Should not suggest compilation unit elements | 59 // Should not suggest compilation unit elements |
| 63 // which are returned by the LocalComputer | 60 // which are returned by the LocalComputer |
| 64 assertNotSuggested('X'); | 61 assertNotSuggested('X'); |
| 65 assertSuggestClass('Object'); | 62 assertSuggestClass('Object'); |
| 66 // TODO (danrubel) suggest HtmlElement as low relevance | 63 // TODO (danrubel) suggest HtmlElement as low relevance |
| 67 assertNotSuggested('HtmlElement'); | 64 assertNotSuggested('HtmlElement'); |
| 68 }); | 65 }); |
| 69 } | 66 } |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 return computeFull().then((_) { | 286 return computeFull().then((_) { |
| 290 assertSuggestClass('A'); | 287 assertSuggestClass('A'); |
| 291 assertNotSuggested('x'); | 288 assertNotSuggested('x'); |
| 292 assertNotSuggested('_B'); | 289 assertNotSuggested('_B'); |
| 293 // Should not suggest compilation unit elements | 290 // Should not suggest compilation unit elements |
| 294 // which are returned by the LocalComputer | 291 // which are returned by the LocalComputer |
| 295 assertNotSuggested('C'); | 292 assertNotSuggested('C'); |
| 296 }); | 293 }); |
| 297 } | 294 } |
| 298 } | 295 } |
| OLD | NEW |