change test config storage path from extension folder to storage folder#159
change test config storage path from extension folder to storage folder#159ansyral merged 4 commits intomicrosoft:masterfrom
Conversation
extension/src/testConfigManager.ts
Outdated
| constructor(private readonly _configPath: string, private readonly _projectManager: ProjectManager) { | ||
| private readonly _configPath: string; | ||
| constructor(storagePath: string, private readonly _projectManager: ProjectManager) { | ||
| this._configPath = path.join(storagePath, 'configs', Configs.TEST_LAUNCH_CONFIG_NAME); |
There was a problem hiding this comment.
If make this config file locate at the project specific user folder, how can user make changes to this file?
There was a problem hiding this comment.
we provide command Java: Edit Test Configuration for user to open config, but this is a good suggestion, I would move the config to .vscode folder where user could directly access it.
yaohaizh
left a comment
There was a problem hiding this comment.
Why change the location of configuration file?
Signed-off-by: xuzho <xuzho@microsoft.com>
Signed-off-by: xuzho <xuzho@microsoft.com>
…uration Signed-off-by: xuzho <xuzho@microsoft.com>
extension/src/extension.ts
Outdated
| try { | ||
| config = await configManager.loadConfig(); | ||
| } catch (ex) { | ||
| window.showErrorMessage('Failed to load test config! Please check whether your test configuration is a valid JSON file'); |
There was a problem hiding this comment.
the test config. Same below
| if (!workspaceFolders) { | ||
| throw new Error('Not supported without a folder!'); | ||
| } | ||
| this._configPath = path.join(workspaceFolders[0].uri.fsPath, '.vscode', Configs.TEST_LAUNCH_CONFIG_NAME); |
There was a problem hiding this comment.
How about multiple root scenario? Always pick up the first one?
There was a problem hiding this comment.
yes , I would always store it in the first one considering the config for different projects are merged in one config
| private createTestConfigIfNotExisted(): Promise<void> { | ||
| return new Promise((resolve, reject) => { | ||
| mkdirp(path.dirname(this._configPath), (merr) => { | ||
| if (merr && merr.code !== 'EEXIST') { |
There was a problem hiding this comment.
Storage path should be File path ?
Signed-off-by: xuzho <xuzho@microsoft.com>
Signed-off-by: xuzho xuzho@microsoft.com
to fix #154 #153