@@ -23,7 +23,7 @@ const String experimental = 'experimental';
2323
2424final Logger _logger = new Logger ('analysis_server' );
2525
26- const String generatedProtocolVersion = '1.33.4 ' ;
26+ const String generatedProtocolVersion = '1.34.0 ' ;
2727
2828typedef MethodSend = void Function (String methodName);
2929
@@ -367,6 +367,45 @@ class ServerDomain extends Domain {
367367 /// may be incomplete or inaccurate. This request always completes without
368368 /// error regardless of whether the request is successfully cancelled.
369369 Future cancelRequest (String id) => _call ('server.cancelRequest' , {'id' : id});
370+
371+ /// Record the capabilities supported by the client. The default values,
372+ /// documented below, will be assumed until this request is received.
373+ Future setClientCapabilities (List <String > requests) =>
374+ _call ('server.setClientCapabilities' , {'requests' : requests});
375+
376+ /// **Note:** This is a request from the server to the client.
377+ ///
378+ /// Request that a URL be opened.
379+ ///
380+ /// The client is expected to open the URL, either within the client's UI or
381+ /// in the default browser.
382+ ///
383+ /// The request will only be sent from the server to the client if the client
384+ /// has indicated that it supports this request by using the
385+ /// `setClientCapabilities` request.
386+ Future openUrlRequest (String url) =>
387+ _call ('server.openUrlRequest' , {'url' : url});
388+
389+ /// **Note:** This is a request from the server to the client.
390+ ///
391+ /// Request that a message be displayed to the user.
392+ ///
393+ /// The client is expected to display the message to the user with one or more
394+ /// buttons with the specified labels, and to return a response consisting of
395+ /// the label of the button that was clicked.
396+ ///
397+ /// The request will only be sent from the server to the client if the client
398+ /// has indicated that it supports this request by using the
399+ /// `setClientCapabilities` request.
400+ ///
401+ /// This request is modeled after the ( same request from the LSP
402+ /// specification)[https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#window_showMessageRequest] .
403+ Future <ShowMessageRequestResult > showMessageRequest (
404+ String ? type, String ? message, List <MessageAction >? actions) {
405+ final Map m = {'type' : type, 'message' : message, 'actions' : actions};
406+ return _call ('server.showMessageRequest' , m)
407+ .then (ShowMessageRequestResult .parse);
408+ }
370409}
371410
372411class ServerConnected {
@@ -433,6 +472,18 @@ class VersionResult {
433472 VersionResult (this .version);
434473}
435474
475+ class ShowMessageRequestResult {
476+ static ShowMessageRequestResult parse (Map m) =>
477+ new ShowMessageRequestResult (action: m['action' ]);
478+
479+ /// The label of the action that was selected by the user. May be omitted or
480+ /// `null` if the user dismissed the message without clicking an action
481+ /// button.
482+ final String ? action;
483+
484+ ShowMessageRequestResult ({this .action});
485+ }
486+
436487// analysis domain
437488
438489/// The analysis domain contains API's related to the analysis of files.
@@ -1248,7 +1299,7 @@ class CompletionResults {
12481299
12491300 /// The client is expected to check this list against the `ElementKind` sent
12501301 /// in `IncludedSuggestionSet` to decide whether or not these symbols should
1251- /// should be presented to the user.
1302+ /// be presented to the user.
12521303 final List <String >? includedElementKinds;
12531304
12541305 /// The client is expected to check this list against the values of the field
@@ -2526,7 +2577,6 @@ class AnalysisOptions implements Jsonable {
25262577 enableDeferredLoading: m['enableDeferredLoading' ],
25272578 enableEnums: m['enableEnums' ],
25282579 enableNullAwareOperators: m['enableNullAwareOperators' ],
2529- enableSuperMixins: m['enableSuperMixins' ],
25302580 generateDart2jsHints: m['generateDart2jsHints' ],
25312581 generateHints: m['generateHints' ],
25322582 generateLints: m['generateLints' ]);
@@ -2558,10 +2608,6 @@ class AnalysisOptions implements Jsonable {
25582608 @deprecated
25592609 final bool ? enableNullAwareOperators;
25602610
2561- /// True if the client wants to enable support for the proposed "less
2562- /// restricted mixins" proposal (DEP 34).
2563- final bool ? enableSuperMixins;
2564-
25652611 /// True if hints that are specific to dart2js should be generated. This
25662612 /// option is ignored if generateHints is false.
25672613 final bool ? generateDart2jsHints;
@@ -2579,7 +2625,6 @@ class AnalysisOptions implements Jsonable {
25792625 this .enableDeferredLoading,
25802626 this .enableEnums,
25812627 this .enableNullAwareOperators,
2582- this .enableSuperMixins,
25832628 this .generateDart2jsHints,
25842629 this .generateHints,
25852630 this .generateLints});
@@ -2589,7 +2634,6 @@ class AnalysisOptions implements Jsonable {
25892634 'enableDeferredLoading' : enableDeferredLoading,
25902635 'enableEnums' : enableEnums,
25912636 'enableNullAwareOperators' : enableNullAwareOperators,
2592- 'enableSuperMixins' : enableSuperMixins,
25932637 'generateDart2jsHints' : generateDart2jsHints,
25942638 'generateHints' : generateHints,
25952639 'generateLints' : generateLints
@@ -3910,6 +3954,22 @@ class Location implements Jsonable {
39103954 '[Location file: ${file }, offset: ${offset }, length: ${length }, startLine: ${startLine }, startColumn: ${startColumn }]' ;
39113955}
39123956
3957+ /// An action associated with a message that the server is requesting the client
3958+ /// to display to the user.
3959+ class MessageAction implements Jsonable {
3960+ static MessageAction parse (Map m) {
3961+ return new MessageAction (m['label' ]);
3962+ }
3963+
3964+ /// The label of the button to be displayed, and the value to be returned to
3965+ /// the server if the button is clicked.
3966+ final String label;
3967+
3968+ MessageAction (this .label);
3969+
3970+ Map toMap () => _stripNullValues ({'label' : label});
3971+ }
3972+
39133973/// A description of a region from which the user can navigate to the
39143974/// declaration of an element.
39153975class NavigationRegion {
@@ -4521,7 +4581,7 @@ class TypeHierarchyItem {
45214581 final List <int > interfaces;
45224582
45234583 /// The indexes of the items representing the mixins referenced by this class.
4524- /// The list will be empty if there are no classes mixed in to this class.
4584+ /// The list will be empty if there are no classes mixed into this class.
45254585 final List <int > mixins;
45264586
45274587 /// The indexes of the items representing the subtypes of this class. The list
0 commit comments