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

Optionally pass a --storage-directory argument to the LSP server #167

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

nberth
Copy link
Collaborator

@nberth nberth commented Feb 6, 2024

This change avoids creating a _superbol folder in each project's root directory. A storage space provided by the client is used instead.

For now, the "global" storage space provided by VS Code for the extension is used. It is unclear (/ I did not search for) who is responsible for cleaning that space (or the local storage).

@nberth nberth added enhancement New feature or request ok to review As its name says labels Feb 6, 2024
@nberth
Copy link
Collaborator Author

nberth commented Feb 7, 2024

Actually, just found out we don't have a "simple" way of dealing with the cleanup problem by only relying on VS Code (cf microsoft/vscode#32461).

Temporary solution: do not merge this and continue relying on a _superbol sub-folder at the root of the project.

Later: use the extension context's globalState to store an association list of workspace/project directoriescache storage directories, and implement a basic cleanup strategy upon activation/deactivation.

@nberth nberth marked this pull request as draft February 7, 2024 10:32
@engboris
Copy link
Contributor

engboris commented Feb 7, 2024

Can you explain why you use ExtensionContext.globalStorageUri instead of ExtensionContext.storageUri? I see you have a comment about it but maybe I'm missing some subtlety.

Do you expect the storage to be accessible from all workspaces?

@nberth nberth removed the ok to review As its name says label Feb 7, 2024
@nberth
Copy link
Collaborator Author

nberth commented Feb 7, 2024

Can you explain why you use ExtensionContext.globalStorageUri instead of ExtensionContext.storageUri? I see you have a comment about it but maybe I'm missing some subtlety.

Do you expect the storage to be accessible from all workspaces?

Yes. We store a cache on a per-project directory basis, not per-workspace. So, it could be relevant to reload a project from the same cache even if that's from two distinct workspaces (especially if the configurations match, which is likely if projects have a superbol.toml).

However, as I noted in the previous comment, we have no "simple" way of cleaning caches. And apparently, this problem would also arise if we were to use workspace-storage instead.

@nberth nberth linked an issue Mar 4, 2024 that may be closed by this pull request
@nberth nberth force-pushed the using-vscode-provided-storage branch from 8f0b09b to 5303679 Compare July 30, 2024 14:48
@nberth nberth marked this pull request as ready for review July 30, 2024 14:49
@nberth nberth changed the title Pass a --storage-directory argument to the LSP server Optionally pass a --storage-directory argument to the LSP server Jul 30, 2024
@nberth nberth force-pushed the using-vscode-provided-storage branch 3 times, most recently from 362b57b to 9963311 Compare July 30, 2024 15:37
This change avoids creating a `_superbol` folder in each project's
root directory.  When configuration flag
`superbol.cacheInGlobalStorage` is set, a storage space provided by
the Visual Studio Code is used instead.
@nberth nberth force-pushed the using-vscode-provided-storage branch from 9963311 to 3993ece Compare July 30, 2024 15:55
@nberth nberth merged commit d155fae into OCamlPro:master Jul 30, 2024
4 checks passed
@nberth nberth deleted the using-vscode-provided-storage branch July 30, 2024 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider ExtensionContext.storageUri for private data
3 participants