Skip to content

Add LangVersionText to FSharpProjectSnapshot - #20874

Draft
DedSec256 wants to merge 3 commits into
dotnet:mainfrom
DedSec256:ber.a/LangVersionText
Draft

DedSec256 wants to merge 3 commits into
dotnet:mainfrom
DedSec256:ber.a/LangVersionText

Conversation

@DedSec256

Copy link
Copy Markdown
Contributor

Adds LangVersionText: string to FSharpProjectSnapshot and ProjectConfig. For the same options it returns what FSharpParsingOptions.LangVersionText does.

Depends on #: it uses CompilerOptions.ParseCompilerOption from there.

Changes

  • ProjectConfig.LangVersionText is computed lazily from OtherOptions. It is the last --langversion the compiler accepts, otherwise default. An unrecognized or out-of-support version is skipped, the same way TcConfigBuilder keeps its previous version when it reports the error. It is exposed through ProjectSnapshotBase and FSharpProjectSnapshot.
  • setLanguageVersion is replaced by CompilerOptions.ParseLanguageVersion: string -> Result<LanguageVersion, exn>. The --langversion handler reports the returned error, and the snapshot skips it, so the validation exists in one place. The compiler's behavior is unchanged.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Release notes checked


✅ Found changes and release notes in following paths:

Warning

No PR link found in some release notes, please consider adding it.

Change path Release notes path Description
`src/Compiler` docs/release-notes/.FSharp.Compiler.Service/11.0.200.md No current pull request URL (#20874) found, please consider adding it

This branch has not been deployed

No deployments
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.

1 participant