ensure we take deep copy of presets for presetsPlusIncluded (#3939)

This commit is contained in:
Garrett Campbell 2024-07-26 12:47:49 -04:00 коммит произвёл GitHub
Родитель 2be0df4591
Коммит 4dc3817666
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
3 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

@ -3702,6 +3702,7 @@
"@types/chai-string": "^1.4.2",
"@types/js-yaml": "^4.0.0",
"@types/json5": "~0.0.30",
"@types/lodash": "4.14.202",
"@types/mocha": "^8.2.2",
"@types/node": "~14.14.28",
"@types/rimraf": "^3.0.0",
@ -3768,7 +3769,8 @@
"vscode-tas-client": "^0.1.45",
"which": "~2.0.2",
"xml2js": "^0.4.23",
"uuid": "~8.3.2"
"uuid": "~8.3.2",
"lodash": "^4.17.21"
},
"resolutions": {
"ansi-regex": "^5.0.1",

Просмотреть файл

@ -2,6 +2,7 @@ import * as chokidar from 'chokidar';
import * as path from 'path';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
import * as lodash from "lodash";
import { CMakeProject, ConfigureTrigger, ConfigureType } from '@cmt/cmakeProject';
import * as logging from '@cmt/logging';
@ -187,8 +188,9 @@ export class PresetsController {
this.populatePrivatePresetsFields(presetsFile, file);
await this.mergeIncludeFiles(presetsFile, presetsFile, file, referencedFiles);
const copyOfPresetsFile = lodash.cloneDeep(presetsFile);
// add the include files to the original presets file
setPresetsPlusIncluded(this.folderPath, {...presetsFile});
setPresetsPlusIncluded(this.folderPath, copyOfPresetsFile);
// set the pre-expanded version so we can call expandPresetsFile on it
setExpandedPresets(this.folderPath, presetsFile);

Просмотреть файл

@ -446,6 +446,11 @@
resolved "https://registry.npmjs.org/@types/json5/-/json5-0.0.30.tgz"
integrity sha512-sqm9g7mHlPY/43fcSNrCYfOeX9zkTTK+euO5E6+CVijSMm5tTjkVdwdqRkY3ljjIAf8679vps5jKUoJBCLsMDA==
"@types/lodash@4.14.202":
version "4.14.202"
resolved "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.202.tgz#f09dbd2fb082d507178b2f2a5c7e74bd72ff98f8"
integrity sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==
"@types/minimatch@*", "@types/minimatch@^3.0.3":
version "3.0.5"
resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz"