Skip to content

Quick fix for ignoring lint rule is broken for external getters with existing DartDoc #4775

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
navaronbracke opened this issue Oct 5, 2023 · 2 comments
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is bug relies on sdk changes Something that requires changes in the Dart/Flutter SDK to ship before it will become available
Milestone

Comments

@navaronbracke
Copy link

navaronbracke commented Oct 5, 2023

Not sure if these quick fixes are provided by the analyzer, feel free to move this issue if that is the case

Describe the bug
When using the ignore quickfix, the ignore is put in the wrong place if there is DartDoc for an external getter

To Reproduce
Steps to reproduce the behavior:

  1. Given the code sample:
class Foo {  
  /// The uuid of the user.
  external String get UID;
}
  1. Select the quick fix Ignore constant_identifier_names for this line

Expected behavior

class Foo {
  /// The uuid of the user.
  external String get UID; // ignore: non_constant_identifier_names
}

or

class Foo {
  /// The uuid of the user.
  // ignore: non_constant_identifier_names
  external String get UID;
}

Actual behavior

class Foo {
  // ignore: non_constant_identifier_names
  /// The uuid of the user.
  external String get UID;
}

Due to the ignore line not being directly before the code, it is not picked up and the lint is not ignored.

Workspace Environment
Dart Code extension: 3.74.0
Flutter extension: 3.74.0 (not activated)

App: Visual Studio Code
App Host: desktop
Version: mac 1.82.3

Workspace type: Dart (LSP)

Dart (3.2.0-198.0.dev): /Users/navaronbracke/Documents/flutter/bin/cache/dart-sdk
Flutter (3.15.0-9.0.pre.4): /Users/navaronbracke/Documents/flutter

Output from 'dart info'

/Users/navaronbracke/Documents/flutter/bin/cache/dart-sdk/bin/dart info

If providing this information as part of reporting a bug, please review the information
below to ensure it only contains things you're comfortable posting publicly.

General info

  • Dart 3.2.0-198.0.dev (dev) (Mon Sep 25 13:02:54 2023 -0700) on "macos_x64"
  • on macos / Version 13.5.2 (Build 22G91)
  • locale is en-BE

Project info

  • sdk constraint: '^3.2.0-198.0.dev'
  • dependencies:
  • dev_dependencies: lints, test

Process info

Memory CPU Elapsed time Command line
3 MB 0.0% 08:01:51 dart devtools --machine --try-ports 10 --allow-embedding
778 MB 33.5% 01-03:23:02 dart language-server --protocol=lsp --client-id=VS-Code --client-version=3.74.0
754 MB 53.0% 01-00:25:01 dart language-server --protocol=lsp --client-id=VS-Code --client-version=3.74.0
509 MB 98.7% 05:55 dart language-server --protocol=lsp --client-id=VS-Code --client-version=3.74.0
72 MB 0.0% 02:34 dart language-server --protocol=lsp --client-id=VS-Code --client-version=3.74.0
Output from 'flutter doctor'

/Users/navaronbracke/Documents/flutter/bin/flutter doctor -v

[✓] Flutter (Channel master, 3.15.0-9.0.pre.4, on macOS 13.5.2 22G91 darwin-x64, locale en-BE)
    • Flutter version 3.15.0-9.0.pre.4 on channel master at /Users/navaronbracke/Documents/flutter
    • Upstream repository git@github.com:navaronbracke/flutter.git
    • FLUTTER_GIT_URL = git@github.com:navaronbracke/flutter.git
    • Framework revision f6f18d0688 (10 days ago), 2023-09-25 23:09:32 -0400
    • Engine revision 75950dc280
    • Dart version 3.2.0 (build 3.2.0-198.0.dev)
    • DevTools version 2.28.0-dev.12

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/navaronbracke/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/navaronbracke/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A240d
    • CocoaPods version 1.13.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.82.3)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.74.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • macOS 13.5.2 22G91 darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 117.0.5938.149

[✓] Network resources
    • All expected network resources are available.

• No issues found!
@DanTup DanTup added this to the v3.76.0 milestone Oct 9, 2023
@DanTup DanTup added in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server relies on sdk changes Something that requires changes in the Dart/Flutter SDK to ship before it will become available labels Oct 9, 2023
@DanTup
Copy link
Member

DanTup commented Oct 9, 2023

It is in the analysis server, though I've started a change at https://dart-review.googlesource.com/c/sdk/+/329740

copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Oct 9, 2023
…tdocs

Fixes Dart-Code/Dart-Code#4775

Change-Id: I7fd049f2f58ed677c5c4a8e5ab7450e54ae61c9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329740
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
@DanTup
Copy link
Member

DanTup commented Oct 10, 2023

Fixed by dart-lang/sdk@260b9b1. The change is in the analysis server so the fix will show up in a future SDK release (not a VS Code extension release).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is bug relies on sdk changes Something that requires changes in the Dart/Flutter SDK to ship before it will become available
Projects
None yet
Development

No branches or pull requests

2 participants