Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.

Merge fsharp-editor to net6 #20

Merged
merged 4 commits into from
Nov 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions vsintegration/src/FSharp.Editor/Common/FSharpOptionsPanels.fs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,12 @@ type FSharpSettingsPanel() =
widget.EntryCompilerPath.Text <- if use_default || prop_compiler_path = "" then default_compiler_path else prop_compiler_path
widget.EntryCompilerPath.Sensitive <- not use_default

override x.Dispose() =
if widget <> null then widget.Dispose()
override x.Dispose (disposing:bool) =
if widget <> null then
widget.Dispose()
widget <- null

base.Dispose (disposing)

override x.CreatePanelWidget() =
widget <- new FSharpSettingsWidget()
Expand Down Expand Up @@ -118,11 +122,16 @@ type CodeGenerationPanel() =
| 3 -> "Itanium"
| _ -> "anycpu"

override x.Dispose () =
override x.Dispose (disposing:bool) =
if widget <> null then
widget.Dispose ()
widget <- null

if debugCheckedHandler <> null then
debugCheckedHandler.Dispose()
widget <- null

base.Dispose(disposing)

override x.CreatePanelWidget() =
widget <- new FSharpCompilerOptionsWidget ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace Microsoft.VisualStudio.FSharp.Editor
open System
open System.ComponentModel.Composition
open System.Diagnostics
open System.Reflection
open Microsoft.CodeAnalysis
open FSharp.Compiler
open FSharp.Compiler.SourceCodeServices
Expand Down Expand Up @@ -64,6 +65,12 @@ type internal FSharpCheckerProvider
enableBackgroundItemKeyStoreAndSemanticClassification = false) // This option crashes on Mono due to MemoryMappedFile usage
//enablePartialTypeChecking = true)

// HACK: VSMAC - Set MaxMemoryReached flag to true to prevent repeated calls to GC.GetTotalMemory in service.fs CheckMaxMemoryReached which can be slow on Mono
// We can remove this hack once we have migrated to dotnet
let field = checker.GetType().GetField("maxMemoryReached", BindingFlags.NonPublic ||| BindingFlags.Instance)
field.SetValue(checker, true);


// This is one half of the bridge between the F# background builder and the Roslyn analysis engine.
// When the F# background builder refreshes the background semantic build context for a file,
// we request Roslyn to reanalyze that individual file.
Expand Down