Skip to content

Commit d32011e

Browse files
committed
Fix formatting/analyzer
1 parent 43d6418 commit d32011e

File tree

2 files changed

+31
-32
lines changed

2 files changed

+31
-32
lines changed

pkgs/dart_mcp_server/lib/src/mixins/analyzer.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,7 @@ base mixin DartAnalyzerSupport
269269
for (final rootConfig in rootConfigs) {
270270
final rootUriString = rootConfig[ParameterNames.root] as String;
271271
final rootUri = Uri.parse(rootUriString);
272-
final paths =
273-
(rootConfig[ParameterNames.paths] as List?)?.cast<String>();
272+
final paths = (rootConfig[ParameterNames.paths] as List?)?.cast<String>();
274273

275274
if (paths != null && paths.isNotEmpty) {
276275
for (final path in paths) {

pkgs/dart_mcp_server/test/tools/analyzer_test.dart

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ void main() {
124124
ParameterNames.roots: [
125125
{
126126
ParameterNames.root: exampleRoot.uri,
127-
ParameterNames.paths: ['main.dart']
128-
}
129-
]
127+
ParameterNames.paths: ['main.dart'],
128+
},
129+
],
130130
},
131131
);
132132
final result = await testHarness.callToolWithRetry(request);
@@ -162,9 +162,9 @@ void main() {
162162
ParameterNames.roots: [
163163
{
164164
ParameterNames.root: exampleRoot.uri,
165-
ParameterNames.paths: ['sub']
166-
}
167-
]
165+
ParameterNames.paths: ['sub'],
166+
},
167+
],
168168
},
169169
);
170170
final result = await testHarness.callToolWithRetry(request);
@@ -197,8 +197,8 @@ void main() {
197197
{
198198
ParameterNames.root: exampleRoot.uri,
199199
ParameterNames.paths: ['not_a_real_file.dart'],
200-
}
201-
]
200+
},
201+
],
202202
},
203203
);
204204
final result = await testHarness.callToolWithRetry(request);
@@ -225,9 +225,9 @@ void main() {
225225
ParameterNames.roots: [
226226
{
227227
ParameterNames.root: exampleRoot.uri,
228-
ParameterNames.paths: [], // Empty paths
229-
}
230-
]
228+
ParameterNames.paths: <String>[], // Empty paths
229+
},
230+
],
231231
},
232232
);
233233
final result = await testHarness.callToolWithRetry(request);
@@ -259,9 +259,7 @@ void main() {
259259

260260
final request = CallToolRequest(
261261
name: analyzeTool.name,
262-
arguments: {
263-
ParameterNames.roots: [],
264-
},
262+
arguments: {ParameterNames.roots: []},
265263
);
266264
final result = await testHarness.callToolWithRetry(request);
267265
expect(result.isError, isNot(true));
@@ -299,29 +297,31 @@ void main() {
299297
{
300298
ParameterNames.root: projectBRoot.uri,
301299
ParameterNames.paths: ['other.dart'],
302-
}
303-
]
300+
},
301+
],
304302
},
305303
);
306304
final result = await testHarness.callToolWithRetry(request);
307305
expect(result.isError, isNot(true));
308306
expect(result.content, hasLength(2));
309307
expect(
310-
result.content,
311-
containsAll([
312-
isA<TextContent>().having(
313-
(t) => t.text,
314-
'text',
315-
contains(
316-
"The argument type 'String' can't be assigned to the "
317-
"parameter type 'num'."),
318-
),
319-
isA<TextContent>().having(
320-
(t) => t.text,
321-
'text',
322-
contains("Undefined name 'foo'"),
308+
result.content,
309+
containsAll([
310+
isA<TextContent>().having(
311+
(t) => t.text,
312+
'text',
313+
contains(
314+
"The argument type 'String' can't be assigned to the "
315+
"parameter type 'num'.",
323316
),
324-
]));
317+
),
318+
isA<TextContent>().having(
319+
(t) => t.text,
320+
'text',
321+
contains("Undefined name 'foo'"),
322+
),
323+
]),
324+
);
325325
});
326326

327327
test('can look up symbols in a workspace', () async {

0 commit comments

Comments
 (0)