Closed TheGoddessInari closed 3 years ago
Looks like it's related to background caching unconditionally invoking FsAutoComplete.
Examining FsAutoComplete, it seems to create the directory unconditionally when starting its persistent state, so probably the error is possibly invoking FsAutoComplete in situations with no F# projects or data.
Source code probably needs to be combed over to ensure that nothing will start up FsAutoComplete inappropriately or unconditionally.
Can't reproduce on latest Ionide and VSCode.
I've (very recently, since you closed this, and, I think, for the first time) started getting this unwanted behaviour too, seemingly on all my projects, none of which have anything to do with F#. I'm on VS Code 1.35.1 and Ionide-fsharp 4.0.0, so I'm guessing the latter has (re-)introduced this behaviour. Hope that helps...
This is happening to me as well, I wonder if this should be reopened.
Happening here too. Ionide 4.0.5 on VS Code 1.36.1.
Same here I've had to disable ionide when not using F#
I've seen it quite a few times in projects without any F# or .Net but I don't have a good repro, need ot investigate.
There's clearly something fishy.
I also get this all the time when working on .NET documentation such as https://github.com/dotnet/docs
We have following activation events (https://github.com/ionide/ionide-vscode-fsharp/blob/master/release/package.json#L1596-L1607):
"activationEvents": [
"workspaceContains:**/*.fs",
"workspaceContains:**/*.fsx",
"workspaceContains:**/*.fsproj",
"workspaceContains:**/*.sln",
"onLanguage:fsharp",
"onCommand:fsi.Start",
"onCommand:fsharp.NewProject",
"onCommand:fsharp.NewProjectNoFake",
"onCommand:fsharp.NewProjectScaffold",
"onCommand:fsharp.RefreshProjectTemplates"
],
As far as I understand - if neither of that is hit, the extension shouldn't start. We create .ionide
folder on startup of FSAC - so it shouldn't be created if the extension doesn't start.
TBF, I'm bit confused how it may happen on non-.Net repositories.
Hey @Tyriar could you point me at someone from Team who could help us with that?
We do have fsharp snippets inside the content. Maybe that triggers this?
@mairaw, if snippets are in separate .fs
or .fsx
files, then yes, that would trigger extension activation. If snippets are just inlined in markdown, I wouldn't expect it to trigger activation.
@Krzysztof-Cieslak Are you saying that if any of those conditions are met, then .ionide/
is created?
If so, then surely any VS-style solution (for, say a C# solution/project) will create the folder... and indeed I have noticed that any VS-style (C#, non-F#) solution (with a .sln
file) will trigger the behaviour.
PS I'd suggest (anyway) not using file extensions as indicators of anything; a given sequence of a couple of characters could have many meanings! Much better to rely on explicit setting of language mode etc., as you do later on in your array of events...
@Krzysztof-Cieslak nope, no solution files, no .fs
, .fsx
or .fsproj
files. Just inline snippets inside Markdown.
Much better to rely on explicit setting of language mode etc., as you do later on in your array of events...
This is not acceptable as only activation condition in project file based IDE.
@Krzysztof-Cieslak Sure understood (and I expect the .fs*
extensions are actually sane/safe choices anyway).
... but please do consider removing the *.sln
line in your snippet above; at the moment it seems you categorise any VS solution as an F# project, which is obviously not right anyway (and does explain a lot of the 'false positives' I've seen in my projects). I doubt that would adversely affect your F# detection, and would hugely reduce the number of false positives. Many thanks!
Hey @Tyriar could you point me at someone from Team who could help us with that?
Your understanding is right, it shouldn't run code unless one of the activation events is hit.
@mjbvz do markdown snippets activate language extensions?
but please do consider removing the *.sln line in your snippet above; at the moment it seems you categorise any VS solution as an F# project, which is obviously not right anyway
This seems like a good idea, ionide would activate for any C# or VB.NET project otherwise, no?
Fair enough, *.sln
may be problematic for C#/VB.NET. But it still doesn't explain why it's happening on, for example, Rust project - as in original bug report from @TheGoddessInari
Or in @mairaw case with https://github.com/dotnet/docs
As previously mentioned (back in March), FsAutoComplete creates an .ionide
directory unconditionally as part of making a symbol cache. It happens inappropriately, and why this has remained unaddressed, I don't know.
It's really bad to potentially get an .ionide
directory anywhere that you open vscode to.
It's happening in places where there exist none of the files cited for activation.
It probably comes down to needing a specific case to start creating files instead of assuming the user wants them. Even if F# language support is getting activated more often than it should, it's still making these folders in arbitrary projects/directories that have little or nothing to do with F#.
The approach Visual Studio and others seem to use is making the cache per-user rather than per-directory.
I am also getting this behaviour for C# projects that contain a solution file (.Sln). I've been adding .ionide/
to the .gitignore
file for now as a workaround to ensure I don't accidentally commit it to the repository since I'm the only person who uses F# (for personal stuff). It's a little invasive, but my coworkers prefer the entry in the ignore file over the folder in the repository.
It seems to be difficult to reproduce, right?
May I suggest a work around, if it is relevant and the design permits? As I mentioned in #1278 the produced SQLite table is empty. Is it possible to check for "no symbols" before creating this table and avoid its creation?
That's a great idea, although it seems to be odd that it could be difficult to reproduce. It happens 100% of the time here, in every directory regardless of contents. In the code, that's exactly how it's written.
At one point, I was experiencing this issue 100% of the time, like @TheGoddessInari reports. Now it seems to happen only occasionally. However, the following reliably causes the issue for me:
Steps to reproduce
I've tried this on two machines. In both cases, the .ionide
folder is created, even though the directory is empty.
Machine 1
Machine 2
I have found a workspace with stable reproduction of the issue on my two machines.
As a result the directory .ionide is created. (The workspace does not have any F# related files.)
It’s .Net project so I assume it has .sln
file. As stated before in the thread presence of .sln
file is one of the activation events of the plugin
I see, it is by design that .sln
triggers Ionide activation and creation of ionide temp files even if .sln
is not related to F#.
I have the same problem.
Since it triggers on .fs*
extensions, could it be that it triggers on this too?
node_modules\karma\node_modules\core-js\library\modules\es7.math.fscale.js
(note .fscale.js
here)
BTW one common source for me of that is updates, vscode seem to run extensions after they update (Maybe also after it update itself) and ionide take that as a signal that it should create the directory in the current workspace... not always a good idea.
Disabling this extension until this is fixed :(
If the extension loads because of the presence of .sln
files, then it should also check that there is at least 1 .fs*
file before doing anything else. sln
files are common for C# projects etc so the extension should not be doing unnecessary work.
I opened an empty folder to start a brand new, from scratch ReactJS project! And an .ionide
folder was created with the aforementioned symbolCache.db
file inside. Again, an empty folder.
I agree with many other commenters here (even though this is not the cause in the case of an empty folder): the presences of a .sln
file should not cause this directory to get created. Now, the presence of a .fs*
file in the vscode folder hierarchy....sure. That makes sense.
Missed the annotation directly above my comment that the .sln
issue has been resolved. But still, the .ionide
folder is created even when opening an otherwise empty directory in vscode.
BTW, I've been seeing this behavior ever since I installed this extension including this functionality. Every single folder--100% of the time. It doesn't matter what I'm working on. This folder is created.
I'm still facing this problem. Opening C# .NET Core project in vscode regularly creates the .ionide folder and loads the ionide extension. I have to manually delete the .ionide folder.
Is there any update on potential fix? Tempted to disable extension, but would prefer not to have to. Cheers!
Those who are waiting for a fix to the extension activating and creating files on non-F# .NET projects shouldn't hold their breath, the maintainer seems unwilling to correct this behavior as seen in #1401 and #1439 despite calling it "problematic" earlier in this thread.
@olivercoad ^^Yes please to a fix that will resolve this issue! Consider me an F# interloper, but if Ionide is active it puts this directory in strange places. Off the top of my head, this has included a Ruby project.
I'm also seeing this on C# solutions using the latest ionide and vs code. The thing with sln files being included in the activation criteria was mentioned over a year ago and yet it is still there. The presence of an sln file is not a positive indicator of an F# project. When can we get that removed?
C:\Users\dz.vscode\extensions\ionide.ionide-fsharp-4.17.0 remove .sln here or on similar path on windows.
Still have this problem on react-project
@Fi1osof Do you have steps to repro?
@olivercoad , sorry, no. I got this again, but after close and reopen VSCODE all fine again...
Problem
If you open a folder, an
.ionide
directory is required for the symbol cache, even if there's no F# files, no project files, no intent to use F# , and hence no symbols to save. I'm not certain what triggers this, I'm seeing this on some things but not others. I always get an.ionide
folder with https://github.com/servo/servo.Steps to reproduce
.ionide
folder is created because of symbol cache.Machine infos