Skip to content

Commit c2ee759

Browse files
authored
Add task to clear JDTLS cache in Java configuration (#181)
1 parent 8173dd7 commit c2ee759

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

languages/java/tasks.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,17 @@
4949
"args": ["-c"]
5050
}
5151
}
52+
},
53+
{
54+
"label": "Clear JDTLS cache",
55+
"command": "cache_dir=\"\"; if [ -n \"$XDG_CACHE_HOME\" ]; then cache_dir=\"$XDG_CACHE_HOME\"; elif [ \"$(uname)\" = \"Darwin\" ]; then cache_dir=\"$HOME/Library/Caches\"; else cache_dir=\"$HOME/.cache\"; fi; found=$(find \"$cache_dir\" -maxdepth 1 -type d -name 'jdtls-*' 2>/dev/null); if [ -n \"$found\" ]; then echo \"$found\" | xargs rm -rf && echo 'JDTLS cache cleared. Restart the language server'; else echo 'No JDTLS cache found'; fi",
56+
"use_new_terminal": false,
57+
"reveal": "always",
58+
"shell": {
59+
"with_arguments": {
60+
"program": "/bin/sh",
61+
"args": ["-c"]
62+
}
63+
}
5264
}
5365
]

0 commit comments

Comments
 (0)