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

FCS namespace revamp #10971

Merged
merged 27 commits into from
Feb 4, 2021
Merged

FCS namespace revamp #10971

merged 27 commits into from
Feb 4, 2021

Conversation

dsyme
Copy link
Contributor

@dsyme dsyme commented Jan 29, 2021

This a revamp of the namespace and naming of FCS following on from a design review with @TIHan @jonsequitur @cartermp @KevinRansom

Namespaces are:

FSharp.Compiler.IO  // FileSystem
FSharp.Compiler.CodeAnalysis // FSharpChecker, FSharpCheckFileResults, FSharpChecProjectResults and friends
FSharp.Compiler.Diagnostics     // FSharpDiagnostic and friends
FSharp.Compiler.EditorServices // Misc functionality for editors, e.g. interface stub generation
FSharp.Compiler.Interactive.Shell // F# Interactive
FSharp.Compiler.Symbols           // FSharpEntity etc
FSharp.Compiler.Syntax           // Types and functionality for syntax tree
FSharp.Compiler.Text           // ISourceFile, Range, TaggedText and other things
FSharp.Compiler.Tokenization      // FSharpLineTokenizer etc.

Changes are documented in release-notes.md

Other internal cleanup changes:

  • dead code removed in vsintegration/src/FSharp.LanguageService/ProjectSitesAndFiles.fs

TODO in later PRs:

  • Switch to ImmutableArray instead of IList through the Symbols API

  • Add an immutable, extensible, binary-compati-maintainable API to give binary-compatible access to the syntax tree

release-notes.md Outdated
@@ -50,16 +50,16 @@ This is a big update to FCS. There are significant trimmings and renamings of th
Renamings:

```diff
-type FSharp.Compiler.AbstractIL.Internal.Library.IFileSystem
+type FSharp.Compiler.SourceCodeServices.IFileSystem
-type FSharp.Compiler.AbstractIL.Library.IFileSystem
Copy link
Contributor

Choose a reason for hiding this comment

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

This is only correct if we plan on getting this in for FCS 39, which to my knowledge isn't the case? At least not that I'm aware of

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't mind - just let me know the schedule.

(TBH I'm ok with delaying 39 until this is in, even if it's not 100% complete it's still better to get the foundational renames into the ecosystem. But I don't know if there are people desperate to get 39 or not)

Copy link
Contributor

Choose a reason for hiding this comment

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

We need to, at a minimum, release FCS 39 with VS 16.9. VS 16.9 bits are locked down for bug fixes only. So I highly doubt we'd incorporate this right now since it's helpful from a coherency standpoint - until we have a shipping cadence for FCS properly established - to have bits map to one another cleanly.

Copy link
Contributor

Choose a reason for hiding this comment

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

FCS 39 would come with a bunch of bug fixes and improvements already, so folks definitely would want it

Copy link
Member

Choose a reason for hiding this comment

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

Yep, eagerly anticipating a drop of 39 (since the nightlies aren't usable for packaging reasons :) ).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK great thank you. So I think that means we can integrate this to master and not into 16.9 release branch? I'll make sure the release notes are separate under 40.0

@dsyme
Copy link
Contributor Author

dsyme commented Jan 29, 2021

Aside: It did occur to me that perhaps the naming should be as follows to match the DLL, though I don't really mind

FSharp.Compiler.Service.IO  // FileSystem
FSharp.Compiler.Service.CodeAnalysis // FSharpChecker, FSharpCheckFileResults, FSharpChecProjectResults and friends
FSharp.Compiler.Service.Diagnostics     // FSharpDiagnostic and friends
FSharp.Compiler.Service.EditorServices // Misc functionality for editors, e.g. interface stub generation
FSharp.Compiler.Service.Syntax           // Types and functionality for syntax tree
FSharp.Compiler.Service.Interactive.Shell // F# Interactive

@NinoFloris
Copy link
Contributor

FSharp.CompilerServices maybe?

@@ -167,8 +167,7 @@ module LayoutRender =

let emitL f layout = renderL (taggedTextListR f) layout |> ignore

let toImmutableArray layout =
Copy link
Contributor

Choose a reason for hiding this comment

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

why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ImmutableArray is not in the default reference set for F# Interactive (i.e. the default reference set for the F# scripting model) and in my testing this is causing problems when using the API (though I could just reference it in my test scripts)

We can still use ImmutableArray but I just wanted to do it all-at-once intentionally (replacing all uses of IList<_> by ImmutableArray<_> for example) and also remembering to fix this problem.

I'll make a note of this at the top of this PR

@dsyme
Copy link
Contributor Author

dsyme commented Feb 2, 2021

FSharp.CompilerServices maybe?

I quite like this name.

FSharp.CompilerServices.IO  // FileSystem
FSharp.CompilerServices.CodeAnalysis // FSharpChecker, FSharpCheckFileResults, FSharpChecProjectResults and friends
FSharp.CompilerServices.Diagnostics     // FSharpDiagnostic and friends
FSharp.CompilerServices.EditorServices // Misc functionality for editors, e.g. interface stub generation
FSharp.CompilerServices.Interactive.Shell // F# Interactive
FSharp.CompilerServices.Symbols           // FSharpEntity etc
FSharp.CompilerServices.Syntax           // Types and functionality for syntax tree
FSharp.CompilerServices.Text           // ISourceFile, Range, TaggedText and other things
FSharp.CompilerServices.Tokenization      // FSharpLineTokenizer etc.

@dsyme
Copy link
Contributor Author

dsyme commented Feb 3, 2021

This PR is ready (once green). It's large but nearly entirely routine.

Would appreciate getting it merged fairly rapidly to minimise maintenance and get it integrated against all other ongoing work.

@vzarytovskii vzarytovskii merged commit 6b1af12 into dotnet:main Feb 4, 2021
@dsyme
Copy link
Contributor Author

dsyme commented Feb 4, 2021

Thank you for the quick merge!!!

@dsyme dsyme mentioned this pull request Feb 4, 2021
nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants