Skip to content

Commit

Permalink
Merge master into vs2017-rtm (#3458)
Browse files Browse the repository at this point in the history
* Document project options and mark lots of things as deprecated (#3449)

* Document project options and mark lots of things as deprecated

* delete some code that is no longer used

* fix packaging of FSharp.Core. (#3452)

* implement IDisposable interfaces explicitly  (#3447)

* added IDisposable

* reverted Dispose change

* ngen open source install (#3456)

* handle "Blue (high contrast)" theme (#3443)
  • Loading branch information
brettfo authored and KevinRansom committed Aug 17, 2017
1 parent f41a9a8 commit cc1b137
Show file tree
Hide file tree
Showing 58 changed files with 585 additions and 643 deletions.
18 changes: 18 additions & 0 deletions src/fsharp/FSharp.Core.nuget/FSharp.Core.4.1.xxx.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
<projectUrl>$projectUrl$</projectUrl>
<tags>$tags$</tags>
<dependencies>
<group targetFramework="net20">
</group>
<group targetFramework="net40">
</group>
<group targetFramework="net45">
</group>
<group targetFramework=".NETStandard1.6">
<dependency id="System.Collections" version="4.0.11" />
<dependency id="System.Console" version="4.0.0" />
Expand All @@ -50,6 +56,18 @@
<dependency id="System.Threading.ThreadPool" version="4.0.10" />
<dependency id="System.Threading.Timer" version="4.0.1" />
</group>
<group targetFramework="portable-net45+monoandroid10+monotouch10+xamarinios10">
</group>
<group targetFramework="portable-net45+netcore45">
</group>
<group targetFramework="portable-net45+netcore45+wp8">
</group>
<group targetFramework="portable-net45+netcore45+wpa81+wp8">
</group>
<group targetFramework="portable-net45+sl5+netcore45">
</group>
<group targetFramework="xamarinmac20">
</group>
</dependencies>
</metadata>
<files>
Expand Down
2 changes: 2 additions & 0 deletions src/fsharp/FSharp.Core.nuget/FSharp.Core.4.2.xxx.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
<dependency id="System.Threading.ThreadPool" version="4.0.10" />
<dependency id="System.Threading.Timer" version="4.0.1" />
</group>
<group targetFramework="net45">
</group>
</dependencies>
</metadata>
<files>
Expand Down
9 changes: 6 additions & 3 deletions src/fsharp/FSharp.Core/prim-types.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5260,10 +5260,11 @@ namespace Microsoft.FSharp.Core
state.Current

{ new IEnumerator<'T> with
member __.Dispose () = ()

member __.Current = current ()

interface System.IDisposable with
member __.Dispose () = ()

interface IEnumerator with
member __.Current = box (current ())

Expand Down Expand Up @@ -5317,9 +5318,11 @@ namespace Microsoft.FSharp.Core
derefValue

{ new IEnumerator<'T> with
member __.Dispose () = ()
member __.Current = current ()

interface System.IDisposable with
member __.Dispose () = ()

interface IEnumerator with
member __.Current = box (current ())
member __.Reset () = value := n - LanguagePrimitives.GenericOne
Expand Down
6 changes: 3 additions & 3 deletions src/fsharp/FSharp.Core/seq.fs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ namespace Microsoft.FSharp.Collections
if not finished then disposeG g

// Internal type, used to optimize Enumerator/Generator chains
type LazyGeneratorWrappingEnumerator<'T>(e:System.Collections.Generic.IEnumerator<'T>) =
type LazyGeneratorWrappingEnumerator<'T>(e:IEnumerator<'T>) =
member g.Enumerator = e
interface Generator<'T> with
member g.Apply = (fun () ->
Expand All @@ -419,9 +419,9 @@ namespace Microsoft.FSharp.Collections
let EnumerateFromGenerator(g:Generator<'T>) =
match g with
| :? LazyGeneratorWrappingEnumerator<'T> as g -> g.Enumerator
| _ -> (new EnumeratorWrappingLazyGenerator<_>(g) :> System.Collections.Generic.IEnumerator<_>)
| _ -> (new EnumeratorWrappingLazyGenerator<'T>(g) :> IEnumerator<'T>)

let GenerateFromEnumerator (e:System.Collections.Generic.IEnumerator<'T>) =
let GenerateFromEnumerator (e:IEnumerator<'T>) =
match e with
| :? EnumeratorWrappingLazyGenerator<'T> as e -> e.Generator
| _ -> (new LazyGeneratorWrappingEnumerator<'T>(e) :> Generator<'T>)
Expand Down
1 change: 1 addition & 0 deletions src/fsharp/FSharp.Core/seqcore.fs
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ namespace Microsoft.FSharp.Core.CompilerServices
member x.GetEnumerator() = (x.GetFreshEnumerator() :> IEnumerator)
interface IEnumerator<'T> with
member x.Current = if redirect then redirectTo.LastGenerated else x.LastGenerated
interface System.IDisposable with
member x.Dispose() = if redirect then redirectTo.Close() else x.Close()
interface IEnumerator with
member x.Current = box (if redirect then redirectTo.LastGenerated else x.LastGenerated)
Expand Down
1 change: 1 addition & 0 deletions src/fsharp/FSharp.Core/seqcore.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,4 @@ namespace Microsoft.FSharp.Core.CompilerServices
interface IEnumerable
interface IEnumerator<'T>
interface IEnumerator
interface IDisposable
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<Actions>
<Action Type="Ngen" Path="fsiAnyCpu.exe" />
<Action Type="Ngen" Path="fsi.exe" />
<Action Type="Ngen" Path="FSharp.Compiler.Service.dll" />
<Action Type="Ngen" Path="FSharp.Compiler.Private.dll" />
<Action Type="Ngen" Path="FSharp.Compiler.Interactive.Settings.dll" />
<Action Type="Ngen" Path="FSharp.Compiler.Server.Shared.dll" />
<Action Type="Ngen" Path="FSharp.Core.dll" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ module internal ClassificationDefinitions =
) =

let (| LightTheme | DarkTheme | UnknownTheme |) id =
if id = KnownColorThemes.Light || id = KnownColorThemes.Blue then LightTheme
if id = KnownColorThemes.Light || id = KnownColorThemes.Blue || id = Guids.blueHighContrastThemeId then LightTheme
elif id = KnownColorThemes.Dark then DarkTheme
else UnknownTheme

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type internal FSharpColorizationService
[<ImportingConstructor>]
(
checkerProvider: FSharpCheckerProvider,
projectInfoManager: ProjectInfoManager
projectInfoManager: FSharpProjectOptionsManager
) =
static let userOpName = "SemanticColorization"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type internal FSharpAddOpenCodeFixProvider
[<ImportingConstructor>]
(
checkerProvider: FSharpCheckerProvider,
projectInfoManager: ProjectInfoManager,
projectInfoManager: FSharpProjectOptionsManager,
assemblyContentProvider: AssemblyContentProvider
) =
inherit CodeFixProvider()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type internal FSharpImplementInterfaceCodeFixProvider
[<ImportingConstructor>]
(
checkerProvider: FSharpCheckerProvider,
projectInfoManager: ProjectInfoManager
projectInfoManager: FSharpProjectOptionsManager
) =
inherit CodeFixProvider()
let fixableDiagnosticIds = ["FS0366"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type internal FSharpProposeUpperCaseLabelCodeFixProvider
[<ImportingConstructor>]
(
checkerProvider: FSharpCheckerProvider,
projectInfoManager: ProjectInfoManager
projectInfoManager: FSharpProjectOptionsManager
) =
inherit CodeFixProvider()
let fixableDiagnosticIds = ["FS0053"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type internal FSharpRemoveUnusedOpensCodeFixProvider
[<ImportingConstructor>]
(
checkerProvider: FSharpCheckerProvider,
projectInfoManager: ProjectInfoManager
projectInfoManager: FSharpProjectOptionsManager
) =
inherit CodeFixProvider()
let fixableDiagnosticIds = [IDEDiagnosticIds.RemoveUnnecessaryImportsDiagnosticId]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type internal FSharpRenameUnusedValueCodeFixProvider
[<ImportingConstructor>]
(
checkerProvider: FSharpCheckerProvider,
projectInfoManager: ProjectInfoManager
projectInfoManager: FSharpProjectOptionsManager
) =

inherit CodeFixProvider()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type internal FSharpHelpContextService
[<ImportingConstructor>]
(
checkerProvider: FSharpCheckerProvider,
projectInfoManager: ProjectInfoManager
projectInfoManager: FSharpProjectOptionsManager
) =

static let userOpName = "ImplementInterfaceCodeFix"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type internal XmlDocCommandFilter
wpfTextView: IWpfTextView,
filePath: string,
checkerProvider: FSharpCheckerProvider,
projectInfoManager: ProjectInfoManager,
projectInfoManager: FSharpProjectOptionsManager,
workspace: VisualStudioWorkspaceImpl
) =

Expand Down Expand Up @@ -117,7 +117,7 @@ type internal XmlDocCommandFilter
type internal XmlDocCommandFilterProvider
[<ImportingConstructor>]
(checkerProvider: FSharpCheckerProvider,
projectInfoManager: ProjectInfoManager,
projectInfoManager: FSharpProjectOptionsManager,
workspace: VisualStudioWorkspaceImpl,
textDocumentFactoryService: ITextDocumentFactoryService,
editorFactory: IVsEditorAdaptersFactoryService) =
Expand Down
2 changes: 2 additions & 0 deletions vsintegration/src/FSharp.Editor/Common/Constants.fs
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,5 @@ module internal Guids =
[<Literal>]
/// "8FDA964A-263D-4B4E-9560-29897535217C"
let languageServicePerformanceOptionPageIdString = "8FDA964A-263D-4B4E-9560-29897535217C"

let blueHighContrastThemeId = Guid "{ce94d289-8481-498b-8ca9-9b6191a315b9}"
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type internal FSharpCompletionProvider
workspace: Workspace,
serviceProvider: SVsServiceProvider,
checkerProvider: FSharpCheckerProvider,
projectInfoManager: ProjectInfoManager,
projectInfoManager: FSharpProjectOptionsManager,
assemblyContentProvider: AssemblyContentProvider
) =

Expand Down Expand Up @@ -231,7 +231,7 @@ type internal FSharpCompletionProvider
let documentation = List()
let collector = RoslynHelpers.CollectTaggedText documentation
// mix main description and xmldoc by using one collector
XmlDocumentation.BuildDataTipText(documentationBuilder, collector, collector, description)
XmlDocumentation.BuildDataTipText(documentationBuilder, collector, collector, collector, collector, collector, description)
return CompletionDescription.Create(documentation.ToImmutableArray())
else
return CompletionDescription.Empty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type internal FSharpCompletionService
workspace: Workspace,
serviceProvider: SVsServiceProvider,
checkerProvider: FSharpCheckerProvider,
projectInfoManager: ProjectInfoManager,
projectInfoManager: FSharpProjectOptionsManager,
assemblyContentProvider: AssemblyContentProvider
) =
inherit CompletionServiceWithProviders(workspace)
Expand Down Expand Up @@ -47,7 +47,7 @@ type internal FSharpCompletionServiceFactory
(
serviceProvider: SVsServiceProvider,
checkerProvider: FSharpCheckerProvider,
projectInfoManager: ProjectInfoManager,
projectInfoManager: FSharpProjectOptionsManager,
assemblyContentProvider: AssemblyContentProvider
) =
interface ILanguageServiceFactory with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type internal Completion =
AllowableExtensions = allowableExtensions
UseIncludeDirectives = useIncludeDirectives }

type internal HashDirectiveCompletionProvider(workspace: Workspace, projectInfoManager: ProjectInfoManager, completions: Completion list) =
type internal HashDirectiveCompletionProvider(workspace: Workspace, projectInfoManager: FSharpProjectOptionsManager, completions: Completion list) =
inherit CommonCompletionProvider()

let [<Literal>] NetworkPath = "\\\\"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type internal FSharpSignatureHelpProvider
(
serviceProvider: SVsServiceProvider,
checkerProvider: FSharpCheckerProvider,
projectInfoManager: ProjectInfoManager
projectInfoManager: FSharpProjectOptionsManager
) =

static let userOpName = "SignatureHelpProvider"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type internal FSharpBreakpointResolutionService
[<ImportingConstructor>]
(
checkerProvider: FSharpCheckerProvider,
projectInfoManager: ProjectInfoManager
projectInfoManager: FSharpProjectOptionsManager
) =

static let userOpName = "BreakpointResolution"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ open Microsoft.VisualStudio.FSharp.LanguageService

[<Shared>]
[<ExportLanguageService(typeof<ILanguageDebugInfoService>, FSharpConstants.FSharpLanguageName)>]
type internal FSharpLanguageDebugInfoService [<ImportingConstructor>](projectInfoManager: ProjectInfoManager) =
type internal FSharpLanguageDebugInfoService [<ImportingConstructor>](projectInfoManager: FSharpProjectOptionsManager) =

static member GetDataTipInformation(sourceText: SourceText, position: int, tokens: List<ClassifiedSpan>): TextSpan option =
let tokenIndex = tokens |> Seq.tryFindIndex(fun t -> t.TextSpan.Contains(position))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type internal FSharpDocumentDiagnosticAnalyzer() =
document.Project.Solution.Workspace.Services.GetService<FSharpCheckerWorkspaceService>().Checker

let getProjectInfoManager(document: Document) =
document.Project.Solution.Workspace.Services.GetService<FSharpCheckerWorkspaceService>().ProjectInfoManager
document.Project.Solution.Workspace.Services.GetService<FSharpCheckerWorkspaceService>().FSharpProjectOptionsManager

static let errorInfoEqualityComparer =
{ new IEqualityComparer<FSharpErrorInfo> with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type internal SimplifyNameDiagnosticAnalyzer() =
inherit DocumentDiagnosticAnalyzer()

static let userOpName = "SimplifyNameDiagnosticAnalyzer"
let getProjectInfoManager (document: Document) = document.Project.Solution.Workspace.Services.GetService<FSharpCheckerWorkspaceService>().ProjectInfoManager
let getProjectInfoManager (document: Document) = document.Project.Solution.Workspace.Services.GetService<FSharpCheckerWorkspaceService>().FSharpProjectOptionsManager
let getChecker (document: Document) = document.Project.Solution.Workspace.Services.GetService<FSharpCheckerWorkspaceService>().Checker
let getPlidLength (plid: string list) = (plid |> List.sumBy String.length) + plid.Length
static let cache = ConditionalWeakTable<DocumentId, TextVersionHash * ImmutableArray<Diagnostic>>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type internal UnusedDeclarationsAnalyzer() =
inherit DocumentDiagnosticAnalyzer()

static let userOpName = "UnusedDeclarationsAnalyzer"
let getProjectInfoManager (document: Document) = document.Project.Solution.Workspace.Services.GetService<FSharpCheckerWorkspaceService>().ProjectInfoManager
let getProjectInfoManager (document: Document) = document.Project.Solution.Workspace.Services.GetService<FSharpCheckerWorkspaceService>().FSharpProjectOptionsManager
let getChecker (document: Document) = document.Project.Solution.Workspace.Services.GetService<FSharpCheckerWorkspaceService>().Checker
let [<Literal>] DescriptorId = "FS1182"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ module private UnusedOpens =
type internal UnusedOpensDiagnosticAnalyzer() =
inherit DocumentDiagnosticAnalyzer()

let getProjectInfoManager (document: Document) = document.Project.Solution.Workspace.Services.GetService<FSharpCheckerWorkspaceService>().ProjectInfoManager
let getProjectInfoManager (document: Document) = document.Project.Solution.Workspace.Services.GetService<FSharpCheckerWorkspaceService>().FSharpProjectOptionsManager
let getChecker (document: Document) = document.Project.Solution.Workspace.Services.GetService<FSharpCheckerWorkspaceService>().Checker

static let userOpName = "UnusedOpensAnalyzer"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type internal FSharpHighlightSpan =

[<Shared>]
[<ExportLanguageService(typeof<IDocumentHighlightsService>, FSharpConstants.FSharpLanguageName)>]
type internal FSharpDocumentHighlightsService [<ImportingConstructor>] (checkerProvider: FSharpCheckerProvider, projectInfoManager: ProjectInfoManager) =
type internal FSharpDocumentHighlightsService [<ImportingConstructor>] (checkerProvider: FSharpCheckerProvider, projectInfoManager: FSharpProjectOptionsManager) =

static let userOpName = "DocumentHighlights"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type internal FSharpBraceMatchingService
[<ImportingConstructor>]
(
checkerProvider: FSharpCheckerProvider,
projectInfoManager: ProjectInfoManager
projectInfoManager: FSharpProjectOptionsManager
) =

static let userOpName = "BraceMatching"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ open Microsoft.FSharp.Compiler.SourceCodeServices
[<ExportLanguageService(typeof<ISynchronousIndentationService>, FSharpConstants.FSharpLanguageName)>]
type internal FSharpIndentationService
[<ImportingConstructor>]
(projectInfoManager: ProjectInfoManager) =
(projectInfoManager: FSharpProjectOptionsManager) =

static member GetDesiredIndentation(documentId: DocumentId, sourceText: SourceText, filePath: string, lineNumber: int, tabSize: int, optionsOpt: FSharpProjectOptions option): Option<int> =
// Match indentation with previous line
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ type internal InlineRenameLocationSet(locationsByDocument: DocumentLocations [],
type internal InlineRenameInfo
(
checker: FSharpChecker,
projectInfoManager: ProjectInfoManager,
projectInfoManager: FSharpProjectOptionsManager,
document: Document,
triggerSpan: TextSpan,
lexerSymbol: LexerSymbol,
Expand Down Expand Up @@ -141,13 +141,13 @@ type internal InlineRenameInfo
type internal InlineRenameService
[<ImportingConstructor>]
(
projectInfoManager: ProjectInfoManager,
projectInfoManager: FSharpProjectOptionsManager,
checkerProvider: FSharpCheckerProvider,
[<ImportMany>] _refactorNotifyServices: seq<IRefactorNotifyService>
) =

static let userOpName = "InlineRename"
static member GetInlineRenameInfo(checker: FSharpChecker, projectInfoManager: ProjectInfoManager, document: Document, sourceText: SourceText, position: int,
static member GetInlineRenameInfo(checker: FSharpChecker, projectInfoManager: FSharpProjectOptionsManager, document: Document, sourceText: SourceText, position: int,
defines: string list, options: FSharpProjectOptions) : Async<IInlineRenameInfo option> =
asyncMaybe {
let textLine = sourceText.Lines.GetLineFromPosition(position)
Expand Down
Loading

0 comments on commit cc1b137

Please sign in to comment.