Skip to content
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

Link to dart.dev is missing //dart.dev/go/ #1920

Closed
kwalrath opened this issue Jun 15, 2021 · 3 comments · Fixed by dart-archive/dart-services#729
Closed

Link to dart.dev is missing //dart.dev/go/ #1920

kwalrath opened this issue Jun 15, 2021 · 3 comments · Fixed by dart-archive/dart-services#729
Assignees
Labels
area-dart-services P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Milestone

Comments

@kwalrath
Copy link

What happened?

The code has an intentional error, so I expected to see a link to http://dart.dev/go/non-promo-property. Instead, I see a link to http:non-promo-property. The error message displays correctly in WebStorm.

More details: dart-lang/site-www#3253 (comment)

Steps to reproduce problem

Go to https://dartpad.dev/d076253e8b4f7ae4d450a13a8aad96c5?null_safety=true.

@parlough
Copy link
Member

parlough commented Jun 15, 2021

As a reference, this is caused by replacement done by util.stripFilePaths called a few lines in this file: https://github.com/dart-lang/dart-services/blob/master/lib/src/analysis_server.dart

@RedBrogdon RedBrogdon added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) area-dart-services P2 A bug or feature request we're likely to work on labels Jun 17, 2021
@RedBrogdon RedBrogdon added this to the Backlog milestone Jun 17, 2021
@RedBrogdon
Copy link
Contributor

Confirming what @parlough just said, the JSON sent down from the server is missing the full URL syntax:

{
 "issues": [
  {
   "kind": "error",
   "line": 5,
   "message": "The property 'isEven' can't be unconditionally accessed because the receiver can be 'null'.",
   "sourceName": "main.dart",
   "hasFixes": false,
   "charStart": 96,
   "charLength": 6,
   "url": "https://dart.dev/tools/diagnostic-messages#unchecked_use_of_nullable_value",
   "diagnosticMessages": [
    {
     "message": "'i' refers to a property so it couldn't be promoted.  See http:non-promo-property",
     "line": 2,
     "charStart": 17,
     "charLength": 1
    }
   ],
   "correction": "Try making the access conditional (using '?.') or adding a null check to the target ('!')."
  }
 ]
}

@srawlins, I'm routing this your way since it's a backend issue.

@srawlins
Copy link
Member

I'll tidy up this utility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dart-services P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants