Skip to content

Commit

Permalink
Merge pull request #112 from baronfel/fcs-34
Browse files Browse the repository at this point in the history
Update FSharp.Compiler.Service to version 34.0.1
  • Loading branch information
ashmind authored Feb 9, 2020
2 parents 4bcdf0e + 8e8b782 commit d49bfb0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
4 changes: 2 additions & 2 deletions FSharp/FSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<AssemblyName>MirrorSharp.FSharp</AssemblyName>
<RootNamespace>MirrorSharp.FSharp</RootNamespace>
<TargetFrameworks>netstandard2.0; net461</TargetFrameworks>
<VersionPrefix>0.17</VersionPrefix>
<VersionPrefix>0.18</VersionPrefix>
<Description>MirrorSharp F# support library. $(DescriptionSuffix)</Description>
<PackageTags>F#;CodeMirror</PackageTags>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand All @@ -16,7 +16,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="FSharp.Compiler.Service" Version="32.0.0" />
<PackageReference Include="FSharp.Compiler.Service" Version="34.0.1" />
<PackageReference Include="FSharp.Core" Version="4.7.0" />
</ItemGroup>

Expand Down
10 changes: 8 additions & 2 deletions FSharp/Internal/FSharpSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public FSharpSession(string text, MirrorSharpFSharpOptions options) {
keepAllBackgroundResolutions: true,
legacyReferenceResolver: null,
tryGetMetadataSnapshot: null,
suggestNamesForErrors: FSharpOption<bool>.Some(true)
suggestNamesForErrors: true,
keepAllBackgroundSymbolUses: false
);
Checker.ImplicitlyStartBackgroundWork = false;
AssemblyReferencePaths = options.AssemblyReferencePaths;
Expand All @@ -48,7 +49,7 @@ public FSharpSession(string text, MirrorSharpFSharpOptions options) {
useScriptResolutionRules: false,
loadTime: DateTime.Now,
unresolvedReferences: null,
originalLoadReferences: FSharpList<Tuple<Range.range, string>>.Empty,
originalLoadReferences: FSharpList<Tuple<Range.range, string, string>>.Empty,
extraProjectInfo: null,
stamp: null
);
Expand Down Expand Up @@ -85,6 +86,11 @@ private string[] ConvertToOtherOptions(MirrorSharpFSharpOptions options) {
results.Add("--optimize" + (options.Optimize.Value ? "+" : "-"));
if (options.Target != null)
results.Add("--target:" + options.Target);
if (options.LangVersion != null)
results.Add("--langversion:" + options.LangVersion);
if (options.TargetProfile != null)
results.Add("--targetprofile:" + options.TargetProfile);

foreach (var path in options.AssemblyReferencePaths) {
// ReSharper disable once HeapView.ObjectAllocation (Not worth fixing for now)
results.Add("-r:" + path);
Expand Down
9 changes: 9 additions & 0 deletions FSharp/MirrorSharpFSharpOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,14 @@ internal MirrorSharpFSharpOptions() {

/// <summary>Corresponds to option <c>--target</c> in <see cref="FSharpProjectOptions.OtherOptions"/>.</summary>
public string? Target { get; set; }

/// <summary>Corresponds to option <c>--langversion</c> in <see cref="FSharpProjectOptions.OtherOptions"/>.</summary>
public string? LangVersion { get; set; }

/// <summary>
/// Corresponds to option <c>--targetprofile</c> in <see cref="FSharpProjectOptions.OtherOptions"/>.
/// Valid values are "mscorlib", "netcore", and "netstandard"
/// </summary>
public string? TargetProfile { get; set; }
}
}
2 changes: 1 addition & 1 deletion Tests.Shared/FSharpProjectOptionsExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private FSharpProjectOptions NewOptions(string[]? otherOptions = null) {
false,
DateTime.MinValue,
null,
FSharpList<Tuple<global::FSharp.Compiler.Range.range, string>>.Empty,
FSharpList<Tuple<global::FSharp.Compiler.Range.range, string, string>>.Empty,
null,
null
);
Expand Down

0 comments on commit d49bfb0

Please sign in to comment.