Skip to content

Hovering over constructor's parameters shows an oversized font for the type #4120

Closed

Description

@osaxma

Describe the bug

Hovering over constructor parameters (named or unnamed) shows an oversized font for the type. The same oversized appears when hovering over the name of an argument of a constructor with named parameters as seen below:

Screen Shot 2022-08-25 at 11 42 49 AM

It gets a bit wild when the type is multiple typedefs (e.g. shelf's Middleware type)

Screen Shot 2022-08-25 at 11 47 11 AM

Expected behavior
I would expect the same font size as when hovering over the member definition (this is a wide screenshot so it looks smaller)

Screen Shot 2022-08-25 at 11 45 24 AM

Please complete the following information:

  • VS Code version: Version: 1.70.1
  • Dart extension version: v3.46.1
  • Dart/Flutter SDK version: Dart SDK version: 2.17.6 (stable) (Tue Jul 12 12:54:37 2022 +0200) on "macos_x64"

Activity

  1. changed the title [-]Hovering over parameters shows an oversized font for the type[/-] [+]Hovering over constructor's parameters shows an oversized font for the type[/+] on Aug 25, 2022
  2. DanTup commented on Aug 25, 2022

    @DanTup
    Member

    Thanks, I can repro.

    class A {
      /// aaa
      final String aaa; // hover over aaa
    
      A({required this.aaa}); // hover over aaa
    }

    There's no obvious difference in the response from the server:

    {"id":653,"jsonrpc":"2.0","result":{"contents":{"kind":"markdown","value":"```dart\nString aaa\n```\nType: `String`\n*package:dartcode_flutter_4118/main.dart*\n\n---\naaa"},"range":{"end":{"character":18,"line":4},"start":{"character":15,"line":4}}}}
    {"id":654,"jsonrpc":"2.0","result":{"contents":{"kind":"markdown","value":"```dart\n{required String aaa}\n```\nType: `String`\n---\naaa"},"range":{"end":{"character":22,"line":6},"start":{"character":19,"line":6}}}}
    

    There's a missing newline before the package in the first one though:

    Screenshot 2022-08-25 at 10 48 55

    I think either LSP client or VS Code are supposed to convert --- to a full with line, but I can't see that on the second one, so perhaps that's related (microsoft/vscode#65094?).

  3. DanTup commented on Aug 25, 2022

    @DanTup
    Member

    So I think there are two issues here:

    1. We need two newlines before --- for it to be rendered as a horizontal line. Otherwise it's being interpreted to mean the line before is a header. This needs fixing in the server.
    2. The missing newline before package: in the rendering may be a VS Code issue - it's rendering differently to I would expect (or GitHub does) so I've filed Newline missing in markdown rendering microsoft/vscode#159161.

    Edit: This was just one issue, which was a missing \n after Type: because a single newline in Markdown is essentially ignored and the two lines still treated as a single paragraph.

  4. added this to the v3.50.0 milestone on Aug 25, 2022
  5. added
    in editorRelates to code editing or language features
    in lsp/analysis serverSomething to be fixed in the Dart analysis server
    on Aug 25, 2022
  6. DanTup commented on Sep 5, 2022

    @DanTup
    Member
  7. DanTup commented on Sep 6, 2022

    @DanTup
    Member

    Fixed by dart-lang/sdk@8bf496e. It's an SDK change, so will show up in a future SDK release.

  8. added
    relies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available
    on Sep 6, 2022
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