Dart-Code: "Create missing overrides" generates invalid code on Windows

I was creating a CustomShapeBorder by extending the ShapeBorder class, then when I used quickfix to create the 5 @overrides using the quickfix from VSCode. 3 of 5 overrides the getInnerPath, getOuterPath and paint had syntax errors in their parameters.

ezgif com-video-to-gif

the code is as follows with the errors:

class CustomCardShapeBorder extends ShapeBorder{
  @override
  // TODO: implement dimensions
  EdgeInsetsGeometry get dimensions => throw UnimplementedError();

  @override
 // error: parameter with ${3|
  Path getInnerPath(Rect rect${3|, {TextDirect,TextDirection,Object|}ion textDirection}) {
      // TODO: implement getInnerPath
      throw UnimplementedError();
    }
  
    @override
// error: parameter with closing }  in the end of text direction
    Path getOuterPath(Rect rectrection textDirection}) {
      // TODO: implement getOuterPath
      throw UnimplementedError();
    }
  
    @override
// error: parameter with speling errors and closing }  in the end of text direction
    void paint(Canvas canvas, Rect rectxtDirection textDirection}) {
      // TODO: implement paint
    }
  
    @override
    ShapeBorder scale(double t) {
    // TODO: implement scale
    throw UnimplementedError();
  }
 
}

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (7 by maintainers)

Commits related to this issue

Most upvoted comments

Working around this for non-LSP in the VS Code extension is but I’ve landed some fixes in the server that will prevent generating the problematic edits:

https://github.com/dart-lang/sdk/commit/f820c1fb8e4ed8df1d65d238abe332bc2c3c1577

So the issue is resolved either by:

  • Switching to LSP
  • Updating to a new SDK once that fix ships

Long-term the buggy code here will be removed, once LS becomes the only option.