From f4710e30f913b910ab468f0ca19dc67b7e561727 Mon Sep 17 00:00:00 2001 From: Vlad Zarytovskii Date: Thu, 9 Jan 2025 14:32:00 +0100 Subject: [PATCH 1/2] Versioning for 17.14 and 9.0.300 (#18222) --- azure-pipelines.yml | 4 ++-- eng/Versions.props | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1e5aaebbdf9..95c03d1c0d4 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -29,7 +29,7 @@ variables: # Should be 'current' release branch name, i.e. 'release/dev17.10' in dotnet/fsharp/refs/heads/main, 'release/dev17.10' in dotnet/fsharp/refs/heads/release/dev17.10 and 'release/dev17.9' in dotnet/fsharp/refs/heads/release/dev17.9 # Should **never** be 'main' in dotnet/fsharp/refs/heads/main, since it will start inserting to VS twice. - name: FSharpReleaseBranchName - value: release/dev17.13 + value: release/dev17.14 # VS Insertion branch name (NOT the same as F# branch) # Should be previous release branch or 'main' in 'main' and 'main' in release branch # (since for all *new* release branches we insert into VS main and for all *previous* releases we insert into corresponding VS release), @@ -88,7 +88,7 @@ extends: # Signed build # #-------------------------------------------------------------------------------------------------------------------# # Localization: we only run it for specific release branches - - ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/release/dev17.13') }}: + - ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/release/dev17.14') }}: - template: /eng/common/templates-official/job/onelocbuild.yml@self parameters: MirrorRepo: fsharp diff --git a/eng/Versions.props b/eng/Versions.props index 7727e2eda17..00bbbc51afb 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -14,7 +14,7 @@ 9 0 - 200 + 300 0 @@ -53,7 +53,7 @@ 17 - 13 + 14 $(VSMajorVersion).0 $(VSMajorVersion).$(VSMinorVersion).0 $(VSAssemblyVersionPrefix).0 From eb00cdba2dc81a266fc6854a05f25cb0479a875d Mon Sep 17 00:00:00 2001 From: KevinRansom Date: Tue, 1 Apr 2025 20:43:06 -0700 Subject: [PATCH 2/2] Fix PM --- src/Compiler/Driver/ScriptClosure.fs | 6 ++++-- vsintegration/src/FSharp.Editor/Common/Extensions.fs | 2 +- .../LanguageService/FSharpProjectOptionsManager.fs | 10 ++++++---- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Compiler/Driver/ScriptClosure.fs b/src/Compiler/Driver/ScriptClosure.fs index b97b11a8054..b45049627cf 100644 --- a/src/Compiler/Driver/ScriptClosure.fs +++ b/src/Compiler/Driver/ScriptClosure.fs @@ -327,11 +327,13 @@ module ScriptPreprocessClosure = for kv in tcConfig.packageManagerLines do let packageManagerKey, packageManagerLines = kv.Key, kv.Value - match packageManagerLines |> List.filter (not << isEditorCursorInPackageLines) with + let packageManagerLines = + packageManagerLines |> List.filter (not << isEditorCursorInPackageLines) + + match packageManagerLines with | [] -> () | packageManagerLine :: _ -> let m = packageManagerLine.Range - let packageManagerLines = packageManagerLines yield! processPackageManagerLines m packageManagerLines scriptName packageManagerKey ] diff --git a/vsintegration/src/FSharp.Editor/Common/Extensions.fs b/vsintegration/src/FSharp.Editor/Common/Extensions.fs index 2ed87e5ec82..ff17ac43662 100644 --- a/vsintegration/src/FSharp.Editor/Common/Extensions.fs +++ b/vsintegration/src/FSharp.Editor/Common/Extensions.fs @@ -139,7 +139,7 @@ type Document with | hr, _, _, docData, _ when ErrorHandler.Succeeded(hr) && docData <> IntPtr.Zero -> match Marshal.GetObjectForIUnknown docData with | :? IVsTextBuffer as ivsTextBuffer -> - match textManager.GetActiveView(1, ivsTextBuffer) with + match textManager.GetActiveView(0, ivsTextBuffer) with | hr, vsTextView when ErrorHandler.Succeeded(hr) -> Some vsTextView | _ -> None | _ -> None diff --git a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs index edf31e68a57..d61ba717b4d 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs @@ -200,13 +200,16 @@ type private FSharpProjectOptionsReactor(checker: FSharpChecker) = cancellableTask { let! ct = CancellableTask.getCancellationToken () let! fileStamp = document.GetTextVersionAsync(ct) + let textViewAndCaret () : (IVsTextView * Position) option = document.TryGetTextViewAndCaretPos() match singleFileCache.TryGetValue(document.Id) with | false, _ -> let! sourceText = document.GetTextAsync(ct) let getProjectOptionsFromScript textViewAndCaret = - match textViewAndCaret with + let caret = textViewAndCaret () + + match caret with | None -> checker.GetProjectOptionsFromScript( document.FilePath, @@ -226,7 +229,6 @@ type private FSharpProjectOptionsReactor(checker: FSharpChecker) = userOpName = userOpName ) - let textViewAndCaret = document.TryGetTextViewAndCaretPos() let! scriptProjectOptions, _ = getProjectOptionsFromScript textViewAndCaret let project = document.Project @@ -266,7 +268,7 @@ type private FSharpProjectOptionsReactor(checker: FSharpChecker) = let updateProjectOptions () = async { - let! scriptProjectOptions, _ = getProjectOptionsFromScript None + let! scriptProjectOptions, _ = getProjectOptionsFromScript textViewAndCaret checker.NotifyFileChanged(document.FilePath, scriptProjectOptions) |> Async.Start @@ -281,7 +283,7 @@ type private FSharpProjectOptionsReactor(checker: FSharpChecker) = match value with | projectId, fileStamp, parsingOptions, projectOptions, _ -> let subscription = - match textViewAndCaret with + match textViewAndCaret () with | Some(textView, _) -> subscribeToTextViewEvents (textView, (Some onChangeCaretHandler), (Some onKillFocus), (Some onSetFocus)) | None -> None