Help us make content visible
nowarn and warnaserrorDescribe the new article
Checklist of all F# errors as 23 December 2019
Note that for now I'm not suggesting that any of these pages be generated from the FsComp.txt page in any way. I think it's more valuable to spend that time creating the initial versions of the page, because additions to that file are usually done in a very controlled fashion and could be easily tracked via the Issues list on this repo.
I would also be very, very interested in writing those pages, I just lack the knowledge around getting entire new topics configured correctly for this repository.
@cartermp please take a look at this suggestion for the F# docs
@baronfel this makes sense and I think the structure is right. Adding docs is very very easy:
language-reference/compiler-messages)?index.md file to represent a root documentfsharp/toc.yml file to show it in the right-hand side of the docsThen that's it! The system will give it a url that matches the folder/file structure and it's all just normal markdown + git-based workflow.
Thanks for the pointers! I'm about to go on vacation for a bit, but I'd like to do a bit of hobby-poking around on this when I get back, and those will help immensely.
I've added a list of all known compiler errors to this issue. I've also put out a call for volunteers to flesh out some of the many compiler errors. Might I suggest treating this issue more as a tracking issue, merging the initial MRs I created with a few examples, and then letting others open issues checking off one or more of the remaining issues over time?
Just today I wanted to lookup 0052, 3239, and 0025 and did not succeed.
Yep! Only a few have been done (they can be time-intensive to author), but now that the first few are in and there's a pattern, it's relatively easy to add new ones. If you (or anyone else!) are at all interested in helping out I'd be more than happy to walk through the process with you.
I just noticed this is live! https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/compiler-messages/fs0001
Say I wanted to contribute 0025. Where would I go to find out what that is?
I guess this search yielded pretty good results: https://github.com/dotnet/fsharp/search?q=FS0025
The error numbers themselves are going to come from one of two major places:
Once you've got the number, you've also got the name for the member to look for. For example, number 25 is here, and the associated error is PatternMatchCompilation.MatchIncomplete (which is defined here). Generally speaking, once I know what kind of error is raised for what kind of compilation error, I search through the codebase for how it is raised in the compiler and what test cases might be used to demonstrate it. Armed with this information, I'd clone down this repository and go to the docs/fsharp/language-reference/compiler-messages directory, then execute the util/new-message script to scaffold out the required metadata for a new compiler message entry like so: util/new-message 0025 "Reasonable Title For This Error Case". I'll leave a reasonable title to you, but this one for example might be something like Pattern Match clauses are incomplete.
With this done, the new markdown file for your error message will have been scaffolded out and added to the table of contents, so all that's left for you to do is actually fill out some help message content for your chosen error message. The others there should be an acceptable pattern base yours off of (as they've passed review here already in terms of formatting and grammar), but the team here is very helpful about any changes that might need to be made with regards to those areas.
When it comes to code snippets, those go in a matching folder in this repository: samples/snippets/fsharp/compiler-messages and should be referenced via the syntax in the existing documentation:
[!code-fsharp[FS0008-error](~/samples/snippets/fsharp/compiler-messages/fs0008.fs#L2-L5)]
meaning "render lines 2-5 of ~/samples/snippets/fsharp/compiler-messages/fs0008.fs as F# code, with the heading name of FS0008-error".
Hope this helps!
I took a crack at it in #21424
For history, I wrote a blog post based on this https://brett-rowberry.medium.com/f-compiler-messages-24da6589d796.
Hopefully, after #22159 all the instructions needed to contribute will be contained in https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/compiler-messages/ and in this repository itself.