Version 2.14.0-207.0.dev
Merge commit 'd75becf4acbb44013ac0c3de6dd489e0291cad32' into 'dev'
diff --git a/pkg/analysis_server/doc/api.html b/pkg/analysis_server/doc/api.html
index bddbd61..3aa4e18 100644
--- a/pkg/analysis_server/doc/api.html
+++ b/pkg/analysis_server/doc/api.html
@@ -109,7 +109,7 @@
<body>
<h1>Analysis Server API Specification</h1>
<h1 style="color:#999999">Version
- 1.32.5
+ 1.32.7
</h1>
<p>
This document contains a specification of the API provided by the
@@ -236,6 +236,13 @@
ignoring the item or treating it with some default/fallback handling.
</p>
<h3>Changelog</h3>
+<h4>1.32.7</h4>
+<ul>
+ <li><tt>HoverInformation.elementDescription</tt> may now include linebreaks to
+ improve formatting of functions and methods with many parameters. This is not
+ an API change but may be useful as a signal for clients that previously did their
+ own formatting.</li>
+</ul>
<h4>1.32.6</h4>
<ul>
<li>Added <tt>FoldingKind.PARAMETERS</tt> for folding regions for parameters
diff --git a/pkg/analysis_server/lib/protocol/protocol_constants.dart b/pkg/analysis_server/lib/protocol/protocol_constants.dart
index 6772e9d..c06dbe8 100644
--- a/pkg/analysis_server/lib/protocol/protocol_constants.dart
+++ b/pkg/analysis_server/lib/protocol/protocol_constants.dart
@@ -6,7 +6,7 @@
// To regenerate the file, use the script
// "pkg/analysis_server/tool/spec/generate_files".
-const String PROTOCOL_VERSION = '1.32.5';
+const String PROTOCOL_VERSION = '1.32.7';
const String ANALYSIS_NOTIFICATION_ANALYZED_FILES = 'analysis.analyzedFiles';
const String ANALYSIS_NOTIFICATION_ANALYZED_FILES_DIRECTORIES = 'directories';
diff --git a/pkg/analysis_server/lib/src/computer/computer_hover.dart b/pkg/analysis_server/lib/src/computer/computer_hover.dart
index 8ec1bb5..6cf3f1b 100644
--- a/pkg/analysis_server/lib/src/computer/computer_hover.dart
+++ b/pkg/analysis_server/lib/src/computer/computer_hover.dart
@@ -20,14 +20,8 @@
final DartdocDirectiveInfo _dartdocInfo;
final CompilationUnit _unit;
final int _offset;
- final bool multilineElementDescriptions;
- DartUnitHoverComputer(
- this._dartdocInfo,
- this._unit,
- this._offset, {
- this.multilineElementDescriptions = false,
- });
+ DartUnitHoverComputer(this._dartdocInfo, this._unit, this._offset);
/// Returns the computed hover, maybe `null`.
HoverInformation? compute() {
@@ -139,7 +133,7 @@
String? _elementDisplayString(Element? element) {
return element?.getDisplayString(
withNullability: _unit.isNonNullableByDefault,
- multiline: multilineElementDescriptions,
+ multiline: true,
);
}
diff --git a/pkg/analysis_server/lib/src/lsp/handlers/handler_hover.dart b/pkg/analysis_server/lib/src/lsp/handlers/handler_hover.dart
index 3056895..c533db2 100644
--- a/pkg/analysis_server/lib/src/lsp/handlers/handler_hover.dart
+++ b/pkg/analysis_server/lib/src/lsp/handlers/handler_hover.dart
@@ -88,11 +88,7 @@
}
final computer = DartUnitHoverComputer(
- server.getDartdocDirectiveInfoFor(unit),
- compilationUnit,
- offset,
- multilineElementDescriptions: true,
- );
+ server.getDartdocDirectiveInfoFor(unit), compilationUnit, offset);
final hover = computer.compute();
return success(toHover(unit.lineInfo, hover));
}
diff --git a/pkg/analysis_server/test/analysis/get_hover_test.dart b/pkg/analysis_server/test/analysis/get_hover_test.dart
index ec55a85..cbc0c97 100644
--- a/pkg/analysis_server/test/analysis/get_hover_test.dart
+++ b/pkg/analysis_server/test/analysis/get_hover_test.dart
@@ -362,6 +362,22 @@
expect(hover.propagatedType, isNull);
}
+ Future<void> test_function_multilineElementDescription() async {
+ // Functions with at least 3 params will have element descriptions formatted
+ // across multiple lines.
+ addTestFile('''
+List<String> fff(int a, [String b = 'b', String c = 'c']) {
+}
+''');
+ var hover = await prepareHover('fff(int a');
+ expect(hover.elementDescription, '''
+List<String> fff(
+ int a, [
+ String b = 'b',
+ String c = 'c',
+])''');
+ }
+
Future<void> test_function_topLevel_declaration() async {
addTestFile('''
library my.library;
diff --git a/pkg/analysis_server/tool/spec/spec_input.html b/pkg/analysis_server/tool/spec/spec_input.html
index f86815d..9168b9b 100644
--- a/pkg/analysis_server/tool/spec/spec_input.html
+++ b/pkg/analysis_server/tool/spec/spec_input.html
@@ -7,7 +7,7 @@
<body>
<h1>Analysis Server API Specification</h1>
<h1 style="color:#999999">Version
- <version>1.32.5</version>
+ <version>1.32.7</version>
</h1>
<p>
This document contains a specification of the API provided by the
@@ -134,6 +134,13 @@
ignoring the item or treating it with some default/fallback handling.
</p>
<h3>Changelog</h3>
+<h4>1.32.7</h4>
+<ul>
+ <li><tt>HoverInformation.elementDescription</tt> may now include linebreaks to
+ improve formatting of functions and methods with many parameters. This is not
+ an API change but may be useful as a signal for clients that previously did their
+ own formatting.</li>
+</ul>
<h4>1.32.6</h4>
<ul>
<li>Added <tt>FoldingKind.PARAMETERS</tt> for folding regions for parameters
diff --git a/pkg/analysis_server_client/lib/src/protocol/protocol_constants.dart b/pkg/analysis_server_client/lib/src/protocol/protocol_constants.dart
index 6772e9d..c06dbe8 100644
--- a/pkg/analysis_server_client/lib/src/protocol/protocol_constants.dart
+++ b/pkg/analysis_server_client/lib/src/protocol/protocol_constants.dart
@@ -6,7 +6,7 @@
// To regenerate the file, use the script
// "pkg/analysis_server/tool/spec/generate_files".
-const String PROTOCOL_VERSION = '1.32.5';
+const String PROTOCOL_VERSION = '1.32.7';
const String ANALYSIS_NOTIFICATION_ANALYZED_FILES = 'analysis.analyzedFiles';
const String ANALYSIS_NOTIFICATION_ANALYZED_FILES_DIRECTORIES = 'directories';
diff --git a/tools/VERSION b/tools/VERSION
index 2c202f7..2476849 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 14
PATCH 0
-PRERELEASE 206
+PRERELEASE 207
PRERELEASE_PATCH 0
\ No newline at end of file