Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9ecbccc

Browse files
authored
Merge pull request #5070 from Microsoft/merges/master-to-dev15.8
Merge master to dev15.8
2 parents953c3c6 +ca2e154 commit9ecbccc

File tree

3 files changed

+58
-59
lines changed

3 files changed

+58
-59
lines changed

‎setup/Swix/Microsoft.FSharp.Compiler/Files.swr‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp"
2828
file source="$(BinariesFolder)\net40\bin\Microsoft.FSharp.NetSdk.targets"
2929
file source="$(BinariesFolder)\net40\bin\Microsoft.FSharp.Targets"
3030
file source="$(BinariesFolder)\net40\bin\Microsoft.Portable.FSharp.Targets"
31-
file source="$(FSharpTreeRoot)\vsintegration\src\SupportedRuntimes\SupportedRuntimes.xml"
3231
file source="$(BinariesFolder)\net40\bin\System.Collections.Immutable.dll"
3332
file source="$(BinariesFolder)\net40\bin\System.Reflection.Metadata.dll"
3433
file source="$(BinariesFolder)\net40\bin\System.ValueTuple.dll"

‎vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs‎

Lines changed: 57 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -211,64 +211,63 @@ namespace rec Microsoft.VisualStudio.FSharp.ProjectSystem
211211
memberthis.ListAvailableFSharpCoreVersions(_)= Array.empty}
212212

213213
letservice=
214-
match Internal.Utilities.FSharpEnvironment.BinFolderOfDefaultFSharpCompiler(None)with
215-
| None-> nullService
216-
| Some path->
217-
try
218-
letsupportedRuntimesXml= System.Xml.Linq.XDocument.Load(Path.Combine(path,"SupportedRuntimes.xml"))
219-
lettryGetAttr(el:System.Xml.Linq.XElement)attr=
220-
match el.Attribute(System.Xml.Linq.XName.Get attr)with
221-
|null-> None
222-
| x-> Some x.Value
223-
letflatList=
224-
supportedRuntimesXml.Root.Elements(System.Xml.Linq.XName.Get"TargetFramework")
225-
|> Seq.choose(fun tf->
226-
match tryGetAttr tf"Identifier", tryGetAttr tf"Version", tryGetAttr tf"Profile"with
227-
| Some key1, Some key2,_
228-
| Some key1,_, Some key2->
229-
Some(
230-
key1,// identifier
231-
key2,// version or profile
232-
[|
233-
for asmin tf.Elements(System.Xml.Linq.XName.Get"Assembly")do
234-
letversion= asm.Attribute(System.Xml.Linq.XName.Get"Version")
235-
letdescription= asm.Attribute(System.Xml.Linq.XName.Get"Description")
236-
match version, descriptionwith
237-
|null,_|_,null->()
238-
| version, description->
239-
yield Microsoft.VisualStudio.FSharp.ProjectSystem.FSharpCoreVersion(version.Value, description.Value)
240-
|]
241-
)
242-
|_-> None
243-
)
244-
245-
|> Seq.toList
246-
let(_,_,v2)= flatList|> List.find(fun(k1,k2,_)-> k1= FSharpSDKHelper.NETFramework&& k2= FSharpSDKHelper.v20)
247-
let(_,_,v4)= flatList|> List.find(fun(k1,k2,_)-> k1= FSharpSDKHelper.NETFramework&& k2= FSharpSDKHelper.v40)
248-
let(_,_,v45)= flatList|> List.find(fun(k1,k2,_)-> k1= FSharpSDKHelper.NETFramework&& k2= FSharpSDKHelper.v45)
249-
{
250-
new Microsoft.VisualStudio.FSharp.ProjectSystem.IFSharpCoreVersionLookupServicewith
251-
memberthis.ListAvailableFSharpCoreVersions(targetFramework)=
252-
if targetFramework.Identifier= FSharpSDKHelper.NETFramework
253-
then
254-
// for .NETFramework we distinguish between 2.0, 4.0 and 4.5
255-
if targetFramework.Version.Major<4then v2
256-
elif targetFramework.Version.Major=4&& targetFramework.Version.Minor<5then v4
257-
else v45
258-
else
259-
// for other target frameworks we assume that they are distinguished by the profile
260-
letresult=
261-
flatList
262-
|> List.tryPick(fun(k1,k2,list)->
263-
if k1= targetFramework.Identifier&& k2= targetFramework.Profilethen Some listelse None
264-
)
265-
match resultwith
266-
| Some list-> list
267-
| None->
268-
Debug.Assert(false, sprintf"Unexpected target framework identifier '%O'" targetFramework)
269-
[||]
270-
}
271-
with_-> nullService
214+
try
215+
// SupportedRuntimes is deployed alongside the ProjectSystem dll
216+
letpath= Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)
217+
letsupportedRuntimesXml= System.Xml.Linq.XDocument.Load(Path.Combine(path,"SupportedRuntimes.xml"))
218+
lettryGetAttr(el:System.Xml.Linq.XElement)attr=
219+
match el.Attribute(System.Xml.Linq.XName.Get attr)with
220+
|null-> None
221+
| x-> Some x.Value
222+
letflatList=
223+
supportedRuntimesXml.Root.Elements(System.Xml.Linq.XName.Get"TargetFramework")
224+
|> Seq.choose(fun tf->
225+
match tryGetAttr tf"Identifier", tryGetAttr tf"Version", tryGetAttr tf"Profile"with
226+
| Some key1, Some key2,_
227+
| Some key1,_, Some key2->
228+
Some(
229+
key1,// identifier
230+
key2,// version or profile
231+
[|
232+
for asmin tf.Elements(System.Xml.Linq.XName.Get"Assembly")do
233+
letversion= asm.Attribute(System.Xml.Linq.XName.Get"Version")
234+
letdescription= asm.Attribute(System.Xml.Linq.XName.Get"Description")
235+
match version, descriptionwith
236+
|null,_|_,null->()
237+
| version, description->
238+
yield Microsoft.VisualStudio.FSharp.ProjectSystem.FSharpCoreVersion(version.Value, description.Value)
239+
|]
240+
)
241+
|_-> None
242+
)
243+
244+
|> Seq.toList
245+
let(_,_,v2)= flatList|> List.find(fun(k1,k2,_)-> k1= FSharpSDKHelper.NETFramework&& k2= FSharpSDKHelper.v20)
246+
let(_,_,v4)= flatList|> List.find(fun(k1,k2,_)-> k1= FSharpSDKHelper.NETFramework&& k2= FSharpSDKHelper.v40)
247+
let(_,_,v45)= flatList|> List.find(fun(k1,k2,_)-> k1= FSharpSDKHelper.NETFramework&& k2= FSharpSDKHelper.v45)
248+
{
249+
new Microsoft.VisualStudio.FSharp.ProjectSystem.IFSharpCoreVersionLookupServicewith
250+
memberthis.ListAvailableFSharpCoreVersions(targetFramework)=
251+
if targetFramework.Identifier= FSharpSDKHelper.NETFramework
252+
then
253+
// for .NETFramework we distinguish between 2.0, 4.0 and 4.5
254+
if targetFramework.Version.Major<4then v2
255+
elif targetFramework.Version.Major=4&& targetFramework.Version.Minor<5then v4
256+
else v45
257+
else
258+
// for other target frameworks we assume that they are distinguished by the profile
259+
letresult=
260+
flatList
261+
|> List.tryPick(fun(k1,k2,list)->
262+
if k1= targetFramework.Identifier&& k2= targetFramework.Profilethen Some listelse None
263+
)
264+
match resultwith
265+
| Some list-> list
266+
| None->
267+
Debug.Assert(false, sprintf"Unexpected target framework identifier '%O'" targetFramework)
268+
[||]
269+
}
270+
with_-> nullService
272271
(this:> IServiceContainer).AddService(typeof<Microsoft.VisualStudio.FSharp.ProjectSystem.IFSharpCoreVersionLookupService>, service, promote=true)
273272

274273

‎vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
<CompileInclude="MSBuildUtilities.fs" />
3838
<CompileInclude="AppConfigHelper.fs" />
3939
<CompileInclude="Project.fs" />
40+
<NoneInclude="..\SupportedRuntimes\SupportedRuntimes.xml"CopyToOutputDirectory="PreserveNewest" />
4041
</ItemGroup>
4142

4243
<ItemGroup>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp