Files
sdk/pkg/analysis_server
Sam Rawlins 293469ee22 linter: unn_lambdas: check assignability of constructor types
Basically, in `_visitInstanceCreation`, we make sure that, given an
expression like `(e) => C(e))`, that the function type of the outer
function expression is the same as the function type of `C(e)`.

And little cleanups:

* _extractElementsOfSimpleIdentifiers's returned Iterable is only used
  to check whether it contains something, so change it to a Set.
* In `isFinalNode`, use `unParenthesized` to unwrap parens, rather
  calling recursively.
* In `_Visitor`, we stored a `LinterContext`, but we only need the
  TypeSystem object, so just store that for more terse code later.
* In `_visitInstanceCreation`, remove the local function, `matches`,
  by checking whether all arguments are SimpleIdentifiers.
* Convert `isFinalElement` to an extension getter on `Expression`.
* Remove helper `isTearoffAssignable`. It is more concise and I think
  easier to read to just use TypeSystem.isSubtypeOf on its own.
* When looking at a VariableDeclaration, get the type from the
  declared element, which will include inference, rather than the
  literal type annotation on the declaration.

Fixes https://github.com/dart-lang/linter/issues/4914
Fixes https://github.com/dart-lang/linter/issues/3516

Change-Id: I3e89ee4dc011473511d375b0ad324988232c8c96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/364628
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-04-29 20:55:39 +00:00
..
2022-02-14 14:06:34 +00:00
2021-09-09 18:14:36 +00:00

analysis_server

A long-running process that provides analysis results to other tools.

The analysis server is designed to provide on-going analysis of one or more code bases as those code bases are changing.

Using the server

The analysis server is not intended to be used stand-alone, and therefore does not have a human-friendly user interface.

Clients (typically tools, such as an editor) are expected to run the analysis server in a separate process and communicate with it using a JSON protocol. The original protocol is specified in the file analysis_server/doc/api.html and Language Server Protocol support is documented in tool/lsp_spec/README.md.

Features and bugs

Please file feature requests and bugs at the issue tracker.