提交 13ee7599 编写于 作者: S Sandeep Somavarapu

Fix #42300

上级 93aac9fa
......@@ -125,8 +125,13 @@ export class WorkspaceConfiguration extends Disposable {
}
function isFolderConfigurationFile(resource: URI): boolean {
const name = resources.basename(resource);
return [`${FOLDER_SETTINGS_NAME}.json`, `${TASKS_CONFIGURATION_KEY}.json`, `${LAUNCH_CONFIGURATION_KEY}.json`].some(p => p === name);// only workspace config files
const configurationNameResource = URI.from({ scheme: resource.scheme, path: resources.basename(resource) });
return [`${FOLDER_SETTINGS_NAME}.json`, `${TASKS_CONFIGURATION_KEY}.json`, `${LAUNCH_CONFIGURATION_KEY}.json`].some(configurationFileName =>
resources.isEqual(configurationNameResource, URI.from({ scheme: resource.scheme, path: configurationFileName }))); // only workspace config files
}
function isFolderSettingsConfigurationFile(resource: URI): boolean {
return resources.isEqual(URI.from({ scheme: resource.scheme, path: resources.basename(resource) }), URI.from({ scheme: resource.scheme, path: `${FOLDER_SETTINGS_NAME}.json` }));
}
export interface IFolderConfiguration {
......@@ -193,10 +198,10 @@ export abstract class AbstractFolderConfiguration extends Disposable implements
private parseContents(contents: { resource: URI, value: string }[]): void {
for (const content of contents) {
const name = resources.basename(content.resource);
if (name === `${FOLDER_SETTINGS_NAME}.json`) {
if (isFolderSettingsConfigurationFile(content.resource)) {
this._folderSettingsModelParser.parse(content.value);
} else {
const name = resources.basename(content.resource);
const matches = /([^\.]*)*\.json/.exec(name);
if (matches && matches[1]) {
const standAloneConfigurationModelParser = new StandaloneConfigurationModelParser(content.resource.toString(), matches[1]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册