Repository: Dart-Code/Dart-Code

Issue #4184: Create missing override(s) quickfix not showing for empty classes.
Created: 2022-09-27T13:54:30Z
Describe the bug
When creating an empty class that extends another one, the "Create n missing override(s)" quickfix is not appearing. In fact vscode says there are no quickfixes available at all. Once I write a single character inside the class, quickfixes start showing up.
This does not happen when using implements.
I'm not sure whether this is an extension or a language server issue. Feel free to close this and refer me to the correct repo.
To Reproduce
Steps to reproduce the behavior:

Create an empty class that extends another class that has abstract methods.
Press cmd+. anywhere in the class name.

Expected behavior
It should display the appropriate quickfixes.
Screenshots




Please complete the following information:

Operating System and version: macOS 12.6
VS Code version: 1.71.2
Dart extension version: v3.49.20220926
Dart/Flutter SDK version: dart 2.18.1, Flutter 3.3.2 stable

These are the the logs of pressing cmd+. on the empty class' name, captured with Dart: Capture Analysis Server Logs.

Details
!! PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING !!
Dart Code extension: 3.49.20220926
Flutter extension: 3.48.0 (activated)
App: Visual Studio Code
Version: 1.71.2
Platform: mac
Workspace type: Flutter
Analyzer type: LSP
Multi-root?: true
Dart SDK:
Loc: LOCATION
Ver: 2.18.1
Flutter SDK:
Loc: LOCATION
Ver: 3.3.2
HTTP_PROXY: undefined
NO_PROXY: undefined
Logging Categories:
General, Analyzer, CommandProcesses
Tue Sep 27 2022 [10:19:46 GMT-0300 (Argentina Standard Time)] Log file started
[10:19:57 AM] [Analyzer] [Info] ==> Content-Length: 742
[10:19:57 AM] [Analyzer] [Info] ==> {"jsonrpc":"2.0","id":49,"method":"textDocument/codeAction","params":{"textDocument":{"uri":"FILE_URI"},"range":{"start":{"line":2,"character":8},"end":{"line":2,"character":8}},"context":{"diagnostics":[{"range":{"start":{"line":2,"character":6},"end":{"line":2,"character":9}},"message":"Missing concrete implementations of 'CustomPainter.paint' and 'CustomPainter.shouldRepaint'.\nTry implementing the missing methods, or make the class abstract.","code":"non_abstract_class_inherits_abstract_member","codeDescription":{"href":"file:///diagnostics/non_abstract_class_inherits_abstract_member"},"severity":1,"source":"dart"}],"triggerKind":1}},"clientRequestTime":1664284797019}
[10:19:57 AM] [Analyzer] [Info] <== Content-Length: 126
Content-Type: application/vscode-jsonrpc; charset=utf-8
[10:19:57 AM] [Analyzer] [Info] <== {"id":49,"jsonrpc":"2.0","error":{"code":-32001,"message":"An error occurred while handling textDocument/codeAction request"}}
[10:19:57 AM] [Analyzer] [Info] <== Content-Length: 2800
Content-Type: application/vscode-jsonrpc; charset=utf-8
{"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"An error occurred while handling textDocument/codeAction request: RangeError (end): Invalid value: Not in inclusive range 27..232: 26\n#0      RangeError.checkValidRange (dart:core/errors.dart:363:9)\n#1      _StringBase.substring (dart:core-patch/string_patch.dart:400:27)\n#2      SnippetBuilderExtensions.appendPlaceholders (package:analysis_server/src/lsp/snippets.dart:332:23)\n#3      _buildSnippetString (package:analysis_server/src/lsp/snippets.dart:135:7)\n#4      buildSnippetStringForEditGroups (package:analysis_server/src/lsp/snippets.dart:26:5)\n#5      snippetTextEditFromEditGroups (package:analysis_server/src/lsp/mapping.dart:928:14)\n#6      toSnippetTextEdits (package:analysis_server/src/lsp/mapping.dart:1508:22)\n#7      createWorkspaceEdit (package:analysis_server/src/lsp/mapping.dart:150:24)\n#8      CodeActionHandler._createFixAction (package:analysis_server/src/lsp/handlers/handler_code_actions.dart:226:13)\n#9      CodeActionHandler._getFixActions. (package:analysis_server/src/lsp/handlers/handler_code_actions.dart:423:30)\n#10     MappedListIterable.elementAt (dart:_internal/iterable.dart:413:31)\n#11     ListIterator.moveNext (dart:_internal/iterable.dart:342:26)\n#12     List.addAll (dart:core-patch/growable_array.dart:319:13)\n#13     CodeActionHandler._getFixActions (package:analysis_server/src/lsp/handlers/handler_code_actions.dart:421:23)\n\n#14     OperationPerformanceImpl.runAsync (package:analyzer/src/util/performance/operation_performance.dart:164:18)\n\n#15     Future.wait. (dart:async/future.dart:522:21)\n\n#16     CodeActionHandler._getCodeActions (package:analysis_server/src/lsp/handlers/handler_code_actions.dart:350:21)\n\n#17     OperationPerforma…
Tue Sep 27 2022 [10:20:02 GMT-0300 (Argentina Standard Time)] Log file ended

Duplicate issue #4236: vscode: "create missing override" is inexplicably missing for "CustomPainter" extends
Created: 2022-10-26T16:01:18Z
Environment:
Vscode: 1.72.2
System:  Linux Mint 20.3 Una base: Ubuntu 20.04 focal
Flutter 3.3.4 • channel stable • https://github.com/flutter/flutter.git
Framework • revision eb6d86ee27 (il y a 3 semaines) • 2022-10-04 22:31:45 -0700
Engine • revision c08d7d5efc
Tools • Dart 2.18.2 • DevTools 2.15.0

Closing comment (2022-10-31T11:19:10Z): This looks like a dupe of #4184. There was a bug that would cause invalid edits to be produced for Create Missing Overrides in some cases, and that would result in an error that caused the actions not to be included in the response.
This was fixed by dart-lang/sdk@d97c3e8 and should be included in a future Dart/Flutter SDK release. If you'd like to test this, I would expect it to work correctly on the beta branch already.