Skip to content

Share indexes among workspaces#2811

Merged
rgrunber merged 5 commits into
redhat-developer:masterfrom
testforstephen:jinbo_index
Jan 16, 2023
Merged

Share indexes among workspaces#2811
rgrunber merged 5 commits into
redhat-developer:masterfrom
testforstephen:jinbo_index

Conversation

@testforstephen

Copy link
Copy Markdown
Collaborator

Requires eclipse-jdtls/eclipse.jdt.ls#2341

Provide a setting to control the shared index location, by default, it uses the global extension cache as the common index location.

@rgrunber

Copy link
Copy Markdown
Member

If it makes sense, this should probably close out #2723 .

Comment thread src/javaServerStarter.ts Outdated
function resolveIndexCache(context: ExtensionContext) {
let sharedIndexLocation: string = getJavaConfiguration().get("sharedIndexes.location");
if (sharedIndexLocation === "$DEFAULT_CACHE") {
sharedIndexLocation = path.resolve(context.globalStoragePath, "index");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

globalStoragePath is deprecated. Maybe consider using globalStorageUri and get the path only when the scheme is file?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is outdated. we have changed it to some OS specific cache directory.

@testforstephen

Copy link
Copy Markdown
Collaborator Author

Comments:

  • Verify how to regenerate index when the library contents has changed but file path doesn't change
  • Default cache location: something like /Users/name/.cache/redhat.java/index
  • Provide a command to cleanup everything in the shared index location

@fbricon

fbricon commented Nov 30, 2022

Copy link
Copy Markdown
Collaborator

I've seen general pushback to using the user home directory to store cache data. Instead, look into using OS specific cache directories, eg. ~/Library/Caches on MacOS

Comment thread src/javaServerStarter.ts
export function getSharedIndexCache(): string {
let location: string = getJavaConfiguration().get("sharedIndexes.location");
if (!location) {
switch (process.platform) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason you abandoned the use of context.globalStorageUri ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In our last sync-up meeting, one comment is to save the index into the OS specific cache directory, some place like what Gradle does. That's why I changed the cache from the global storage location to some OS specific directory.

Comment thread package.json
Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
@rgrunber
rgrunber merged commit 33f5b9c into redhat-developer:master Jan 16, 2023
@testforstephen
testforstephen deleted the jinbo_index branch January 17, 2023 01:59
@rgrunber rgrunber added this to the Early January 2023 milestone Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants