Commit Graph

52 Commits

Author SHA1 Message Date
Konstantin Shcheglov e97f1bdbf0 Switch analysis_server to language 2.12, so null safety, but opt-out files.
This should allow doing partial migration, specifically protocol files,
which are imported by other libraries, but are a small library cycle
that does not import much outside of it.

Change-Id: I904c05d6d5b444ee9a9dbd1f7ada12aabdcc5165
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193583
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-03-30 23:39:37 +00:00
Mike Fairhurst 1134a0f17c [analysis_server] Remove unused dart:async imports
Change-Id: I764ee78cb9e31bdb3abaa36ca4754e1fed180311
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161447
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-09-02 17:29:52 +00:00
Brian Wilkerson 8969b1839c Enable omit_local_variable_types in analysis_server
Change-Id: I7e5c13d40fd276854601681fc84be321e6031b10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141583
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-30 03:58:44 +00:00
Brian Wilkerson 8efdee06d6 Begin adding return types in analysis_server
Change-Id: Id0daa52236bdc90cba6bfd7cf81d1b4cf47603c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133544
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-28 21:18:30 +00:00
Brian Wilkerson 4043a6fce3 Remove unnecessary uses of new in analysis_server
Other than analysis_options.yaml, all of the changes were from running
dartfix.

Change-Id: I92411642f12a00fc6bd0bfd24dd60fe67f0fed16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128845
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-12-18 19:01:51 +00:00
Konstantin Shcheglov 6de1c478c3 Revert "Revert "Issue 34152. Verify file paths and report INVALID_FILE_PATH_FORMAT.""
This reverts commit 3f8ea3f508.

Change-Id: Ib034895f4cf29492e66dd07b7da1a99ba5e94bf6
Reviewed-on: https://dart-review.googlesource.com/c/90885
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-01-24 17:30:41 +00:00
Konstantin Shcheglov 3f8ea3f508 Revert "Issue 34152. Verify file paths and report INVALID_FILE_PATH_FORMAT."
This reverts commit 5dab28f27f.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Issue 34152. Verify file paths and report INVALID_FILE_PATH_FORMAT.
> 
> R=​brianwilkerson@google.com, paulberry@google.com
> 
> Bug: https://github.com/dart-lang/sdk/issues/34152
> Change-Id: I4a5f3634c342fbcfb3bf39c060cc658d87306312
> Reviewed-on: https://dart-review.googlesource.com/c/90840
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

TBR=paulberry@google.com,scheglov@google.com,brianwilkerson@google.com

Change-Id: Ib34cb3497bc2935a27622b5f5b187e1e315c8e46
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/34152
Reviewed-on: https://dart-review.googlesource.com/c/90900
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-01-24 01:01:45 +00:00
Konstantin Shcheglov 5dab28f27f Issue 34152. Verify file paths and report INVALID_FILE_PATH_FORMAT.
R=brianwilkerson@google.com, paulberry@google.com

Bug: https://github.com/dart-lang/sdk/issues/34152
Change-Id: I4a5f3634c342fbcfb3bf39c060cc658d87306312
Reviewed-on: https://dart-review.googlesource.com/c/90840
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-01-23 22:11:17 +00:00
Brian Wilkerson 47e988b781 Clean up the remaining copyright notices in analysis_server
Change-Id: Iee3110f92ab0f24312ddd1eff407d2229f895321
Reviewed-on: https://dart-review.googlesource.com/c/89101
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-01-11 15:38:56 +00:00
Konstantin Shcheglov e3c8774543 Add AnalysisSession.analysisContext, stop using AnalysisDriver's AnalysisResult outside the driver.
Change-Id: I63138e002d9e777f51d2d843f7ef2b1f32fed3e0
Reviewed-on: https://dart-review.googlesource.com/c/82529
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-11-02 14:16:31 +00:00
Konstantin Shcheglov 1f52372bfa Remove CFE integration from analyzer, analysis_server, and analyzer_cli.
AnalysisDriverResolutionTest is partially updated, about 30 failing
tests added. I will get back to it in a following CL, it is not
directly CFE integration, but updated understanding how we want to
resolve. For example we don't need types for non-expression identifiers.

