Added user home inplace replacement in configs

This commit is contained in:
itdominator 2024-09-28 22:48:40 -05:00
parent 135304cedc
commit 96abe163a5
3 changed files with 32 additions and 9 deletions

View File

@ -107,13 +107,15 @@ class SettingsManager(StartCheckMixin, Singleton):
try: try:
with open(self._LSP_CONFIG) as file: with open(self._LSP_CONFIG) as file:
self._lsp_config_data = json.load(file) data = file.read().replace("{user.home}", self.get_home_path())
self._lsp_config_data = json.loads(data)
except Exception as e: except Exception as e:
print( f"Settings Manager: {self._LSP_CONFIG}\n\t\t{repr(e)}" ) print( f"Settings Manager: {self._LSP_CONFIG}\n\t\t{repr(e)}" )
try: try:
with open(self._LSP_INIT_CONFIG) as file: with open(self._LSP_INIT_CONFIG) as file:
self._lsp_init_data = json.load(file) data = file.read().replace("{user.home}", self.get_home_path())
self._lsp_init_data = json.loads(data)
except Exception as e: except Exception as e:
print( f"Settings Manager: {self._LSP_INIT_CONFIG}\n\t\t{repr(e)}" ) print( f"Settings Manager: {self._LSP_INIT_CONFIG}\n\t\t{repr(e)}" )
@ -212,4 +214,4 @@ class SettingsManager(StartCheckMixin, Singleton):
def save_settings(self): def save_settings(self):
with open(self._CONFIG_FILE, 'w') as outfile: with open(self._CONFIG_FILE, 'w') as outfile:
json.dump(self.settings.as_dict(), outfile, separators=(',', ':'), indent=4) json.dump(self.settings.as_dict(), outfile, separators=(',', ':'), indent=4)

View File

@ -148,4 +148,4 @@
}, },
"trace": "verbose", "trace": "verbose",
"workspaceFolders": "[\n {\n \"uri\": pathlib.Path(repository_absolute_path).as_uri(),\n \"name\": os.path.basename(repository_absolute_path),\n }\n ]" "workspaceFolders": "[\n {\n \"uri\": pathlib.Path(repository_absolute_path).as_uri(),\n \"name\": os.path.basename(repository_absolute_path),\n }\n ]"
} }

View File

@ -1,6 +1,7 @@
{ {
"java": { "java": {
"info": "https://download.eclipse.org/jdtls/", "info": "https://download.eclipse.org/jdtls/",
"info-init-options": "https://github.com/eclipse-jdtls/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line",
"link": "https://download.eclipse.org/jdtls/milestones/?d", "link": "https://download.eclipse.org/jdtls/milestones/?d",
"command": "lsp-ws-proxy --listen 4114 -- jdtls", "command": "lsp-ws-proxy --listen 4114 -- jdtls",
"alt-command": "lsp-ws-proxy -- jdtls", "alt-command": "lsp-ws-proxy -- jdtls",
@ -17,11 +18,31 @@
], ],
"settings": { "settings": {
"java": { "java": {
"autobuild": {
"enabled": false
},
"completion": {
"enabled": true,
"importOrder": [
"java",
"javax",
"org",
"com"
]
},
"configuration": {
"maven": {
"userSettings": "{user.home}/.config/jdtls/settings.xml",
"globalSettings": "{user.home}/.config/jdtls/settings.xml"
},
"runtimes": [
]
},
"classPath": [ "classPath": [
"~/.m2/repository/**/*.jar" "{user.home}/.config/jdtls/m2/repository/**/*.jar"
], ],
"docPath": [ "docPath": [
"~/.m2/repository/**/*.jar" "{user.home}/.config/jdtls/m2/repository/**/*.jar"
], ],
"silentNotification": true, "silentNotification": true,
"project": { "project": {
@ -176,7 +197,7 @@
}, },
"jedi":{ "jedi":{
"extra_paths": [ "extra_paths": [
"/home/abaddon/Portable_Apps/py-venvs/pylsp-venv/venv/lib/python3.10/site-packages" "{user.home}/Portable_Apps/py-venvs/pylsp-venv/venv/lib/python3.10/site-packages"
], ],
"root_dir": "" "root_dir": ""
} }
@ -204,9 +225,9 @@
"markupKindPreferred": "markdown", "markupKindPreferred": "markdown",
"workspace": { "workspace": {
"extraPaths": [ "extraPaths": [
"/home/abaddon/Portable_Apps/py-venvs/pylsp-venv/venv/lib/python3.10/site-packages" "{user.home}/Portable_Apps/py-venvs/pylsp-venv/venv/lib/python3.10/site-packages"
], ],
"environmentPath": "/home/abaddon/Portable_Apps/py-venvs/gtk-apps-venv/venv/bin/python", "environmentPath": "{user.home}/Portable_Apps/py-venvs/gtk-apps-venv/venv/bin/python",
"symbols": { "symbols": {
"ignoreFolders": [".nox", ".tox", ".venv", "__pycache__", "venv"], "ignoreFolders": [".nox", ".tox", ".venv", "__pycache__", "venv"],
"maxSymbols": 20 "maxSymbols": 20