ionide / ionide-vscode-fsharp

VS Code plugin for F# development
http://ionide.io
MIT License
850 stars 276 forks source link

If you do not have access to some files in the workspace, Ionide will crash #1944

Open njlr opened 9 months ago

njlr commented 9 months ago

Describe the bug

If you do not have access to some files in the workspace, Ionide will crash

Steps to reproduce

  1. Create a folder in the project folder
  2. Revoke access to that folder
  3. Open Ionide
System.AggregateException: One or more errors occurred. (Access to the path '/home/runner/project/testing/bar.txt' is denied.)
 ---> System.UnauthorizedAccessException: Access to the path '/home/runner/project/testing/bar.txt' is denied.
 ---> System.IO.IOException: Permission denied
   --- End of inner exception stack trace ---
   at System.IO.FileStatus.ThrowOnCacheInitializationError(ReadOnlySpan`1 path)
   at System.IO.FileSystemInfo.Create(String fullPath, String fileName, Boolean asDirectory, FileStatus& fileStatus)
   at System.IO.Enumeration.FileSystemEnumerableFactory.<>c.<FileInfos>b__5_0(FileSystemEntry& entry)
   at System.IO.Enumeration.FileSystemEnumerator`1.MoveNext()
   at Microsoft.FSharp.Collections.Internal.IEnumerator.choose@240.System.Collections.IEnumerator.MoveNext() in D:\a\_work\1\s\src\FSharp.Core\seq.fs:line 251
   at Microsoft.FSharp.Collections.SeqModule.ToArray[T](IEnumerable`1 source) in D:\a\_work\1\s\src\FSharp.Core\seq.fs:line 1027
   at Microsoft.FSharp.Collections.ArrayModule.Parallel.Collect@2047-1.Invoke(Int32 i) in D:\a\_work\1\s\src\FSharp.Core\array.fs:line 2047
   at System.Threading.Tasks.Parallel.<>c__DisplayClass19_0`1.<ForWorker>b__1(RangeWorker& currentWorker, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion)

Expected behaviour

It should ignore files it cannot access

Machine info

baronfel commented 9 months ago

could you give some more of the FSAC logs (in the "F#" output pane in VSCode) here? We can see the stack trace but none of the stack frames point to which method or function in FSAC is throwing here.