Added user home inplace replacement in configs

This commit is contained in:
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:
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:
print( f"Settings Manager: {self._LSP_CONFIG}\n\t\t{repr(e)}" )
try:
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:
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):
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)