public FSharpSession(string text, MirrorSharpFSharpOptions options) { _text = text; Checker = FSharpChecker.Create( null, keepAssemblyContents: true, keepAllBackgroundResolutions: true, legacyReferenceResolver: null ); AssemblyReferencePaths = options.AssemblyReferencePaths; AssemblyReferencePathsAsFSharpList = ToFSharpList(options.AssemblyReferencePaths); ProjectOptions = new FSharpProjectOptions( "_", sourceFiles: new[] { "_.fs" }, otherOptions: ConvertToOtherOptions(options), referencedProjects: Array.Empty <Tuple <string, FSharpProjectOptions> >(), isIncompleteTypeCheckEnvironment: true, useScriptResolutionRules: false, loadTime: DateTime.Now, unresolvedReferences: null, originalLoadReferences: FSharpList <Tuple <Range.range, string> > .Empty, extraProjectInfo: null, stamp: null ); }
public static MirrorSharpOptions EnableFSharp([NotNull] this MirrorSharpOptions options, [CanBeNull] Action <MirrorSharpFSharpOptions> setup = null) { Argument.NotNull(nameof(options), options); options.Languages.Add(FSharpLanguage.Name, () => { var fsharp = new MirrorSharpFSharpOptions(); setup?.Invoke(fsharp); return(new FSharpLanguage(fsharp)); }); return(options); }
public FSharpLanguage(MirrorSharpFSharpOptions options) { _options = options; }