Skip to content

Create missing override(s) quickfix not showing for empty classes. #4184

@pitriq

Description

@pitriq

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:

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

Expected behavior

It should display the appropriate quickfixes.

Screenshots

image
image
image
image

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresin lsp/analysis serverSomething to be fixed in the Dart analysis serveris bugrelies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions