Skip to content

Improve error reporting: Use before definition within files and across whole project #12341

@dsyme

Description

@dsyme

We should give good and clear diagnostics on "use before definition" both within a single file and across the whole project.

The F# compiler parses all files in the project before checking anything. The compiler service can also be adjusted to parse all files

Given that, it's easy to extract all potential top-level symbols across all files (and the language service has some of those)

If an undefined symbol appears in this set, we can thus give much better diagnsotics, explaining to the user that they need to define functions before they use them.

This is perhaps the most important diagnostic we need to implement, as research by @cartermp showed that this problem was the most common confusion and rejection point for those learning F#.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature ImprovementTheme-Simple-F#A cross-community initiative called "Simple F#", keeping people in the sweet spot of the language.

    Type

    No type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions