Skip to content

Commit 8b4e0e1

Browse files
authored
Merge pull request #16 from dawedawe/fix_preview_sdk
Fix creation of fallback xml paths when using a preview sdk
2 parents e49fedc + f8c0d81 commit 8b4e0e1

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [1.0.4] - 2024-08-22
4+
5+
### Fixed
6+
7+
* Fixed support for non-FSharp.Core namespaces when using a preview SDK.
8+
39
## [1.0.3] - 2024-08-20
410

511
### Fixed

src/Fsih/Parser.fs

+11-3
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,17 @@ let toFallbackXmlPath (xmlPath: string) =
8181
let sep = Path.DirectorySeparatorChar
8282
let xmlPath = replaceLast xmlPath "shared" "packs"
8383
let xmlPath = replaceLast xmlPath $".App{sep}" $".App.Ref{sep}"
84-
let version = Regex.Match(xmlPath, @"\d+\.\d+\.\d+").Value
85-
let release = version.Substring(0, version.LastIndexOf('.'))
86-
let xmlPath = replaceLast xmlPath version $"{version}{sep}ref{sep}net{release}"
84+
let splitted = xmlPath.Split(sep)
85+
let fullVersion = splitted.[splitted.Length - 2]
86+
87+
let shortVersion =
88+
fullVersion.Split(".")
89+
|> Array.take 2
90+
|> fun ns -> System.String.Join(".", ns)
91+
92+
let xmlPath =
93+
replaceLast xmlPath fullVersion $"{fullVersion}{sep}ref{sep}net{shortVersion}"
94+
8795
xmlPath
8896

8997
let tryGetXmlDocument xmlPath =

0 commit comments

Comments
 (0)