Change-Id: I3daddbb6c66ffad7a726f3313a1199fd7387aa04
Reviewed-on: https://dart-review.googlesource.com/71883
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-29 13:46:45 +00:00
Konstantin Shcheglov 6f9073bb9d Wait for Analysis Server errors only while waiting for a response.
Change-Id: Ifd07293322b69cc9bab98e3698d63249b62abdb0
Reviewed-on: https://dart-review.googlesource.com/69242
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-08-10 00:34:48 +00:00
Brian Wilkerson ef2f777625 Mark some analyzer tests as being flaky
Change-Id: I61838bd32427ea18000df33181cf908783607240
Reviewed-on: https://dart-review.googlesource.com/69180
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-09 16:19:41 +00:00
Brian Wilkerson 95d1ebd9f0 Fix one cause of timeouts in tests
Change-Id: I8514c7a1e89c69bbbf11882fa734903cd7c7569c
Reviewed-on: https://dart-review.googlesource.com/68430
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-08-06 16:08:05 +00:00
Brian Wilkerson f169ebf418 Fork several server tests to run under CFE
Change-Id: I9ca4184dc5458304f3f1597681fc1c936972d8bd
Reviewed-on: https://dart-review.googlesource.com/67880
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-08-01 20:18:40 +00:00
Danny Tuppeny 40d7fe87f1 Fix GetErrorsTest on Windows
Bug: https://github.com/dart-lang/sdk/issues/32226
Change-Id: I0636fb61ffdec435e5f84a6c85ae102151a5a609
Reviewed-on: https://dart-review.googlesource.com/43680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-02-26 15:27:37 +00:00
Danny Tuppeny 40e3f9addc Convert paths for mock SDK libraries to fix tests on Windows
The other lines on this method are calling `provider.convertPath` around their paths but these ones do not, which is causing almost all analysis server tests to fail on Windows (for me - I can't explain them not
failing builds). This causes the hard-coded paths like `/lib/core/core.dart` to be fixed up to `C:\lib\core\core.dart` which is what the server is looking for (because at the other end the paths *have* been fixed up).

See #32226.

Closes #32230
https://github.com/dart-lang/sdk/pull/32230

GitOrigin-RevId: 1adeee23f8ac8efc8acf61caf5f769e4ec44c030
Change-Id: Id9bf195967db0912c6f4b67bd79d504e627b8aab
Reviewed-on: https://dart-review.googlesource.com/42300
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-20 18:55:38 +00:00
Brian Wilkerson 1d8a5d77c1 Convert more tests to use ResourceProviderMixin
Change-Id: Ia4cce51e33c79c82a989bfda9b8303dfaa72e103
Reviewed-on: https://dart-review.googlesource.com/31880
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-01-02 00:47:34 +00:00
Konstantin Shcheglov 00d5012906 Format analyzer, analysis_server, analyzer_plugin, front_end and kernel with the latest dartfmt.
...instead of mixing formatting with actual changes in many CLs.

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2975253002 .
2017-07-13 16:28:18 -07:00
Brian Wilkerson a0d7d64f0b Convert more tests
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2936123002 .
2017-06-13 19:38:59 -07:00
Brian Wilkerson fb982f5476 Make server use the common protocol classes
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2879273002 .
2017-05-15 09:35:46 -07:00
Brian Wilkerson 27f9e5e4ce Reverse the sense of the flag to make it easier to find test that need to be converted
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2884593003 .
2017-05-15 08:40:40 -07:00
Brian Wilkerson e55812a3f2 Unify the server and plugin versions of the generators
R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/2844273003 .
2017-04-28 07:46:29 -07:00
Konstantin Shcheglov 05a86a7495 Remove 'initializeTestEnvironment' from 'analysis_server'.
Also fixes the server_options_test.dart:22 test broken in https://codereview.chromium.org/2394683006/

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

Review URL: https://codereview.chromium.org/2402483002 .
2016-10-06 10:26:17 -07:00
Konstantin Shcheglov de4d8b3a78 Switch analysis_server to use 'package:test'.
I'm changing DEPS in the corresponding analyzer CL.

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

Review URL: https://codereview.chromium.org/2394683006 .
2016-10-06 08:47:15 -07:00
Konstantin Shcheglov c302b65584 Use async/await in all analysis domain tests.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1478513002 .
2015-11-24 14:18:37 -08:00
Konstantin Shcheglov cfb7d61a9c Issue 25034. Record only the target source's errors.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/25034

Review URL: https://codereview.chromium.org/1477553002 .
2015-11-24 14:00:00 -08:00
Konstantin Shcheglov abe8d87e0e Implement AnalysisServer.getContainingContext() using ContextManager.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1455163005 .
2015-11-18 14:10:35 -08:00
Brian Wilkerson 9ad256cf18 Move the wire protocol support into the public API
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1398293002 .
2015-10-11 07:34:28 -07:00
Brian Wilkerson 908708d655 More fixes for failures on the Windows bot
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1266923004 .
2015-08-05 08:13:28 -07:00
Paul Berry 128dec84b5 Separate the API's used by ContextManager.
Previously, ContextManager had two API's: one used by analysis server
to tell the ContextManager what to do, and one used by the
ContextManager to make callbacks to analysis server in response to its
requests.  The first API was implemented in the class
AbstractContextManager, which derived from ContextManager, and the
second API was implemented in ServerContextManager, which derived from
AbstractContextManager.

In addition to causing confusion, this made it impossible to provide
an alternate implementation of ContextManager as a plug-in, since the
plug in would have had to re-implement the second API, and that would
have required accessing private implementation details of the
ContextManager.

This CL separates the API's: the first API is specified in
ContextManager and implemented in ContextManagerImpl, and the second
API is specified in ContextManagerCallbacks and implemented in
ServerContextManagerCallbacks.

In the long run I hope to eliminate the ContextManagerCallbacks class
entirely, by having the ContextManager tell its client what to do
using return values rather than callbacks.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//1243893002 .
2015-07-21 10:40:57 -07:00
Brian Wilkerson 0c6872acef Hook for overriding the ContextManager and some code clean-up (with more to follow)
R=paulberry@google.com

Review URL: https://codereview.chromium.org//1223413003 .
2015-07-13 10:20:13 -07:00
scheglov@google.com 9efb25fa50 Use package:test_reflective_loader instead of reflective_tests.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//1101003002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45365 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-22 20:54:29 +00:00
brianwilkerson@google.com cd58e290c4 Reformat
R=paulberry@google.com

Review URL: https://codereview.chromium.org//969113002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44151 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-02 22:43:12 +00:00
danrubel@google.com b35d83dbad Revert 43227
BUG=

Review URL: https://codereview.chromium.org//878353002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43228 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-28 04:48:18 +00:00
danrubel@google.com 5a7c80ab80 (TBR) fix the build
BUG=dartbug.com/22180

Review URL: https://codereview.chromium.org//882913003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43227 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-28 04:30:36 +00:00
scheglov@google.com a38a503d86 Replace @ReflectiveTestCase() with @reflectiveTest.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//849863002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42821 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-13 17:11:24 +00:00
scheglov@google.com c7a131a7d5 Churn only: move analysis notification tests.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//563373003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40396 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-17 20:16:29 +00:00
paulberry@google.com 9279b9fe81 Fix error handling in analysis.getError.
Analysis.getError now has the following behaviors:

- If the file in question does not exist, or is not subject to
  analysis, a new error called GET_ERRORS_INVALID_FILE is generated.

- If the server's internal state (the set of active analysis contexts)
  changes while the query is in process, the query is transparently
  restarted; the client no longer receives a GET_ERRORS_ERROR error.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//532403002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39871 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-04 14:34:43 +00:00
paulberry@google.com 8d8ee25cff Merge analysis_testing package into analysis_server.
Note that analysis_server already contains a file test/mocks.dart, so
the mocks.dart file from analysis_testing has been imported as
test/mocks2.dart.  I will merge these two into a single file in a
future CL.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//533243002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39814 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-03 18:11:42 +00:00
paulberry@google.com d092a96981 Clarify type names in analysis server API.
The following types are renamed:

- ErrorFixes -> AnalysisErrorFixes
- ErrorSeverity -> AnalysisErrorSeverity
- ErrorType -> AnalysisErrorType

