Skip to content

Commit 38f1a66

Browse files
authored
1 parent dccdcf7 commit 38f1a66

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/vs/workbench/api/common/extHostConfiguration.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,9 @@ export class ExtHostConfigProvider {
236236
}
237237
});
238238
}
239+
if (Array.isArray(target)) {
240+
return deepClone(target);
241+
}
239242
return target;
240243
};
241244
result = cloneOnWriteProxy(result, key);

src/vs/workbench/api/test/browser/extHostConfiguration.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,16 @@ suite('ExtHostConfiguration', function () {
771771
testObject.$acceptConfigurationChanged(newConfigData, configEventData);
772772
});
773773

774+
test('get return instance of array value', function () {
775+
const testObject = createExtHostConfiguration({ 'far': { 'boo': [] } });
776+
777+
const value: string[] = testObject.getConfiguration().get('far.boo', []);
778+
value.push('a');
779+
780+
const actual = testObject.getConfiguration().get('far.boo', []);
781+
assert.deepStrictEqual(actual, []);
782+
});
783+
774784
function aWorkspaceFolder(uri: URI, index: number, name: string = ''): IWorkspaceFolder {
775785
return new WorkspaceFolder({ uri, name, index });
776786
}

0 commit comments

Comments
 (0)