Skip to content

Catch block parameters are not highlighted #4320

Closed

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

Activity

  1. added this to the v3.58.0 milestone on Jan 4, 2023
  2. added
    in editorRelates to code editing or language features
    in lsp/analysis serverSomething to be fixed in the Dart analysis server
    relies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available
    on Jan 4, 2023
  3. DanTup commented on Jan 4, 2023

    @DanTup
    Member

    Fixed by dart-lang/sdk@792aede. This change is in the Dart analysis server so will ship with a future Dart/Flutter SDK release rather than show up in the VS Code extension release.

  4. modified the milestones: v3.58.0, v3.60.0 on Jan 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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