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

Side by Side Diff: editor/tools/plugins/com.google.dart.server/src/com/google/dart/server/internal/local/computer/DartUnitOutlineComputer.java

Issue 244183002: Add ClassDeclaration/ClassTypeAlias.isAbstract() and use them. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: forgotten class 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014, the Dart project authors. 2 * Copyright (c) 2014, the Dart project authors.
3 * 3 *
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except
5 * in compliance with the License. You may obtain a copy of the License at 5 * in compliance with the License. You may obtain a copy of the License at
6 * 6 *
7 * http://www.eclipse.org/legal/epl-v10.html 7 * http://www.eclipse.org/legal/epl-v10.html
8 * 8 *
9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License 9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 } 146 }
147 // not first child: [endOfPreviousSibling, endOfNode] 147 // not first child: [endOfPreviousSibling, endOfNode]
148 int prevSiblingEnd = siblings.get(index - 1).getEnd(); 148 int prevSiblingEnd = siblings.get(index - 1).getEnd();
149 return new SourceRegionImpl(prevSiblingEnd, node.getEnd() - prevSiblingEnd); 149 return new SourceRegionImpl(prevSiblingEnd, node.getEnd() - prevSiblingEnd);
150 } 150 }
151 151
152 private OutlineImpl newClassOutline(Outline unitOutline, List<Outline> unitChi ldren, 152 private OutlineImpl newClassOutline(Outline unitOutline, List<Outline> unitChi ldren,
153 ClassDeclaration classDeclaration) { 153 ClassDeclaration classDeclaration) {
154 SimpleIdentifier nameNode = classDeclaration.getName(); 154 SimpleIdentifier nameNode = classDeclaration.getName();
155 String name = nameNode.getName(); 155 String name = nameNode.getName();
156 // TODO(scheglov) add ClassDeclaration.isAbstract()
157 OutlineImpl outline = new OutlineImpl( 156 OutlineImpl outline = new OutlineImpl(
158 unitOutline, 157 unitOutline,
159 getSourceRegion(classDeclaration), 158 getSourceRegion(classDeclaration),
160 OutlineKind.CLASS, 159 OutlineKind.CLASS,
161 name, 160 name,
162 nameNode.getOffset(), 161 nameNode.getOffset(),
163 name.length(), 162 name.length(),
164 null, 163 null,
165 null, 164 null,
166 classDeclaration.getAbstractKeyword() != null, 165 classDeclaration.isAbstract(),
167 false); 166 false);
168 unitChildren.add(outline); 167 unitChildren.add(outline);
169 return outline; 168 return outline;
170 } 169 }
171 170
172 private void newClassTypeAlias(Outline unitOutline, List<Outline> unitChildren , 171 private void newClassTypeAlias(Outline unitOutline, List<Outline> unitChildren ,
173 ClassTypeAlias alias) { 172 ClassTypeAlias alias) {
174 SimpleIdentifier nameNode = alias.getName(); 173 SimpleIdentifier nameNode = alias.getName();
175 // TODO(scheglov) add ClassTypeAlias.isAbstract()
176 unitChildren.add(new OutlineImpl( 174 unitChildren.add(new OutlineImpl(
177 unitOutline, 175 unitOutline,
178 getSourceRegion(alias), 176 getSourceRegion(alias),
179 OutlineKind.CLASS_TYPE_ALIAS, 177 OutlineKind.CLASS_TYPE_ALIAS,
180 nameNode.getName(), 178 nameNode.getName(),
181 nameNode.getOffset(), 179 nameNode.getOffset(),
182 nameNode.getLength(), 180 nameNode.getLength(),
183 null, 181 null,
184 null, 182 null,
185 alias.getAbstractKeyword() != null, 183 alias.isAbstract(),
186 false)); 184 false));
187 } 185 }
188 186
189 private void newConstructorOutline(OutlineImpl classOutline, List<Outline> chi ldren, 187 private void newConstructorOutline(OutlineImpl classOutline, List<Outline> chi ldren,
190 ConstructorDeclaration constructorDeclaration) { 188 ConstructorDeclaration constructorDeclaration) {
191 Identifier returnType = constructorDeclaration.getReturnType(); 189 Identifier returnType = constructorDeclaration.getReturnType();
192 String name = returnType.getName(); 190 String name = returnType.getName();
193 int offset = returnType.getOffset(); 191 int offset = returnType.getOffset();
194 int length = returnType.getLength(); 192 int length = returnType.getLength();
195 SimpleIdentifier constructorNameNode = constructorDeclaration.getName(); 193 SimpleIdentifier constructorNameNode = constructorDeclaration.getName();
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 OutlineKind.COMPILATION_UNIT, 310 OutlineKind.COMPILATION_UNIT,
313 null, 311 null,
314 0, 312 0,
315 0, 313 0,
316 null, 314 null,
317 null, 315 null,
318 false, 316 false,
319 false); 317 false);
320 } 318 }
321 } 319 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698