Commit Graph

2342 Commits

Author SHA1 Message Date
pq b0a08827aa Improves options validation type safety (#24885).
Fixes #24885.

https://github.com/dart-lang/sdk/issues/24885

BUG=24885
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1437703003 .
2015-11-12 09:44:25 -08:00
Konstantin Shcheglov 5b61845221 Send any logError() information to the IDE.
I have not seen any errors sent so far after several minutes of playing with it.
Adding and removing files does not cause any errors.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1432423004 .
2015-11-12 08:16:24 -08:00
Brian Wilkerson e1c39602ba Guard against null pointer exception in status page generation
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1440693004 .
2015-11-11 14:54:57 -08:00
Konstantin Shcheglov 02fe5bcd5a Exclude 'doc' folders.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1439723002 .
2015-11-11 13:10:35 -08:00
Konstantin Shcheglov 0e712ea00c Remove task inputs performance statistics.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1432293002 .
2015-11-11 10:04:17 -08:00
Konstantin Shcheglov e4fae0658d Tweaks for the status page.
1. We need to escape Element toString().
2. Wrap separate lists into <li>.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1416603008 .
2015-11-06 12:47:44 -08:00
Konstantin Shcheglov a19b2985dc Fix for the case when a class appears twice in a type hierarchy.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1406403009 .
2015-11-06 11:14:30 -08:00
pq 82e83bb34d Experimental getDiagnostics request (#24480).
* Adds `getDiagnostics` request with *very* provisional diagnostics payload (primary goal here is to plumb this fully through and iterate).
* Updates codegenerator to skip doc generation for experimental APIs.

Additional context here: https://github.com/dart-lang/sdk/issues/24480.

BUG=24480
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1416093007 .
2015-11-05 15:05:21 -08:00
Konstantin Shcheglov 61ee6dff5f Roll instrumentation log files.
Keep up to 5 old log files.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1418143006 .
2015-11-05 08:40:43 -08:00
Konstantin Shcheglov d49d0f7e06 Wait for InstrumentationService.shutdown() before exit(0).
Otherwise we don't get the last portion of instrumentation data in the
file at all.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1413403007 .
2015-11-04 10:08:20 -08:00
pq 9e9b7c0aaf Add Server PID to Server Status page.
BUG=
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1415573012 .
2015-11-04 09:25:42 -08:00
Brian Wilkerson aaaf7c2de8 Fix glob patterns to work on Windows
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1426353002 .
2015-11-03 15:35:26 -08:00
Konstantin Shcheglov f49612ba51 Covering expression offsets/lengths integration.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1411973006 .
2015-11-03 10:45:17 -08:00
Konstantin Shcheglov 069ba985de Fix protocol for EXTRACT_LOCAL_VARIABLE and coveringExpressionOffsets/lengths.
Unfortunately we have to make coveringExpressionOffsets and coveringExpressionLengths optional.
Otherwise new clients cannot correctly parse responses from old servers.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1407333006 .
2015-11-03 10:19:41 -08:00
Brian Wilkerson 879cf82b6b Rework analyzed files support to use globs
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1413643006 .
2015-11-03 07:11:29 -08:00
Konstantin Shcheglov 128250a9ea Compute covering offsets/lengths.
Drop support for binary expressions fragments.

Reduce number of reported problems, provide best guess results instead.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1431673003 .
2015-11-02 18:22:12 -08:00
Konstantin Shcheglov 1bc7f93009 Adding a not explicit source makes it explicit.
When we add a new file in IDEA and open it in the editor, this causes
analysis.setSubscriptions to be send immediately, even before watcher
notices it. The server reacts by requesting the fully resolved unit, and
so causes creation of a not-explicit CacheEntry. So, when later we handle
applyChanges(), the entry already exists. In this case we still need to
mark it as explicit.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1411243010 .
2015-10-30 08:04:27 -07:00
Konstantin Shcheglov 765c7fd0f1 Mark HintCode.CAN_BE_NULL_AFTER_NULL_AWARE as fixable.
R=pquitslund@google.com
BUG=

Review URL: https://codereview.chromium.org/1428903002 .
2015-10-30 08:02:29 -07:00
Konstantin Shcheglov 03eed1c3c9 Fix for duplicate priority sources.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1408163008 .
2015-10-29 17:46:00 -07:00
pq af7017e585 Option support for enableSuperMixins (and more).
* Adds language configuration support to `.analysis_options`:

  analyzer:
    language:
      enableSuperMixins: true

  (with validation).

* Extracts context configuration out of `server` context_manager and into `analyzer` where it can be re-used by `analyzer_cli`.
* Some general cleanup of option validation (with more to come!)

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1423333002 .
2015-10-29 14:11:26 -07:00
Konstantin Shcheglov 851dc4ea97 Quick Fix for CAN_BE_NULL_AFTER_NULL_AWARE.
Also fix for false positive :-(

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1423993005 .
2015-10-29 13:47:17 -07:00
Konstantin Shcheglov 7b75a53fef Fix for regions reported with multiple targets.
We should merge them into single NavigationRegion(s) with multiple targets.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1403373018 .
2015-10-28 16:38:12 -07:00
pq 5accd7a72e Error code validation for error filters.
Screenshots and background can be found on the tracking bug: https://github.com/dart-lang/sdk/issues/24618

R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1411053003 .
2015-10-28 16:37:34 -07:00
pq ff08fe58b6 Stop unwanted sharing between filter closures.
BUG=
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1414863004 .
2015-10-28 13:02:28 -07:00
pq 2f9c4af993 Error Suppression FTW.
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1420363005 .
2015-10-28 09:59:05 -07:00
pq 52fb3b3bab Introducing a lint server plugin.
Avoids introducing an unwanted dependency on the options plugin to server (efects discovered: https://codereview.chromium.org/1411313005/). Also soon to be future home for fixes and completions.

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1410553005 .
2015-10-26 12:11:38 -07:00
Konstantin Shcheglov cbea0dedf9 Issue 24714. Check other libraries that define unresolved class.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/24714

Review URL: https://codereview.chromium.org/1413973007 .
2015-10-26 11:32:59 -07:00
pq 15c9636924 Backed out validator registration.
Net-net: this bakes in an (unsafe in tests) assumption that the options plugin has been contributed and registered.

Backing out pending a revisit.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1411313005 .
2015-10-26 09:46:09 -07:00
pq 68dc36a3e7 OptionsValidator plugin extension and linter service.
* Adds a new extension point to allow for contributing OptionsValidators.
* Adds a new linter 'service' to server that contributes a lint-aware validator.

You'll notice that the warning code I added is NOT in `errors.dart`.  I did that in anticipation of plugin-specifc warnings living elsewhere.  If that's not the right angle, happy to un-do!

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1418333002 .
2015-10-26 08:50:55 -07:00
Konstantin Shcheglov 289bd0a056 [Atom] Issue 424. Fix for 'getNavigation' and index expressions.
R=brianwilkerson@google.com
BUG= https://github.com/dart-atom/dartlang/issues/424

Review URL: https://codereview.chromium.org/1402353009 .
2015-10-25 11:29:54 -07:00
Konstantin Shcheglov c43f292dd9 Remove IMPORT_EXPORT_SOURCE_CLOSURE and IS_CLIENT results.
This improves warm VM analysis time (i.e. 99% of all analyzis that happens in IDEs) from 7200 ms to 6600 ms.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1417143003 .
2015-10-24 08:35:26 -07:00
pq df580cf0ea WorkItem detail diagnostics.
R=keertip@google.com

Review URL: https://codereview.chromium.org/1418323002 .
2015-10-23 14:48:24 -07:00
keertip c133bf9467 add work item info to context status page
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1415503006 .
2015-10-23 13:27:10 -07:00
danrubel 33e6b737e8 enable analysis server cmdline instrumentation log file option
this change allows instrumentation to be logged to a file that is specified on the command line when analysis server is started for both internal and external builds of the analysis server

R=lukechurch@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1413563009 .
2015-10-23 15:47:09 -04:00
danrubel 5bd191ee12 fix import uri completion exception - fixes #24709
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1418123004 .
2015-10-23 14:55:20 -04:00
pq d12abed5d7 Last performed task diagnostics.
Adds a new block of status that reports the last 10 performed tasks.

For example:

<p>Recent Tasks</p>
GatherUsedLocalElementsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

GatherUsedImportedElementsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

GenerateHintsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

GenerateLintsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

VerifyUnitTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

LibraryUnitErrorsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

DartErrorsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

LibraryErrorsReadyTask for source /Users/pquitslund/src/git/clones/analyzer_cli/test/mocks.dart

GetContentTask for source /Users/pquitslund/src/git/clones/analyzer_cli/.analysis_options

GenerateOptionsErrorsTask for source /Users/pquitslund/src/git/clones/analyzer_cli/.analysis_options

R=brianwilkerson@google.com, keertip@google.com

Review URL: https://codereview.chromium.org/1420783004 .
2015-10-23 10:31:26 -07:00
Konstantin Shcheglov 07acac8b8e Compute and display tasks input timings.
It's not perfectly useful - it computes just cumulative timings.
So, it includes not just time for extracting and gathering inputs, but also actual time to compute them.
But it is still useful to compare between runs after changes to tasks inputs, because computing time
should be the same, so the difference is this extracting/gathering time.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1406983007 .
2015-10-23 09:38:24 -07:00
danrubel f45c8bc917 add logging code to track unexpected situation - fixes #24630
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1412423006 .
2015-10-22 13:06:58 -04:00
danrubel 6726ac5ccd fix completion exception - fixes #24630
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1418093003 .
2015-10-22 10:14:02 -04:00
Konstantin Shcheglov 4e5938f373 Completion exceptions are never fatal.
Actually only some methods of the 'edit' domain are potentially fatal.

Alternative solutions:

1. Don't make anything fatal.

2. Add areExceptionsFatal to RequestHandler.

3. Let every domain to decide whether exceptions in some method or none of them are fatal.

R=brianwilkerson@google.com, danrubel@google.com
BUG=

Review URL: https://codereview.chromium.org/1404353007 .
2015-10-21 20:26:46 -07:00
Konstantin Shcheglov f18a0209fb Fix for 'Assign to Local Variable' in closures.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1415253002 .
2015-10-21 13:20:22 -07:00
pq 6c85fe785a Analysis Options error notifications.
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1411013003 .
2015-10-21 09:59:19 -07:00
Konstantin Shcheglov c7907e7800 Support for searching files by import/export/part URIs and library identifiers.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1417483006 .
2015-10-20 08:52:02 -07:00
Konstantin Shcheglov 5f71b2e7cd Check that AnalysisContext is not null.
I guess this happens when a "resolved" CompilationUnit is not actially resolved.
I don't know why we get such units, but I saw this situation twice in IDEA.
So, probably we need to fix at least throwing NPE here.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1418513002 .
2015-10-19 13:27:50 -07:00
Konstantin Shcheglov 5e9ea82aa4 Issue 24612. Skip excluded folder during contexts creation.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/24612

Review URL: https://codereview.chromium.org/1411393003 .
2015-10-19 13:17:11 -07:00
Konstantin Shcheglov ea947094ae Fix for suggesting methods as a *name* of a local variable declaration.
R=brianwilkerson@google.com, danrubel@google.com
BUG=

Review URL: https://codereview.chromium.org/1417603002 .
2015-10-19 12:29:22 -07:00
Konstantin Shcheglov efc1d4b224 Ignore contexts in folders named 'packages' or starting with dot.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/24614

Review URL: https://codereview.chromium.org/1415713002 .
2015-10-19 11:59:11 -07:00
Konstantin Shcheglov e0636b183c Make IndexableObjectKind parameterized.
LMK if this is a bad change.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1413563004 .
2015-10-19 10:13:43 -07:00
Konstantin Shcheglov f80bd4203d Index Dart CompilationUnit(s) with the correct context.
We should use the context that they belong to, not the context that we got them through.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1410983003 .
2015-10-19 09:59:58 -07:00
pq 140a4f5891 Register .analysis_options files for analysis.
Some oportunistic constant cleanup as well (follow-up from: https://codereview.chromium.org/1399893004/).

R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1412213003 .
2015-10-19 09:46:54 -07:00