Skip to content

Commit

Permalink
feat: support customization of configuration area for customer applic…
Browse files Browse the repository at this point in the history
…ation

fixes eclipse-theia#14318

Contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <[email protected]>
  • Loading branch information
rschnekenbu committed Oct 15, 2024
1 parent c7fb4f5 commit 6ebe772
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

- [Previous Changelogs](https://github.com/eclipse-theia/theia/tree/master/doc/changelogs/)

## 1.55.0 - not yet release

- [application-package] feat: provide an application prop to set the configuration area [#14319](https://github.com/eclipse-theia/theia/pull/14319) - Contributed on behalf of STMicroelectronics

## 1.54.0 - 09/26/2024

- [ai] add Theia AI LLM Support [Experimental] [#14048](https://github.com/eclipse-theia/theia/pull/14048)
Expand Down
10 changes: 9 additions & 1 deletion dev-packages/application-package/src/application-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ export type BackendApplicationConfig = RequiredRecursive<BackendApplicationConfi
export namespace BackendApplicationConfig {
export const DEFAULT: BackendApplicationConfig = {
singleInstance: true,
frontendConnectionTimeout: 0
frontendConnectionTimeout: 0,
configurationFolder: '.theia'
};
export interface Partial extends ApplicationConfig {

Expand All @@ -206,6 +207,13 @@ export namespace BackendApplicationConfig {
* The time in ms the connection context will be preserved for reconnection after a front end disconnects.
*/
readonly frontendConnectionTimeout?: number;

/**
* Configuration folder within the home user folder
*
* Defaults to `.theia`
*/
readonly configurationFolder?: string;
}
}

Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/node/env-variables/env-variables-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { EnvVariable, EnvVariablesServer } from '../../common/env-variables';
import { isWindows } from '../../common/os';
import { FileUri } from '../../common/file-uri';
import { BackendApplicationPath } from '../backend-application';
import { BackendApplicationConfigProvider } from '../backend-application-config-provider';

@injectable()
export class EnvVariablesServerImpl implements EnvVariablesServer {
Expand Down Expand Up @@ -64,7 +65,7 @@ export class EnvVariablesServerImpl implements EnvVariablesServer {
this.pathExistenceCache[userDataPath] = true;
}
} else {
process.env.THEIA_CONFIG_DIR = join(homedir(), '.theia');
process.env.THEIA_CONFIG_DIR = join(homedir(), BackendApplicationConfigProvider.get().configurationFolder);
}
return FileUri.create(process.env.THEIA_CONFIG_DIR).toString();
}
Expand Down

0 comments on commit 6ebe772

Please sign in to comment.