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

Improve error reporting: add an url with more info for each warning/error #1136

Open
Tracked by #1103
enricosada opened this issue Apr 29, 2016 · 8 comments
Open
Tracked by #1103
Labels
Feature Improvement Theme-Simple-F# A cross-community initiative called "Simple F#", keeping people in the sweet spot of the language.
Milestone

Comments

@enricosada
Copy link
Contributor

enricosada commented Apr 29, 2016

I think it's possible to add, unobtrusively, a short link to more info for each warning/error message

like

error FS0001: The type 'int' does not match the type 'int -> int' ( http://fsc.fsharp.org/FS0001 )

Write a good context sensitive info help fix the error, but a good link help to study in deep the issue because can contain code examples, more urls, long description, etc and that's the second choice if the error message is not enough (for example new users)

That's should be good also for tooltips, because urls can be converted to links easily in every ide, or automatically in lot of editors.

Also is going to be really nice for search too, because for example googling for fsc error FS0001 give some info (and the 5th link is the amazing fsharpforfunandprofit tutorial) but is mixed with other errors

ref #1103

@smoothdeveloper
Copy link
Contributor

@enricosada it seems the tooling could make up the link actually, not sure if putting it right in the error message is the best approach.

But I really like the idea to have a canonical page for each compiler error.

@isaacabraham
Copy link
Contributor

I actually had a similar thought. Perhaps this is something that could be exposed as metadata by FSC rather than directly within the error message though?

@enricosada
Copy link
Contributor Author

enricosada commented May 4, 2016

I'd like to improve discoverability.

For sure as metadata can help a lot ide

To improve text output message of compiler, maybe a single note at beginning/end is enough

More info at http://fsc.fsharp.org/FS{error}

@smoothdeveloper
Copy link
Contributor

We should list the links once at the very end (in case same error number is repeated several times).

We need to setup good platform for the contents, the pages should point to msdn description (msdn documentation for F# compilers is pretty good) for each message and have a great "code oriented" summary describing the problem with all bells and whistles from FSharp.Formatting project.

@isaacabraham
Copy link
Contributor

Is there a way to progress this? @cartermp would it be possible / acceptable to set up something on F# MSDN which contains a list of all F# compiler error messages along with examples of each. Then, we can look to bake that into Code + VS so that every compiler error has either a URL link to the error, or even better a little pop-up with the details?

As long as all the pages follow a standard format, someone can write code to parse the content and display within an IDE.

@smoothdeveloper
Copy link
Contributor

@isaacabraham I think it would be a relevant content to host on fsharp.org: https://compiler.fsharp.org/messages/fs0001

@cartermp cartermp added this to the Unknown milestone Aug 25, 2018
@dsyme dsyme added the Theme-Simple-F# A cross-community initiative called "Simple F#", keeping people in the sweet spot of the language. label Sep 16, 2021
@KathleenDollard
Copy link

I love this, but I wonder if with the current state of IDEs it would be better to include this information as part of a structured diagnostic, rather than append URL text to the end of the text message. @baronfel ?

@baronfel
Copy link
Member

We actually do this to some extent already in Ionide, based on the pages that have been submitted to the MS docs: https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/compiler-messages/fs0001

All diagnostics with an error code get this clickable link, which led to dotnet/docs#25769 beccause the vast majority of diagnostics don't have a page made for them. There's a parallel mechanism using the Visual Studio help search mechanism called out in that thread that could be useful, and if either of those two mechanisms was 'regularized' enough, the FCS APIs around diagnostics could start emitting those urls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Improvement Theme-Simple-F# A cross-community initiative called "Simple F#", keeping people in the sweet spot of the language.
Projects
Archived in project
Development

No branches or pull requests

9 participants