Skip to content

Conversation

@DedSec256
Copy link
Contributor

@DedSec256 DedSec256 commented Dec 11, 2025

This API allows the IDE to differentiate compiler errors from warnings. Useful, for example, for suggesting actions like adding a #nowarn directive.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 11, 2025

❗ Release notes required


✅ Found changes and release notes in following paths:

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/10.0.200.md

Copy link
Contributor

@Martin521 Martin521 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes a lot of sense.
The whole diagnostics logging area is so over-complicated. I welcome every step to simplify it.

Copy link
Member

@auduchinok auduchinok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great!

@DedSec256 DedSec256 marked this pull request as ready for review December 15, 2025 16:54
@DedSec256 DedSec256 requested a review from a team as a code owner December 15, 2025 16:54
| FSharpDiagnosticSeverity.Hidden -> []
| adjustedSeverity ->

let diagnostic = { diagnostic with Severity = adjustedSeverity }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DedSec256 :

Without reading the implementation, I had problems imagining what default meant in the context of F.C.S public API.

Did you consider other names?
OriginalSeverity or UnadjustedSeverity perhaps?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the current naming makes sense. Maybe an XmlDoc would be sufficient? We could then leave the current name. If not, I'd vote for OriginalSeverity.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PhasedDiagnostic is not part of the public API, so I would keep it here as is.
See my comment below for the public API.

| FSharpDiagnosticSeverity.Hidden -> []
| adjustedSeverity ->

let diagnostic = { diagnostic with Severity = adjustedSeverity }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PhasedDiagnostic is not part of the public API, so I would keep it here as is.
See my comment below for the public API.

member Severity: FSharpDiagnosticSeverity

/// Gets the default severity, does not take into account diagnostics options
member DefaultSeverity: FSharpDiagnosticSeverity
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the original severity should be publicly accessible. It is an implementation detail. The adjusted severity is the specified output of the compiler (after applying the different flags and directives) and should be the only visible one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

4 participants