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

Unified Diff: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/SemanticHighlightings.java

Issue 11415065: Issue 6770. Support for @deprecated on library directive. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/SemanticHighlightings.java
diff --git a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/SemanticHighlightings.java b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/SemanticHighlightings.java
index dd5b2a37e6102750c389064c9dbcc3c2e52dcb88..a8237c85205516450984caaee0001f583743cd7e 100644
--- a/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/SemanticHighlightings.java
+++ b/editor/tools/plugins/com.google.dart.tools.ui/src/com/google/dart/tools/ui/internal/text/editor/SemanticHighlightings.java
@@ -31,6 +31,7 @@ import com.google.dart.compiler.ast.DartMethodDefinition;
import com.google.dart.compiler.ast.DartNode;
import com.google.dart.compiler.ast.DartPartOfDirective;
import com.google.dart.compiler.ast.DartSourceDirective;
+import com.google.dart.compiler.ast.DartStringLiteral;
import com.google.dart.compiler.ast.DartTypeNode;
import com.google.dart.compiler.ast.DartVariable;
import com.google.dart.compiler.ast.ImportCombinator;
@@ -300,9 +301,19 @@ public class SemanticHighlightings {
*/
private static final class DeprecatedElementHighlighting extends DefaultSemanticHighlighting {
@Override
+ public boolean consumes(SemanticToken token) {
+ DartNode node = token.getNode();
+ if (node instanceof DartStringLiteral && node.getParent() instanceof DartImportDirective) {
+ Element element = node.getElement();
+ return element != null && element.getMetadata().isDeprecated();
+ }
+ return false;
+ }
+
+ @Override
public boolean consumesIdentifier(SemanticToken token) {
DartIdentifier node = token.getNodeIdentifier();
- NodeElement element = node.getElement();
+ Element element = node.getElement();
return element != null && element.getMetadata().isDeprecated();
}

Powered by Google App Engine
This is Rietveld 408576698