Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Side by Side Diff: dart/site/try/src/editor.dart

Issue 214513005: Add CompilationUnit abstraction for tracking "project files". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address Kasper's comments Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « dart/site/try/src/compilation_unit.dart ('k') | dart/site/try/src/interaction_manager.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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.editor; 5 library trydart.editor;
6 6
7 import 'dart:html'; 7 import 'dart:html';
8 8
9 import 'package:compiler/implementation/scanner/scannerlib.dart' 9 import 'package:compiler/implementation/scanner/scannerlib.dart'
10 show 10 show
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 int type = anchorNode.nodeType; 113 int type = anchorNode.nodeType;
114 if (type != Node.TEXT_NODE) return null; 114 if (type != Node.TEXT_NODE) return null;
115 Text text = anchorNode; 115 Text text = anchorNode;
116 var parent = text.parent; 116 var parent = text.parent;
117 if (parent is! Element) return null; 117 if (parent is! Element) return null;
118 if (mainEditorPane == parent) return null; 118 if (mainEditorPane == parent) return null;
119 return parent; 119 return parent;
120 } 120 }
121 121
122 bool isMalformedInput = false; 122 bool isMalformedInput = false;
123 String currentSource = "";
124 123
125 addDiagnostic(String kind, String message, int begin, int end) { 124 addDiagnostic(String kind, String message, int begin, int end) {
126 observer.disconnect(); 125 observer.disconnect();
127 Selection selection = window.getSelection(); 126 Selection selection = window.getSelection();
128 int offset = 0; 127 int offset = 0;
129 int anchorOffset = 0; 128 int anchorOffset = 0;
130 bool hasSelection = false; 129 bool hasSelection = false;
131 Node anchorNode = selection.anchorNode; 130 Node anchorNode = selection.anchorNode;
132 bool foundNode = false; 131 bool foundNode = false;
133 void walk4(Node node) { 132 void walk4(Node node) {
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 218
220 diagnostic(text, tip) { 219 diagnostic(text, tip) {
221 if (text is String) { 220 if (text is String) {
222 text = new Text(text); 221 text = new Text(text);
223 } 222 }
224 return new AnchorElement() 223 return new AnchorElement()
225 ..classes.add('diagnostic') 224 ..classes.add('diagnostic')
226 ..append(text) 225 ..append(text)
227 ..append(tip); 226 ..append(tip);
228 } 227 }
OLDNEW
« no previous file with comments | « dart/site/try/src/compilation_unit.dart ('k') | dart/site/try/src/interaction_manager.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698