Update to latest analyzer and replace uses of most deprecated APIs
diff --git a/angular_analyzer_plugin/analysis_options.yaml b/angular_analyzer_plugin/analysis_options.yaml
index c01b1e2..28edd97 100644
--- a/angular_analyzer_plugin/analysis_options.yaml
+++ b/angular_analyzer_plugin/analysis_options.yaml
@@ -8,7 +8,6 @@
 
 linter:
   rules:
-    - prefer_final_locals
     - always_declare_return_types
     - always_put_control_body_on_new_line
     - always_require_non_null_named_parameters
diff --git a/angular_analyzer_plugin/lib/src/angular_driver.dart b/angular_analyzer_plugin/lib/src/angular_driver.dart
index e590c71..94790c6 100644
--- a/angular_analyzer_plugin/lib/src/angular_driver.dart
+++ b/angular_analyzer_plugin/lib/src/angular_driver.dart
@@ -227,9 +227,9 @@
       return null;
     }
 
-    final context = dartResult.unit.element.context;
+    final context = dartResult.unit.declaredElement.context;
     final ast = dartResult.unit;
-    final source = dartResult.unit.element.source;
+    final source = dartResult.unit.declaredElement.source;
     final extractor =
         new DirectiveExtractor(ast, context.typeProvider, source, context);
     final topLevels = extractor.getAngularTopLevels();
diff --git a/angular_analyzer_plugin/lib/src/completion.dart b/angular_analyzer_plugin/lib/src/completion.dart
index b4e2882..8b8c3f7 100644
--- a/angular_analyzer_plugin/lib/src/completion.dart
+++ b/angular_analyzer_plugin/lib/src/completion.dart
@@ -1185,9 +1185,9 @@
   }
 }
 
-/// Used to create a shell [ResolveResult] class for usage in
+/// Used to create a shell [ResolvedUnitResult] class for usage in
 /// [TypeMemberContributor] and [InheritedReferenceContributor].
-class _ResolveResultShell implements ResolveResult {
+class _ResolveResultShell implements ResolvedUnitResult {
   @override
   LibraryElement libraryElement;
 
diff --git a/angular_analyzer_plugin/lib/src/directive_extraction.dart b/angular_analyzer_plugin/lib/src/directive_extraction.dart
index 0025846..bb6d018 100644
--- a/angular_analyzer_plugin/lib/src/directive_extraction.dart
+++ b/angular_analyzer_plugin/lib/src/directive_extraction.dart
@@ -165,7 +165,7 @@
   /// Returns `null` if not an Angular annotation.
   AngularAnnotatedClass _getAngularAnnotatedClass(
       ast.ClassDeclaration classDeclaration) {
-    _currentClassElement = classDeclaration.element;
+    _currentClassElement = classDeclaration.declaredElement;
     _bindingTypeSynthesizer = new BindingTypeSynthesizer(
         _currentClassElement, _typeProvider, _context, errorReporter);
     // TODO(scheglov) add support for all the arguments
@@ -237,7 +237,7 @@
   /// Returns `null` if not an Angular annotation.
   FunctionalDirective _getFunctionalDirective(
       ast.FunctionDeclaration functionDeclaration) {
-    var functionElement = functionDeclaration.element;
+    final functionElement = functionDeclaration.declaredElement;
     if (functionElement is FunctionElement) {
       final annotationNode = functionDeclaration.metadata.firstWhere(
           (ann) => isAngularAnnotation(ann, 'Directive'),
@@ -516,13 +516,13 @@
     PropertyAccessorElement property;
     if (node is ast.FieldDeclaration && node.fields.variables.length == 1) {
       final variable = node.fields.variables.first;
-      final fieldElement = variable.element as FieldElement;
+      final fieldElement = variable.declaredElement as FieldElement;
       property = isInput ? fieldElement.setter : fieldElement.getter;
     } else if (node is ast.MethodDeclaration) {
       if (isInput && node.isSetter) {
-        property = node.element as PropertyAccessorElement;
+        property = node.declaredElement as PropertyAccessorElement;
       } else if (isOutput && node.isGetter) {
-        property = node.element as PropertyAccessorElement;
+        property = node.declaredElement as PropertyAccessorElement;
       }
     }
 
diff --git a/angular_analyzer_plugin/lib/src/pipe_extraction.dart b/angular_analyzer_plugin/lib/src/pipe_extraction.dart
index 81f0912..d7d632b 100644
--- a/angular_analyzer_plugin/lib/src/pipe_extraction.dart
+++ b/angular_analyzer_plugin/lib/src/pipe_extraction.dart
@@ -1,4 +1,3 @@
-import 'package:analyzer/analyzer.dart' as analyzer;
 import 'package:analyzer/dart/ast/ast.dart' as ast;
 import 'package:analyzer/dart/element/element.dart';
 import 'package:analyzer/src/dart/ast/utilities.dart' as utils;
@@ -60,7 +59,7 @@
     }
     for (final parameter in parameters) {
       // If named or positional
-      if (parameter.parameterKind == analyzer.ParameterKind.NAMED) {
+      if (parameter.isNamed) {
         errorReporter.reportErrorForElement(
             AngularWarningCode.PIPE_TRANSFORM_NO_NAMED_ARGS, parameter);
         continue;
@@ -77,7 +76,7 @@
   /// Returns an Angular [Pipe] for the given [node].
   /// Returns `null` if not an Angular @Pipe annotation.
   Pipe _createPipe(ast.ClassDeclaration classDeclaration, ast.Annotation node) {
-    _currentClassElement = classDeclaration.element;
+    _currentClassElement = classDeclaration.declaredElement;
     if (isAngularAnnotation(node, 'Pipe')) {
       String pipeName;
       int pipeNameOffset;
diff --git a/angular_analyzer_plugin/lib/src/resolver.dart b/angular_analyzer_plugin/lib/src/resolver.dart
index 1125fa7..8583b14 100644
--- a/angular_analyzer_plugin/lib/src/resolver.dart
+++ b/angular_analyzer_plugin/lib/src/resolver.dart
@@ -1289,7 +1289,7 @@
   }
 
   DartType _getIterableItemType(Expression expression) {
-    final itemsType = expression.bestType;
+    final itemsType = expression.staticType;
     if (itemsType is InterfaceType) {
       final iteratorType = _lookupGetterReturnType(itemsType, 'iterator');
       if (iteratorType is InterfaceType) {
@@ -1645,7 +1645,7 @@
     // half-complete-code case: ensure the expression is actually there
     if (attribute.expression != null &&
         !typeSystem.isAssignableTo(
-            attribute.expression.bestType, typeProvider.boolType)) {
+            attribute.expression.staticType, typeProvider.boolType)) {
       errorListener.onError(new AnalysisError(
         templateSource,
         attribute.valueOffset,
@@ -1787,7 +1787,7 @@
       // half-complete-code case: ensure the expression is actually there
       if (attribute.expression != null &&
           !typeSystem.isAssignableTo(
-              attribute.expression.bestType, typeProvider.numType)) {
+              attribute.expression.staticType, typeProvider.numType)) {
         errorListener.onError(new AnalysisError(
             templateSource,
             attribute.valueOffset,
@@ -1830,13 +1830,13 @@
           // half-complete-code case: ensure the expression is actually there
           if (attribute.expression != null &&
               !typeSystem.isAssignableTo(
-                  eventType, attribute.expression.bestType)) {
+                  eventType, attribute.expression.staticType)) {
             errorListener.onError(new AnalysisError(
                 templateSource,
                 attribute.valueOffset,
                 attribute.value.length,
                 AngularWarningCode.TWO_WAY_BINDING_OUTPUT_TYPE_ERROR,
-                [output.eventType, attribute.expression.bestType]));
+                [output.eventType, attribute.expression.staticType]));
           }
         }
       }
@@ -1858,7 +1858,7 @@
       ExpressionBoundAttribute attr, InputElement input) {
     // half-complete-code case: ensure the expression is actually there
     if (attr.expression != null) {
-      final attrType = attr.expression.bestType;
+      final attrType = attr.expression.staticType;
       final inputType = input.setterType;
       final securityContext = input.securityContext;
 
@@ -2027,7 +2027,7 @@
 
   @override
   void visitSimpleIdentifier(SimpleIdentifier node) {
-    final dartElement = node.bestElement;
+    final dartElement = node.staticElement;
     if (dartElement != null) {
       final angularElement =
           dartToAngularMap[dartElement] ?? new DartElement(dartElement);
diff --git a/angular_analyzer_plugin/lib/src/standard_components.dart b/angular_analyzer_plugin/lib/src/standard_components.dart
index 210a086..d0793e2 100644
--- a/angular_analyzer_plugin/lib/src/standard_components.dart
+++ b/angular_analyzer_plugin/lib/src/standard_components.dart
@@ -1,8 +1,8 @@
+import 'package:analyzer/dart/analysis/results.dart';
 import 'package:analyzer/dart/ast/ast.dart' as ast;
 import 'package:analyzer/dart/ast/visitor.dart';
 import 'package:analyzer/dart/element/element.dart';
 import 'package:analyzer/dart/element/type.dart';
-import 'package:analyzer/src/dart/analysis/driver.dart';
 import 'package:analyzer/src/generated/source.dart';
 import 'package:angular_analyzer_plugin/src/model.dart';
 import 'package:angular_analyzer_plugin/src/selector.dart';
@@ -52,7 +52,7 @@
 
   @override
   void visitClassDeclaration(ast.ClassDeclaration node) {
-    classElement = node.element;
+    classElement = node.declaredElement;
     super.visitClassDeclaration(node);
     if (classElement.name == 'HtmlElement') {
       final outputElements = _buildOutputs(true);
@@ -85,10 +85,10 @@
     super.visitCompilationUnit(unit);
 
     missingOutputs.forEach((name, type) {
-      final namespace = unit.element.library.publicNamespace;
+      final namespace = unit.declaredElement.library.publicNamespace;
       final eventClass = namespace.get(type) as ClassElement;
-      events[name] = new OutputElement(
-          name, null, null, unit.element.source, null, null, eventClass.type);
+      events[name] = new OutputElement(name, null, null,
+          unit.declaredElement.source, null, null, eventClass.type);
     });
   }
 
@@ -321,14 +321,15 @@
       this.securitySchema});
 
   factory StandardAngular.fromAnalysis(
-      {AnalysisResult angularResult,
-      AnalysisResult securityResult,
-      AnalysisResult protoSecurityResult}) {
-    final ng = angularResult.unit.element.library.exportNamespace;
-    final security = securityResult.unit.element.library.exportNamespace;
+      {ResolvedUnitResult angularResult,
+      ResolvedUnitResult securityResult,
+      ResolvedUnitResult protoSecurityResult}) {
+    final ng = angularResult.unit.declaredElement.library.exportNamespace;
+    final security =
+        securityResult.unit.declaredElement.library.exportNamespace;
     final protoSecurity = protoSecurityResult == null
         ? null
-        : protoSecurityResult.unit.element.library.exportNamespace;
+        : protoSecurityResult.unit.declaredElement.library.exportNamespace;
 
     List<DartType> interfaceTypes(List<Element> elements) => elements
         .whereType<ClassElement>()
diff --git a/angular_analyzer_plugin/lib/src/view_extraction.dart b/angular_analyzer_plugin/lib/src/view_extraction.dart
index 2d42c8a..3d36ae8 100644
--- a/angular_analyzer_plugin/lib/src/view_extraction.dart
+++ b/angular_analyzer_plugin/lib/src/view_extraction.dart
@@ -213,7 +213,7 @@
     final views = <View>[];
     for (final unitMember in unit.declarations) {
       if (unitMember is ast.ClassDeclaration) {
-        final classElement = unitMember.element;
+        final classElement = unitMember.declaredElement;
         ast.Annotation componentAnnotation;
 
         for (final annotation in unitMember.metadata) {
diff --git a/angular_analyzer_plugin/pubspec.yaml b/angular_analyzer_plugin/pubspec.yaml
index 4146594..72280ea 100644
--- a/angular_analyzer_plugin/pubspec.yaml
+++ b/angular_analyzer_plugin/pubspec.yaml
@@ -9,10 +9,10 @@
 environment:
   sdk: '>=2.0.0-dev.0.0 <3.0.0'
 dependencies:
-  analyzer: '0.33.1'
+  analyzer: '0.34.2'
   plugin: '^0.2.0'
   #  tuple: '^1.0.1' Does not yet support Dart 2
-  analyzer_plugin: '0.0.1-alpha.5'
+  analyzer_plugin: '0.0.1-alpha.6'
   angular_ast: '^0.5.0'
   meta: ^1.0.2
   yaml: ^2.1.2
diff --git a/angular_analyzer_plugin/test/options_test.dart b/angular_analyzer_plugin/test/options_test.dart
index 031c2da..d032f8c 100644
--- a/angular_analyzer_plugin/test/options_test.dart
+++ b/angular_analyzer_plugin/test/options_test.dart
@@ -193,7 +193,7 @@
       custom_tag_names: true
 ''', null);
     expect(options.customTagNames, isNotNull);
-    expect(options.customTagNames, const isInstanceOf<List>());
+    expect(options.customTagNames, const TypeMatcher<List>());
     expect(options.customTagNames, isEmpty);
   }
 
@@ -242,7 +242,7 @@
   custom_tag_names: true
 ''', null);
     expect(options.customTagNames, isNotNull);
-    expect(options.customTagNames, const isInstanceOf<List>());
+    expect(options.customTagNames, const TypeMatcher<List>());
     expect(options.customTagNames, isEmpty);
   }
 
diff --git a/angular_analyzer_plugin/test/resolver_test.dart b/angular_analyzer_plugin/test/resolver_test.dart
index 8fa529e..a7b6344 100644
--- a/angular_analyzer_plugin/test/resolver_test.dart
+++ b/angular_analyzer_plugin/test/resolver_test.dart
@@ -23,7 +23,7 @@
 
 void assertPropertyElement(AngularElement element,
     {nameMatcher, sourceMatcher}) {
-  expect(element, const isInstanceOf<InputElement>());
+  expect(element, const TypeMatcher<InputElement>());
   final inputElement = element;
   if (nameMatcher != null) {
     expect(inputElement.name, nameMatcher);