| 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 trydart.interaction_manager; | 5 library trydart.interaction_manager; |
| 6 | 6 |
| 7 import 'dart:html'; | 7 import 'dart:html'; |
| 8 | 8 |
| 9 import 'dart:convert' show | 9 import 'dart:convert' show |
| 10 JSON; | 10 JSON; |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 // TODO(ahe): We know almost exactly what has changed. It could be | 320 // TODO(ahe): We know almost exactly what has changed. It could be |
| 321 // more efficient to only communicate what changed. | 321 // more efficient to only communicate what changed. |
| 322 context.currentCompilationUnit.content = getText(mainEditorPane); | 322 context.currentCompilationUnit.content = getText(mainEditorPane); |
| 323 | 323 |
| 324 // Discard highlighting mutations. | 324 // Discard highlighting mutations. |
| 325 observer.takeRecords(); | 325 observer.takeRecords(); |
| 326 return; | 326 return; |
| 327 } | 327 } |
| 328 } | 328 } |
| 329 | 329 |
| 330 // TODO(ahe): Use getText(mainEditorPane) instead. | 330 String currentText = getText(mainEditorPane); |
| 331 removeShadowRootPolyfill(mainEditorPane); | |
| 332 | |
| 333 String currentText = mainEditorPane.text; | |
| 334 trySelection.updateText(currentText); | 331 trySelection.updateText(currentText); |
| 335 | 332 |
| 336 context.currentCompilationUnit.content = currentText; | 333 context.currentCompilationUnit.content = currentText; |
| 337 | 334 |
| 338 editor.seenIdentifiers = new Set<String>.from(mock.identifiers); | 335 editor.seenIdentifiers = new Set<String>.from(mock.identifiers); |
| 339 | 336 |
| 340 editor.isMalformedInput = false; | 337 editor.isMalformedInput = false; |
| 341 int offset = 0; | 338 int offset = 0; |
| 342 List<Node> nodes = <Node>[]; | 339 List<Node> nodes = <Node>[]; |
| 343 | 340 |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 return text.split(new RegExp('^', multiLine: true)); | 894 return text.split(new RegExp('^', multiLine: true)); |
| 898 } | 895 } |
| 899 | 896 |
| 900 void removeCodeCompletion() { | 897 void removeCodeCompletion() { |
| 901 List<Node> highlighting = | 898 List<Node> highlighting = |
| 902 mainEditorPane.querySelectorAll('.dart-code-completion'); | 899 mainEditorPane.querySelectorAll('.dart-code-completion'); |
| 903 for (Element element in highlighting) { | 900 for (Element element in highlighting) { |
| 904 element.remove(); | 901 element.remove(); |
| 905 } | 902 } |
| 906 } | 903 } |
| OLD | NEW |