Skip to content

Conversation

@testforstephen
Copy link
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
Member

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

function resolveIndexCache(context: ExtensionContext) {
let sharedIndexLocation: string = getJavaConfiguration().get("sharedIndexes.location");
if (sharedIndexLocation === "$DEFAULT_CACHE") {
sharedIndexLocation = path.resolve(context.globalStoragePath, "index");
Copy link
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
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
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
Copy link
Collaborator

fbricon commented Nov 30, 2022

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

export function getSharedIndexCache(): string {
let location: string = getJavaConfiguration().get("sharedIndexes.location");
if (!location) {
switch (process.platform) {
Copy link
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
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.

@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