diff --git a/CHANGELOG.md b/CHANGELOG.md index bd59d44..d702088 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## [1.0.4] - 2024-08-22 + +### Fixed + +* Fixed support for non-FSharp.Core namespaces when using a preview SDK. + ## [1.0.3] - 2024-08-20 ### Fixed diff --git a/src/Fsih/Parser.fs b/src/Fsih/Parser.fs index 2ac762c..623b608 100644 --- a/src/Fsih/Parser.fs +++ b/src/Fsih/Parser.fs @@ -81,9 +81,17 @@ let toFallbackXmlPath (xmlPath: string) = let sep = Path.DirectorySeparatorChar let xmlPath = replaceLast xmlPath "shared" "packs" let xmlPath = replaceLast xmlPath $".App{sep}" $".App.Ref{sep}" - let version = Regex.Match(xmlPath, @"\d+\.\d+\.\d+").Value - let release = version.Substring(0, version.LastIndexOf('.')) - let xmlPath = replaceLast xmlPath version $"{version}{sep}ref{sep}net{release}" + let splitted = xmlPath.Split(sep) + let fullVersion = splitted.[splitted.Length - 2] + + let shortVersion = + fullVersion.Split(".") + |> Array.take 2 + |> fun ns -> System.String.Join(".", ns) + + let xmlPath = + replaceLast xmlPath fullVersion $"{fullVersion}{sep}ref{sep}net{shortVersion}" + xmlPath let tryGetXmlDocument xmlPath =