This does not remove the computation of available declarations. This CL
seemed big enough without that, so I (or someone else) can get that in
the next CL.
Change-Id: I67ab49b75c8a415ccfaef16c4e49a00026a6091f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341160
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Sorry for the long CL; once again I couldn't find a reasonable way to
split it up into smaller pieces.
This CL causes all of the elements from imports to be generated by the
new approach.
It does contain a new flag that is used to preserve the current
semantics when computing completions for Cider. I hope to be able to
make the new approach efficient enough that we can remove this flag,
but I can't realistically do that until more of the approach is
implemented.
I'm also not fond of the way it fails to handle conflicts in the import
scope. There's a TODO marking the places that would need to be changed,
but the current behavior is that if the same name N is imported from
two or more imports and they refer to different elements, the first one
found will be suggested and others won't. I don't think we want to
suggest any of them unless we also fix the imports so that the name
won't be conflicting. I'm not sure how we want to do that, but it needs
to work with whatever optimization approach we choose.
I think the changes to the tests are all positive, but please double
check that I haven't missed a good reason for the previous behavior.
Change-Id: I70d4514a67988f654984ac20f33b2d7a3cfc78e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340282
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Caching the formatter (something we recently discussed removing) was causing issues if you formatted multiple files with different line endings.
It might be a VS Code bug that "\r\n" is being rendered with a blank line in between when the document was in LF mode, but I'll investigate that separately and file an issue there if required.
Fixes https://github.com/Dart-Code/Dart-Code/issues/4865
Change-Id: Ib5ec5355f078bc8dd2b30440fd253663727a2b66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340220
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
This should have been a small change to keep us in-sync with small changes so when there are bigger changes (LSP 3.18.0) the change is less noisy.
However, it turns out the meta model is built from the latest version always, so it includes 3.18.0 proposed features.
So this change not only regenerates the code with the latest spec, it also adds some handling to exclude any types (and methods) marked as proposed.
It also includes a few minor fixes to things like re-wrapping of comments where there are references.
So, it should still essentially be a non-functional change, but the CL isn't as small as planned because of the cleanup.
- The lsp_meta_model.json file is downloaded and not changes I've made
- The protocol_generated.dart file is the output of the code-gen
- All other files are changes I made manually
Change-Id: I6380f86848d2799cf94d58a419ace0bf0d5a35ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/340040
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
- Use YamlNode to access spans and offsets instead of casting.
- Add logic to merge conflicting edits when removing multiple entries
from dev_dependencies.
Change-Id: I1f20b5a4691c37e9f56293acbaf870a489380b9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338592
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Sorry for the length of the CL. I couldn't really think of a good way
to split it up further.
The first pass was previously suggesting everything declared in scopes
below the class level. This CL expands that to include everything
declared in the current library. It does not include imported
declarations. It also doesn't yet handle members suggested after a
period. Those are both being handled by constributors.
Please look over the tests carefully. There are more changes than I
would have liked, although I think they're mostly for the better (as
in, the suggestions are more accurate), but I could easily have
missed an invalid change.
Change-Id: I98b3cfc8440ee5da09a8e6828c946d65d8d77759
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338482
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
This reverts commit d032598d26.
Reason for revert: SDK build is broken if the checkout path includes "build" as a path segment.
Original change's description:
> Support multiple packages in a PubWorkspace.
>
> A PubWorkspace is now
> - rooted at package config, or the outermost pubspec if there is no package config
> - packages are identified by pubspec
> - all packages are considered to be package build packages
>
> Change-Id: Id1552ab584ccedf60a482b93b375d1c4c7da6796
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337607
> Commit-Queue: Keerti Parthasarathy <keertip@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Samuel Rawlins <srawlins@google.com>
Change-Id: I2ecda907b8bb6164c7cc5446aceff1f168810341
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338560
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Auto-Submit: William Hesse <whesse@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
A PubWorkspace is now
- rooted at package config, or the outermost pubspec if there is no package config
- packages are identified by pubspec
- all packages are considered to be package build packages
Change-Id: Id1552ab584ccedf60a482b93b375d1c4c7da6796
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337607
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
No functional changes, just some refactoring extracted from another change to simplify reviewing.
This just:
- adds an `initialAnalysis` getter for tests since it's very common to wait for
- adds a `diagnostics` map that tracks the current state of diagnostics in a test (to avoid tests setting up their own tracking)
- removes some duplicating code for sending diagnostics by having NotificationManager call LspAnalysisServer to send them
- removes unnecessary experiment flags from LSP tests
Change-Id: I1811f393a6d3446550f9007ede926f9ca4556563
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/337580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
In this CL we "remove" 3 linter rules, and any subsequently unused quick fixes:
* `always_require_non_null_named_parameters`
* `avoid_returning_null`
* `avoid_returning_null_for_future`
We also delete any code that branched on pre-NNBD libraries; these are
no longer supported.
Change-Id: I3bad7a44de3563e5737919c878170213ad506b82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/336244
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>