2

FCS API internalizations and renamings

 3 years ago
source link: https://github.com/dotnet/fsharp/pull/10756
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Contributor

dsyme commented 13 days ago

edited

The FSharp.Compiler.Service API has grown organically as various contributors (including myself) made more things more public. Many of these were never designed nor intended to be made public, and are not used in any way by any particular clients that can't be adjusted.

For example, much of FSharp.Compiler.AbstractIL.Internal.* was public - the hint is in the name, this stuff is internal to the F# compiler. Indeed all of FSharp.Compiler.AbstractIL should be regarded as internal apart from the ILModuleReader hook used to allow alternative backing stores.

This trims off about 23,000 lines out of the baseline for the FCS API (that's about half of the API surface area).

* Renamings
*     FSharp.Compiler.AbstractIL.Internal.Library.IFileSystem -> FSharp.Compiler.SourceCodeServices.IFileSystem
*     FSharp.Compiler.AbstractIL.Internal.Library.Shim -> FSharp.Compiler.SourceCodeServices.FileSystemAutoOpens
*     FSharp.Compiler.AbstractIL.Internal.Layout  -> FSharp.Compiler.TextLayout.Layout
*     FSharp.Compiler.AbstractIL.Internal.TaggedText  -> FSharp.Compiler.TextLayout.TaggedText
*     type FSharp.Compiler.Layout.layout -> FSharp.Compiler.TextLayout.Layout
*     type FSharp.Compiler.Layout.Layout -> FSharp.Compiler.TextLayout.Layout
*     module FSharp.Compiler.Layout -> FSharp.Compiler.TextLayout.LayoutRender
*     FSharp.Compiler.LayoutOps -> FSharp.Compiler.TextLayout.Layout
*     FSharp.Compiler.Layout.TaggedText  -> FSharp.Compiler.TextLayout.TaggedText
*     FSharp.Compiler.Layout.TaggedTextOps  -> FSharp.Compiler.TextLayout.TaggedText
*     FSharp.Compiler.Layout.TaggedTextOps.Literals  -> FSharp.Compiler.TextLayout.TaggedText
*
* Renamings in FSharp.Compiler.SourceCodeServices
*   Lexer.* --> FSharp.Compiler.SourceCodeServices.*
*   FSharpSyntaxToken*  --> FSharpToken*
*   FSharpErrorInfo     --> FSharpDiagnostic
*   FSharpErrorSeverity --> FSharpDiagnosticSeverity
*   ExternalSymbol      --> FSharpExternalSymbol
*   UnresolvedSymbol    --> FSharpUnresolvedSymbol
*   CompletionKind      --> FSharpCompletionKind
*   module Keywords     --> FSharpKeywords
*   module Tooltips     --> FSharpTooltip
*
* Extension methods in `ServiceAssemblyContent.fsi` now intrinsic methods on symbol types
* 
* Internalizations:
*   FSharp.Compiler.AbstractIL.* now internal
*   FSharp.Compiler.ErrorLogger.* now internal
*
* New functions in the SourceCodeServices API:
*
*    `FSharpDiagnostic.NewlineifyErrorString`
*    `FSharpDiagnostic.NormalizeErrorString`

The vast majority of the rest of the "inadvertent" part of the API is FSharp.Compiler.SyntaxTree, we can discuss that later.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK