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

Side by Side Diff: pkg/analyzer/lib/src/services/lint.dart

Issue 2342733002: Break up another large file (Closed)
Patch Set: fixed floating comment Created 4 years, 3 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 analyzer.src.services.lint; 5 library analyzer.src.services.lint;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/error/listener.dart';
10 import 'package:analyzer/src/generated/engine.dart'; 11 import 'package:analyzer/src/generated/engine.dart';
11 import 'package:analyzer/src/generated/error.dart';
12 import 'package:analyzer/src/task/model.dart'; 12 import 'package:analyzer/src/task/model.dart';
13 import 'package:analyzer/task/model.dart'; 13 import 'package:analyzer/task/model.dart';
14 14
15 const List<Linter> _noLints = const <Linter>[]; 15 const List<Linter> _noLints = const <Linter>[];
16 16
17 /// The descriptor used to associate lints with analysis contexts in 17 /// The descriptor used to associate lints with analysis contexts in
18 /// configuration data. 18 /// configuration data.
19 final ResultDescriptor<List<Linter>> CONFIGURED_LINTS_KEY = 19 final ResultDescriptor<List<Linter>> CONFIGURED_LINTS_KEY =
20 new ResultDescriptorImpl('configured.lints', _noLints); 20 new ResultDescriptorImpl('configured.lints', _noLints);
21 21
(...skipping 28 matching lines...) Expand all
50 /// Manages lint timing. 50 /// Manages lint timing.
51 class LintRegistry { 51 class LintRegistry {
52 /// Dictionary mapping lints (by name) to timers. 52 /// Dictionary mapping lints (by name) to timers.
53 final Map<String, Stopwatch> timers = new HashMap<String, Stopwatch>(); 53 final Map<String, Stopwatch> timers = new HashMap<String, Stopwatch>();
54 54
55 /// Get a timer associated with the given lint rule (or create one if none 55 /// Get a timer associated with the given lint rule (or create one if none
56 /// exists). 56 /// exists).
57 Stopwatch getTimer(Linter linter) => 57 Stopwatch getTimer(Linter linter) =>
58 timers.putIfAbsent(linter.name, () => new Stopwatch()); 58 timers.putIfAbsent(linter.name, () => new Stopwatch());
59 } 59 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/plugin/engine_plugin.dart ('k') | pkg/analyzer/lib/src/summary/incremental_cache.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698