This clarifies that the types have to do with the
errors/warnings/hints generated by the analysis of user code, as
opposed to analysis server protocol errors.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org//531153002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39770 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-02 19:54:03 +00:00
paulberry@google.com 3123e48d29 In the analysis server API, change RequestError.code to an enum.
Some of the error codes that were previously defined are no longer
used, so those have been removed.  The enum reflects the set of errors
that are currently in use.

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

Review URL: https://codereview.chromium.org//513853002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39689 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-29 07:30:43 +00:00
paulberry@google.com 0c0fd777a6 Finish modifying analysis server to make use of code generation.
Generated code is used to produce the response to these requests:
- analysis.updateOptions
- analysis.updateContent
- analysis.setSubscriptions
- analysis.setPriorityFiles
- analysis.setAnalysisRoots
- server.shutdown
- server.setSubscriptions

Generated code is used to produce these requests:
- server.shutdown
- server.getVersion
- server.shutdown
- server.connected

Generated code is used to produce these notifications:
- completion.results
- analysis.overrides
- analysis.outline
- analysis.occurrences

Generated code is used to decode these notifications:
- server.status

In addition, some dead code was removed, the 'protocol.dart' and
'protocol2.dart' files were combined, and the fields Response.result,
Request.params, and Notification.params were made private (to
encourage future use of the generated code).  Also, some overly
verbose import statements were cleaned up by using "hide" rather than
"show".

R=danrubel@google.com

Review URL: https://codereview.chromium.org//506433002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39516 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-25 10:48:16 +00:00
paulberry@google.com c5ff06636b Make more use of generated classes in analysis server.
Generated code is now used to process input JSON, and to create
requests and process responses in unit tests.  In addition, the
handwritten classes for ElementKind and SourceEdit have been replaced
with the gennerated versions.

Also some dead code has been removed.

R=scheglov@google.com

Review URL: https://codereview.chromium.org//492563002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39404 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-20 12:39:31 +00:00
paulberry@google.com c9b9b98343 Use generated classes to create requests in analysis server unit tests.
R=jwren@google.com

Review URL: https://codereview.chromium.org//477323005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39381 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-19 20:36:16 +00:00
paulberry@google.com 34699f46d5 Start using code-generated protocol classes in analysis server.
This updates the handlers for analysis.getErrors,
server.setSubscriptions, and analysis.setSubscriptions with simpler
versions that make use of the code-generated protocol classes, and
replaces the classes AnalysisError and AnalysisService with their
code-generated versions.

It also removes some dead code.

R=jwren@google.com

Review URL: https://codereview.chromium.org//486003003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39376 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-19 18:29:41 +00:00
scheglov@google.com e1e1febe72 Merge two constants.dart into one.
R=paulberry@google.com, brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org//478933003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39355 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-18 21:34:54 +00:00
paulberry@google.com 7226309842 Import analysis_services.dart into analysis_server.dart.
Having two separate packages doesn't really have any benefit, and has
the downside of forcing us to carefully avoid circular dependencies
between the two.  It makes more sense to just combine them.

This is largely a mechanical change consisting of the following renames:

1. pkg/analysis_services/lib/src/* -> pkg/analysis_server/lib/src/services/*
2. pkg/analysis_services/lib/* -> pkg/analysis_server/lib/src/services/*
3. pkg/analysis_services/test/* -> pkg/analysis_server/test/services/*

There were 4 instances where 1 and 2 created a collision:
.../services/correction/assist.dart, .../services/correction/fix.dart,
.../services/refactoring/refactoring.dart, and
.../services/search/search_engine_internal.dart.  To fix the
collision, the files coming from pkg/analysis_services/lib/src were
renamed to "..._internal.dart".

In addition, pkg/analysis_services/test/test_all.dart was modified to
call pkg/analysis_services/test/services/test_all.dart.

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

Review URL: https://codereview.chromium.org//484733003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39349 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-18 20:17:49 +00:00
paulberry@google.com 5353760386 Change the type of Error.code from int to String.
R=scheglov@google.com

Review URL: https://codereview.chromium.org//446983002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38940 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-06 18:44:13 +00:00
scheglov@google.com aba0cfa4e6 Remove any 'group' invocations enclosing 'runReflectiveTests'.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org//419563002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38547 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-24 18:08:45 +00:00