Skip to content
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

Main to nightly #1279

Merged
merged 17 commits into from
Apr 30, 2024
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
28 changes: 27 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
# Changelog

## Unreleased
## [0.72.2] - 2024-04-30

### Fixed

* [Use actualRootPath instead of p.RootPath when peeking workspaces](https://github.com/ionide/FsAutoComplete/pull/1278) (thanks @oupson)

## [0.72.1] - 2024-04-25

### Added

* [Show additional diagnostics specific to script files](https://github.com/ionide/FsAutoComplete/pull/1248) (thanks @TheAngryByrd)
* [Add some code fixes for type mismatch](https://github.com/ionide/FsAutoComplete/pull/1250) (thanks @nojaf)

### Fixed

* [Shift multiline paren contents less aggressively](https://github.com/ionide/FsAutoComplete/pull/1242) (thanks @brianrourkeboll)
* [fix unicode characters in F# compiler diagnostic messages](https://github.com/ionide/FsAutoComplete/pull/1265) (thanks @MrLuje)
* [Place XML doc lines before any attribute lists](https://github.com/ionide/FsAutoComplete/pull/1267) (thanks @dawedawe)
* [Don't generate params for explicit getters/setters](https://github.com/ionide/FsAutoComplete/pull/1268) (thanks @dawedawe)
* [Fix Nuget Script Restores when doing them in parallel](https://github.com/ionide/FsAutoComplete/pull/1275) (thanks @TheAngryByrd)

### Changed

* [Migrate Codefix Scaffolding](https://github.com/ionide/FsAutoComplete/pull/1256) (thanks @nojaf)
* [Bump ProjInfo to 0.64.0](https://github.com/ionide/FsAutoComplete/pull/1270) Check out the [release notes](https://github.com/ionide/proj-info/releases/tag/v0.64.0) for more details (thanks @baronfel)
* Fixes Loading Projects in some cases
* Adds Traversal Project support

## [0.71.0] - 2024-03-07

Expand Down
31 changes: 24 additions & 7 deletions src/FsAutoComplete.Core/CompilerServiceInterface.fs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ open Microsoft.Extensions.Caching.Memory
open System
open FsToolkit.ErrorHandling
open FSharp.Compiler.CodeAnalysis.ProjectSnapshot

open System.Threading

type Version = int

Expand Down Expand Up @@ -97,6 +97,10 @@ type FSharpCompilerServiceChecker(hasAnalyzers, typecheckCacheSize, parallelRefe

let entityCache = EntityCache()

// FCS can't seem to handle parallel project restores for script files
// https://github.com/ionide/ionide-vscode-fsharp/issues/2005
let scriptLocker = new SemaphoreSlim(1, 1)

// This is used to hold previous check results for autocompletion.
// We can't seem to rely on the checker for previous cached versions
let memoryCache () =
Expand Down Expand Up @@ -319,10 +323,16 @@ type FSharpCompilerServiceChecker(hasAnalyzers, typecheckCacheSize, parallelRefe
}

member self.GetProjectSnapshotsFromScript(file: string<LocalPath>, source, tfm: FSIRefs.TFM) =
match tfm with
| FSIRefs.TFM.NetFx -> self.GetNetFxScriptSnapshot(file, source)
| FSIRefs.TFM.NetCore -> self.GetNetCoreScriptSnapshot(file, source)
async {
try
do! scriptLocker.WaitAsync() |> Async.AwaitTask

match tfm with
| FSIRefs.TFM.NetFx -> return! self.GetNetFxScriptSnapshot(file, source)
| FSIRefs.TFM.NetCore -> return! self.GetNetCoreScriptSnapshot(file, source)
finally
scriptLocker.Release() |> ignore<int>
}


member private __.GetNetFxScriptOptions(file: string<LocalPath>, source) =
Expand Down Expand Up @@ -394,9 +404,16 @@ type FSharpCompilerServiceChecker(hasAnalyzers, typecheckCacheSize, parallelRefe
}

member self.GetProjectOptionsFromScript(file: string<LocalPath>, source, tfm) =
match tfm with
| FSIRefs.TFM.NetFx -> self.GetNetFxScriptOptions(file, source)
| FSIRefs.TFM.NetCore -> self.GetNetCoreScriptOptions(file, source)
async {
try
do! scriptLocker.WaitAsync() |> Async.AwaitTask

match tfm with
| FSIRefs.TFM.NetFx -> return! self.GetNetFxScriptOptions(file, source)
| FSIRefs.TFM.NetCore -> return! self.GetNetCoreScriptOptions(file, source)
finally
scriptLocker.Release() |> ignore<int>
}



Expand Down
9 changes: 3 additions & 6 deletions src/FsAutoComplete/LspServers/AdaptiveFSharpLspServer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -319,15 +319,12 @@ type AdaptiveFSharpLspServer
| None -> p.RootPath

let projs =
match p.RootPath, c.AutomaticWorkspaceInit with
match actualRootPath, c.AutomaticWorkspaceInit with
| None, _
| _, false -> state.WorkspacePaths
| Some actualRootPath, true ->
| Some rootPath, true ->
let peeks =
WorkspacePeek.peek
actualRootPath
c.WorkspaceModePeekDeepLevel
(c.ExcludeProjectDirectories |> List.ofArray)
WorkspacePeek.peek rootPath c.WorkspaceModePeekDeepLevel (c.ExcludeProjectDirectories |> List.ofArray)
|> List.map Workspace.mapInteresting
|> List.sortByDescending (fun x ->
match x with
Expand Down
Loading