Skip to content

Update nuget #18504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/Compiler/Driver/ScriptClosure.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
]

Expand Down
2 changes: 1 addition & 1 deletion vsintegration/src/FSharp.Editor/Common/Extensions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -226,7 +229,6 @@ type private FSharpProjectOptionsReactor(checker: FSharpChecker) =
userOpName = userOpName
)

let textViewAndCaret = document.TryGetTextViewAndCaretPos()
let! scriptProjectOptions, _ = getProjectOptionsFromScript textViewAndCaret
let project = document.Project

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading