Skip to content

Catch block parameters are not highlighted #4320

@navaronbracke

Description

@navaronbracke

Describe the bug
Syntax highlighting for the catch block parameters is broken.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new file, i.e. catch.dart and paste in the code sample
try {
 // do something
} catch (error, stackTrace) {
 // handle error
}
  1. Open the file in VSCode
  2. The error and stackTrace arguments are not highlighted, so they look the same as a dynamic foo = 42; variable would look.
  3. Type inference does not work either when hovering over either error or stackTrace, even though we know that error is an Object and stackTrace is a StackTrace

Expected behavior
I expect that the error and stackTrace arguments get highlighted in blue. When hovering over either error or stackTrace, the tooltip should display the proper type.

Screenshots
Screenshot 2022-12-23 at 19 47 30

Please complete the following information:

  • Operating System and version: macOS 12.2.1 21D62 darwin-x64
  • VS Code version: 1.74.1
  • Dart extension version: v3.56.0
  • Dart/Flutter SDK version: Dart 2.19.0-444.1.beta | Flutter 3.7.0-1.1.pre (beta)
  • Target device (if the issue relates to Flutter debugging): N/A

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