ionide / FsAutoComplete

F# language server using Language Server Protocol
Other
409 stars 154 forks source link

Change location of symbolCache.db #912

Closed baronfel closed 2 years ago

baronfel commented 2 years ago

VSCode gives each extension a global and workspace-specific path to store state in the form of the following ExtensionContext properties:

We should update Ionide to flow those through as FSAC startup parameters, and FSAC should learn to take those as the location to store persistent state.

Nsidorenco commented 2 years ago

This change in #913 seem to have broken running the server on non-windows systems.

In particular, it creates a folder inside the current directory with a windows-style file path, which breaks the dotnet compiler.

Since the vscode plugin is supposed to inject the appropriate path at startup wouldn't it make sense to keep the default state directory as something working across systems (like .ionide as previously)?

baronfel commented 2 years ago

It does default to the current directory as the root, the problem is entirely in how we construct the path here: https://github.com/fsharp/FsAutoComplete/blob/main/src/FsAutoComplete.Core/SymbolCache.fs#L104

baronfel commented 2 years ago

This was released in 6.0.0 of ionide and 0.52.0 of FSAC.

baronfel commented 2 years ago

@Nsidorenco I'll put a PR up for this soon, and I've got a macos machine to test on now!

Nsidorenco commented 2 years ago

@baronfel That great to hear! I managed to work around it by setting the state-directory manually but it would be great to get the default fixed!