Closed lcdsmao closed 2 years ago
Which version of dart are you using?
Hi @Kavantix Versions I am using are: coc-flutter: 1.9.6 flutter: 2.5.3
Can you share the flutter.lsp log when this happens
@Kavantix Here is the log:
Reproduce this with a sample project contains these files:
lib/main
import 'package:flutter/material.dart';
void main() { runApp(MyApp()); }
class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( primarySwatch: Colors.blue, ), home: MyHomePage(), ); } }
class MyHomePage extends StatefulWidget { @override _MyHomePageState createState() => _MyHomePageState(); }
class _MyHomePageState extends State
@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(), body: Container(), ); } }
- `test/widget_test.dart`
```dart
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:playground/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// Build our app and trigger a frame.
await tester.pumpWidget(MyApp());
// Verify that our counter starts at 0.
expect(find.text('0'), findsOneWidget);
expect(find.text('1'), findsNothing);
// Tap the '+' icon and trigger a frame.
await tester.tap(find.byIcon(Icons.add));
await tester.pump();
// Verify that our counter has incremented.
expect(find.text('0'), findsNothing);
expect(find.text('1'), findsOneWidget);
});
}
From the log it seems to go wrong on the dart side. Have you tried if it does work in vscode?
Yes, it works in vscode. I have tried to capture some logs:
Looking at the log, is the editor closing/renaming the file before the willRenameFiles
request completes? The rename operation should be blocked until it completes, as willRenameFiles
is intended for servers that need to compute edits before the rename occurs (didRenameFiles
is the equivalent notification where the server does not need to compute editors prior to the rename).
The will rename files request is sent from the client to the server before files are actually renamed as long as the rename is triggered from within the client either by a user action or by applying a workspace edit. The request can return a WorkspaceEdit which will be applied to workspace before the files are renamed.
Hmm that sounds like a bug in coc then, right @iamcco?
@lcdsmao for me this feature now seems to work perfectly with the latest coc.nvim and latest dart 2.15 So I'm gonna close this, if you still experience this let me know and I'll reopen
@Kavantix Thanks! I will try again when our project is updated to flutter 2.8.
Describe the bug Rename file error. Only the file itself got the new name, but any reference doesn't get an update.
To Reproduce
:CocCommand workspace.renameCurrentFile
Expected behavior
The file itself gets renamed and all references get the update.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Output channel:
"flutter.trace.server": "verbose"
:CocRestart
:CocCommand workspace.showOutput
open output list and selectflutter
Paste Log from above:
Config If you have any config for this specific extenstion in you
coc-settings
please include them here.