analysis_server_client
A client wrapper over analysis_server. Instances of the class Server manage a connection to a server process, and facilitate communication to and from the server.
2.0.1
dart-lang/sdk
What this package is like to depend on
Last release 4 years ago
no release in 18 months
Release timing varies
gaps range from 2 weeks to 2.5 years
Nearly every release is documented
notes for 8 of 8 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
8 releases · first in 2017
0 releases in the last 12 months
see the full history below
Release timeline
8 releases · Aug 2017 to Nov 2022Releases
latest 8-
2.0.107 Nov 2022Release notes
Open source →- Updated the readme to reflect that this package is discontinued; see https://github.com/dart-lang/sdk/issues/50262 for details.
-
2.0.020 Oct 2022Release notes
Open source →This is the first major version release of Dart since 1.0.0, so it contains many significant changes across all areas of the platform. Large changes include:
-
(Breaking) The unsound optional static type system has been replaced with a sound static type system using type inference and runtime checks. This was formerly called "strong mode" and only used by the Dart for web products. Now it is the one official static type system for the entire platform and replaces the previous "checked" and "production" modes.
-
(Breaking) Functions marked
asyncnow run synchronously until the firstawaitstatement. Previously, they would return to the event loop once at the top of the function body before any code runs (issue 30345). -
(Breaking) Constants in the core libraries have been renamed from
SCREAMING_CAPStolowerCamelCase. -
(Breaking) Many new methods have been added to core library classes. If you implement the interfaces of these classes, you will need to implement the new methods.
-
(Breaking) "dart:isolate" and "dart:mirrors" are no longer supported when using Dart for the web. They are still supported in the command-line VM.
-
(Breaking) Pub's transformer-based build system has been replaced by a new build system.
-
The
newkeyword is optional and can be omitted. Likewise,constcan be omitted inside a const context (issue 30921). -
Dartium is no longer maintained or supported.
Language
-
"Strong mode" is now the official type system of the language.
-
The
newkeyword is optional and can be omitted. Likewise,constcan be omitted inside a const context. -
A string in a
part ofdeclaration may now be used to refer to the library this file is part of. A library part can now declare its library as either:part of name.of.library;Or:
part of "uriReferenceOfLibrary.dart";This allows libraries with no library declarations (and therefore no name) to have parts, and it allows tools to easily find the library of a part file. The Dart 1.0 syntax is supported but deprecated.
-
Functions marked
asyncnow run synchronously until the firstawaitstatement. Previously, they would return to the event loop once at the top of the function body before any code runs (issue 30345). -
The type
voidis now a Top type likedynamic, andObject. It also now has new errors for being used where not allowed (such as being assigned to any non-void-typed parameter). Some libraries (importantly, mockito) may need to be updated to accept void values to keep their APIs working. -
Future flattening is now done only as specified in the Dart 2.0 spec, rather than more broadly. This means that the following code has an error on the assignment to
y.test() { Future<int> f; var x = f.then<Future<List<int>>>((x) => []); Future<List<int>> y = x; } -
Invocations of
noSuchMethod()receive default values for optional args. The following program used to print "No arguments passed", and now prints "First argument is 3".abstract class B { void m([int x = 3]); } class A implements B { noSuchMethod(Invocation i) { if (i.positionalArguments.length == 0) { print("No arguments passed"); } else { print("First argument is ${i.positionalArguments[0]}"); } } } void main() { A().m(); } -
Bounds on generic functions are invariant. The following program now issues an invalid override error (issue 29014):
class A { void f<T extends int>() {} } class B extends A { @override void f<T extends num>() {} } -
Numerous corner case bugs around return statements in synchronous and asynchronous functions fixed. Specifically:
-
An empty
return;in an async function with return typeFuture<Object>does not report an error. -
return exp;whereexphas typevoidin an async function is now an error unless the return type of the function isvoidordynamic. -
Mixed return statements of the form
return;andreturn exp;are now allowed whenexphas typevoid. -
A compile time error is emitted for any literal which cannot be exactly represented on the target platform. As a result, dart2js and DDC report errors if an integer literal cannot be represented exactly in JavaScript (issue 33282).
-
New member conflict rules have been implemented. Most cases of conflicting members with the same name are now static errors (issue 33235).
Core libraries
-
Replaced
UPPER_CASEconstant names withlowerCamelCase. For example,HTML_ESCAPEis nowhtmlEscape. -
The Web libraries were re-generated using Chrome 63 WebIDLs (details).
dart:asyncStream:- Added
castandcastFrom. - Changed
firstWhere,lastWhere, andsingleWhereto returnFuture<T>and added an optionalT orElse()callback.
- Added
StreamTransformer: addedcastandcastFrom.StreamTransformerBase: new class.Timer: addedtickproperty.Zone- changed to be strong-mode clean. This required some breaking API changes. See https://goo.gl/y9mW2x for more information.
- Added
bindBinaryCallbackGuarded,bindCallbackGuarded, andbindUnaryCallbackGuarded. - Renamed
Zone.ROOTtoZone.root.
- Removed the deprecated
defaultValueparameter onStream.firstWhereandStream.lastWhere. - Changed an internal lazily-allocated reusable "null future" to always belong to the root zone. This avoids race conditions where the first access to the future determined which zone it would belong to. The zone is only used for scheduling the callback of listeners, the listeners themselves will run in the correct zone in any case. Issue #32556.
dart:cli- New "provisional" library for CLI-specific features.
waitFor: function that suspends a stack to wait for aFutureto complete.
dart:collectionMapBase: addedmapToString.LinkedHashMapno longer implementsHashMapLinkedHashSetno longer implementsHashSet.- Added
ofconstructor toQueue,ListQueue,DoubleLinkedQueue,HashSet,LinkedHashSet,SplayTreeSet,Map,HashMap,LinkedHashMap,SplayTreeMap. - Removed
Mapsclass. ExtendMapBaseor mix inMapMixininstead to provide map method implementations for a class. - Removed experimental
DocumentmethodgetCSSCanvasContextand propertysupportsCssCanvasContext. - Removed obsolete
Elementpropertyxtagno longer supported in browsers. - Exposed
ServiceWorkerclass. - Added constructor to
MessageChannelandMessagePortaddEventListenerautomatically callsstartmethod to receive queued messages.
dart:convertBase64Codec.decodereturn type is nowUint8List.JsonUnsupportedObjectError: addedpartialResultpropertyLineSplitternow implementsStreamTransformer<String, String>instead ofConverter. It retainsConvertermethodsconvertandstartChunkedConversion.Utf8Decoderwhen compiled with dart2js uses the browser'sTextDecoderin some common cases for faster decoding.- Renamed
ASCII,BASE64,BASE64URI,JSON,LATIN1andUTF8toascii,base64,base64Uri,json,latin1andutf8. - Renamed the
HtmlEscapeModeconstantsUNKNOWN,ATTRIBUTE,SQ_ATTRIBUTEandELEMENTtounknown,attribute,sqAttributeandelements. - Added
jsonEncode,jsonDecode,base64Encode,base64UrlEncodeandbase64Decodetop-level functions. - Changed return type of
encodeonAsciiCodecandLatin1Codec, andconvertonAsciiEncoder,Latin1Encoder, toUint8List. - Allow
utf8.decoder.fuse(json.decoder)to ignore leading Unicode BOM.
dart:coreBigIntclass added to support integers greater than 64-bits.- Deprecated the
proxyannotation. - Added
Provisionalclass andprovisionalfield. - Added
pragmaannotation. RegExpadded staticescapefunction.- The
Uriclass now correctly handles paths while running on Node.js on Windows. - Core collection changes:
Iterableadded memberscast,castFrom,followedByandwhereType.Iterable.singleWhereaddedorElseparameter.Listadded+operator,firstandlastsetters, andindexWhereandlastIndexWheremethods, and staticcopyRangeandwriteIterablemethods.MapaddedfromEntriesconstructor.MapaddedaddEntries,cast,entries,map,removeWhere,updateandupdateAllmembers.MapEntry: new class used byMap.entries.- Note: if a class extends
IterableBase,ListBase,SetBaseorMapBase(or uses the corresponding mixins) fromdart:collection, the new members are implemented automatically. - Added
ofconstructor toList,Set,Map.
- Renamed
double.INFINITY,double.NEGATIVE_INFINITY,double.NAN,double.MAX_FINITEanddouble.MIN_POSITIVEtodouble.infinity,double.negativeInfinity,double.nan,double.maxFiniteanddouble.minPositive. - Renamed the following constants in
DateTimeto lower case:MONDAYthroughSUNDAY,DAYS_PER_WEEK(asdaysPerWeek),JANUARYthroughDECEMBERandMONTHS_PER_YEAR(asmonthsPerYear). - Renamed the following constants in
Durationto lower case:MICROSECONDS_PER_MILLISECONDtomicrosecondsPerMillisecond,MILLISECONDS_PER_SECONDtomillisecondsPerSecond,SECONDS_PER_MINUTEtosecondsPerMinute,MINUTES_PER_HOURtominutesPerHour,HOURS_PER_DAYtohoursPerDay,MICROSECONDS_PER_SECONDtomicrosecondsPerSecond,MICROSECONDS_PER_MINUTEtomicrosecondsPerMinute,MICROSECONDS_PER_HOURtomicrosecondsPerHour,MICROSECONDS_PER_DAYtomicrosecondsPerDay,MILLISECONDS_PER_MINUTEtomillisecondsPerMinute,MILLISECONDS_PER_HOURtomillisecondsPerHour,MILLISECONDS_PER_DAYtomillisecondsPerDay,SECONDS_PER_HOURtosecondsPerHour,SECONDS_PER_DAYtosecondsPerDay,MINUTES_PER_DAYtominutesPerDay, andZEROtozero. - Added
typeArgumentstoInvocationclass. - Added constructors to invocation class that allows creation of
Invocationobjects directly, without going throughnoSuchMethod. - Added
unaryMinusandemptyconstant symbols on theSymbolclass. - Changed return type of
UriData.dataAsBytestoUint8List. - Added
tryParsestatic method toint,double,num,BigInt,UriandDateTime. - Deprecated
onErrorparameter onint.parse,double.parseandnum.parse. - Deprecated the
NoSuchMethodErrorconstructor. int.parseon the VM no longer accepts unsigned hexadecimal numbers greater than or equal to2**63when not prefixed by0x. (SDK issue 32858)
dart:developerFlowclass added.Timeline.startSyncandTimeline.timeSyncnow accepts an optional parameterflowof typeFlow. Theflowparameter is used to generate flow timeline events that are enclosed by the slice described byTimeline.{start,finish}SyncandTimeline.timeSync.
<!-- Still need entries for all changes to dart:html since 1.x -->
dart:html- Removed deprecated
queryandqueryAll. UsequerySelectorandquerySelectorAll.
dart:ioHttpStatusaddedUPGRADE_REQUIRED.IOOverridesandHttpOverridesadded to aid in writing tests that wish to mock variosdart:ioobjects.Platform.operatingSystemVersionadded that gives a platform-specific String describing the version of the operating system.ProcessStartMode.INHERIT_STDIOadded, which allows a child process to inherit the parent's stdio handles.RawZLibFilteradded for low-level access to compression and decompression routines.- Unified backends for
SecureSocket,SecurityContext, andX509Certificateto be consistent across all platforms. AllSecureSocket,SecurityContext, andX509Certificateproperties and methods are now supported on iOS and OSX. SecurityContext.alpnSupporteddeprecated as ALPN is now supported on all platforms.SecurityContext: addedwithTrustedRootsnamed optional parameter constructor, which defaults to false.- Added a
timeoutparameter toSocket.connect,RawSocket.connect,SecureSocket.connectandRawSecureSocket.connect. If a connection attempt takes longer than the duration specified intimeout, aSocketExceptionwill be thrown. Note: if the duration specified intimeoutis greater than the OS level timeout, a timeout may occur sooner than specified intimeout. Stdin.hasTerminaladded, which is true if stdin is attached to a terminal.WebSocketadded staticuserAgentproperty.RandomAccessFile.closereturnsFuture<void>- Added
IOOverrides.socketConnect. - Added Dart-styled constants to
ZLibOptions,FileMode,FileLock,FileSystemEntityType,FileSystemEvent,ProcessStartMode,ProcessSignal,InternetAddressType,InternetAddress,SocketDirection,SocketOption,RawSocketEvent, andStdioType, and deprecated the oldSCREAMING_CAPSconstants. - Added the Dart-styled top-level constants
zlib,gzip, andsystemEncoding, and deprecated the oldSCREAMING_CAPStop-level constants. - Removed the top-level
FileModeconstantsREAD,WRITE,APPEND,WRITE_ONLY, andWRITE_ONLY_APPEND. Please use e.g.FileMode.readinstead. - Added
X509Certificate.der,X509Certificate.pem, andX509Certificate.sha1. - Added
FileSystemEntity.fromRawPathconstructor to allow for the creation ofFileSystemEntityusingUint8Listbuffers. - Dart-styled constants have been added for
HttpStatus,HttpHeaders,ContentType,HttpClient,WebSocketStatus,CompressionOptions, andWebSocket. TheSCREAMING_CAPSconstants are marked deprecated. Note thatHttpStatus.CONTINUEis nowHttpStatus.continue_, and that e.g.HttpHeaders.FIELD_NAMEis nowHttpHeaders.fieldNameHeader. - Deprecated
Platform.packageRoot, which is only used forpackages/directory resolution which is no longer supported. It will now always return null, which is a value that was always possible for it to return previously. - Adds
HttpClient.connectionTimeout. - Adds
{Socket,RawSocket,SecureSocket}.startConnect. These return aConnectionTask, which can be used to cancel an in-flight connection attempt.
dart:isolate- Make
Isolate.spawntake a type parameter representing the argument type of the provided function. This allows functions with arguments types other thanObjectin strong mode. - Rename
IMMEDIATEandBEFORE_NEXT_EVENTonIsolatetoimmediateandbeforeNextEvent. - Deprecated
Isolate.packageRoot, which is only used forpackages/directory resolution which is no longer supported. It will now always return null, which is a value that was always possible for it to return previously. - Deprecated
packageRootparameter inIsolate.spawnUri, which is was previously used only forpackages/directory resolution. That style of resolution is no longer supported in Dart 2.
<!-- Still need entries for all changes to dart:js since 1.x -->
dart.math- Renamed
E,LN10,LN,LOG2E,LOG10E,PI,SQRT1_2andSQRT2toe,ln10,ln,log2e,log10e,pi,sqrt1_2andsqrt2.
dart.mirrors- Added
IsolateMirror.loadUri, which allows dynamically loading additional code. - Marked
MirrorsUsedas deprecated. TheMirrorsUsedannotation was only used to inform the dart2js compiler about how mirrors were used, but dart2js no longer supports the mirrors library altogether.
<!-- Still need entries for all changes to dart:svg since 1.x -->
dart:typed_data- Added
Unmodifiableview classes over allListtypes. - Renamed
BYTES_PER_ELEMENTtobytesPerElementon all typed data lists. - Renamed constants
XXXXthroughWWWWonFloat32x4andInt32x4to lower-casexxxxthroughwwww. - Renamed
EndinannesstoEndianand its constants fromBIG_ENDIAN,LITTLE_ENDIANandHOST_ENDIANtolittle,bigandhost.
<!-- Still need entries for all changes to dart:web_audio,web_gl,web_sql since 1.x -->
Dart VM
-
Support for MIPS has been removed.
-
Dart
intis now restricted to 64 bits. On overflow, arithmetic operations wrap around, and integer literals larger than 64 bits are not allowed. See https://github.com/dart-lang/sdk/blob/main/docs/language/informal/int64.md for details. -
The Dart VM no longer attempts to perform
packages/directory resolution (for loading scripts, and inIsolate.resolveUri). Users relying onpackages/directories should switch to.packagesfiles.
Dart for the Web
-
Expose JavaScript Promise APIs using Dart futures. For example,
BackgroundFetchManager.getis defined as:Future<BackgroundFetchRegistration> get(String id)It can be used like:
BackgroundFetchRegistration result = await fetchMgr.get('abc');The underlying JS Promise-to-Future mechanism will be exposed as a public API in the future.
Dart Dev Compiler (DDC)
-
dartdevc will no longer throw an error from
ischecks that return a different result in weak mode (SDK issue 28988). For example:main() { List l = []; // Prints "false", does not throw. print(l is List<String>); } -
Failed
ascasts onIterable<T>,Map<T>,Future<T>, andStream<T>are no longer ignored. These failures were ignored to make it easier to migrate Dart 1 code to strong mode, but ignoring them is a hole in the type system. This closes part of that hole. (We still need to stop ignoring "as" cast failures on function types, and implicit cast failures on the above types and function types.)
dart2js
-
dart2js now compiles programs with Dart 2.0 semantics. Apps are expected to be bigger than before, because Dart 2.0 has many more implicit checks (similar to the
--checkedflag in Dart 1.0).We exposed a
--omit-implicit-checksflag which removes most of the extra implicit checks. Only use this if you have enough test coverage to know that the app will work well without the checks. If a check would have failed and it is omitted, your app may crash or behave in unexpected ways. This flag is similar to--trust-type-annotationsin Dart 1.0. -
dart2js replaced its front-end with the common front-end (CFE). Thanks to the CFE, dart2js errors are more consistent with all other Dart tools.
-
dart2js replaced its source-map implementation. There aren't any big differences, but more data is emitted for synthetic code generated by the compiler.
-
dart:mirrorssupport was removed. Frameworks are encouraged to use code-generation instead. Conditional imports indicate that mirrors are not supported, and any API in the mirrors library will throw at runtime. -
The generated output of dart2js can now be run as a webworker.
-
dart:isolatesupport was removed. To launch background tasks, please use webworkers instead. APIs for webworkers can be accessed fromdart:htmlor JS-interop. -
dart2js no longer supports the
--package-rootflag. This flag was deprecated in favor of--packageslong ago.
Tool Changes
Analyzer
-
The analyzer will no longer issue a warning when a generic type parameter is used as the type in an instance check. For example:
test<T>() { print(3 is T); // No warning } -
New static checking of
@visibleForTestingelements. Accessing a method, function, class, etc. annotated with@visibleForTestingfrom a file not in atest/directory will result in a new hint (issue 28273). -
Static analysis now respects functions annotated with
@alwaysThrows(issue 31384). -
New hints added:
-
NULL_AWARE_BEFORE_OPERATORwhen an operator is used after a null-aware access. For example:x?.a - ''; // HINT -
NULL_AWARE_IN_LOGICAL_OPERATORwhen an expression with null-aware access is used as a condition in logical operators. For example:x.a || x?.b; // HINT
-
-
The command line analyzer (dartanalyzer) and the analysis server no longer treat directories named
packagesspecially. Previously they had ignored these directories - and their contents - from the point of view of analysis. Now they'll be treated just as regular directories. This special-casing ofpackagesdirectories was to support using symlinks for package: resolution; that functionality is now handled by.packagesfiles. -
New static checking of duplicate shown or hidden names in an export directive (issue 33182).
-
The analysis server will now only analyze code in Dart 2 mode ('strong mode'). It will emit warnings for analysis options files that have
strong-mode: falseset (and will emit a hint forstrong-mode: true, which is no longer necessary). -
The dartanalyzer
--strongflag is now deprecated and ignored. The command-line analyzer now only analyzes code in strong mode.
dartfmt
-
Support
assert()in const constructor initializer lists. -
Better formatting for multi-line strings in argument lists.
-
Force splitting an empty block as the then body of an if with an else.
-
Support metadata annotations on enum cases.
-
Add
--fixto remove unneedednewandconstkeywords, and change:to=before named parameter default values. -
Change formatting rules around static methods to uniformly format code with and without
newandconst. -
Format expressions inside string interpolation.
Pub
-
Pub has a brand new version solver! It supports all the same features as the old version solver, but it's much less likely to stall out on difficult package graphs, and it's much clearer about why a solution can't be found when version solving fails.
-
Remove support for transformers,
pub build, andpub serve. Use the [new build system][transformers] instead. -
There is now a default SDK constraint of
<2.0.0for any package with no existing upper bound. This allows us to move more safely to 2.0.0. All new packages published on pub will now require an upper bound SDK constraint so future major releases of Dart don't destabilize the package ecosystem.All SDK constraint exclusive upper bounds are now treated as though they allow pre-release versions of that upper bound. For example, the SDK constraint
>=1.8.0 <2.0.0now allows pre-release SDK versions such as2.0.0-beta.3.0. This allows early adopters to try out packages that don't explicitly declare support for the new version yet. You can disable this functionality by setting thePUB_ALLOW_PRERELEASE_SDKenvironment variable tofalse. -
Allow depending on a package in a subdirectory of a Git repository. Git dependencies may now include a
pathparameter, indicating that the package exists in a subdirectory of the Git repository. For example:dependencies: foobar: git: url: git://github.com/dart-lang/multi_package_repo path: pkg/foobar -
Added an
--executablesoption topub depscommand. This will list all available executables that can be run withpub run. -
The Flutter
sdksource will now look for packages influtter/bin/cache/pkg/as well asflutter/packages/. In particular, this means that packages can depend on thesky_enginepackage from thesdksource (issue 1775). -
Pub now caches compiled packages and snapshots in the
.dart_tool/pubdirectory, rather than the.pubdirectory (issue 1795). -
Other bug fixes and improvements.
Release notes
Open source →- Migrated to null safety.
- Now supporting protocol version
1.33.4, including the new completion protocol. - Switched to using
package:lintsfor analysis.
-
-
1.1.307 May 2020Release notes
Open source →- Supports changes made to the Analysis Server protocol through Dart 2.8.0.
- Updates to use pedantic 1.9.0 and some internal refactoring.
-
1.1.201 Nov 2019Release notes
Open source →- Update the dartfix protocol to include
--pedantic - Supports changes made to Analysis Server protocol through Dart 2.6.0
- Update the dartfix protocol to include
-
1.1.120 Nov 2018 -
1.1.016 Nov 2018Release notes
Open source →- Add analysis server protocol consts and classes
- Overhaul the Server class
- Add an example showing analysis of *.dart files in a directory
- Update the required SDK
-
1.0.108 Aug 2017 -
1.0.008 Aug 2017