Closed NickGuyver closed 3 weeks ago
This change would break all backwards compatibility as that string is searched for to detect a pico-vscode project, and the header is also specified in pico_platform.py so would need to be changed there too. Could you modify this PR to address those concerns?
PR modified as requested.
Actually one more change is needed in
extension.mts
, else it won't detect older projects as pico projects - this diff would workdiff --git a/src/extension.mts b/src/extension.mts index 15b2b76..83f276e 100644 --- a/src/extension.mts +++ b/src/extension.mts @@ -16,6 +16,7 @@ import NewProjectCommand from "./commands/newProject.mjs"; import Logger, { LoggerSource } from "./logger.mjs"; import { CMAKE_DO_NOT_EDIT_HEADER_PREFIX, + CMAKE_DO_NOT_EDIT_HEADER_PREFIX_OLD, cmakeGetSelectedBoard, cmakeGetSelectedToolchainAndSDKVersions, configureCmakeNinja, @@ -209,9 +210,14 @@ export async function activate(context: ExtensionContext): Promise<void> { // check if it has .vscode folder and cmake donotedit header in CMakelists.txt if ( !existsSync(join(workspaceFolder.uri.fsPath, ".vscode")) || - !readFileSync(cmakeListsFilePath) - .toString("utf-8") - .includes(CMAKE_DO_NOT_EDIT_HEADER_PREFIX) + !( + readFileSync(cmakeListsFilePath) + .toString("utf-8") + .includes(CMAKE_DO_NOT_EDIT_HEADER_PREFIX) || + readFileSync(cmakeListsFilePath) + .toString("utf-8") + .includes(CMAKE_DO_NOT_EDIT_HEADER_PREFIX_OLD) + ) ) { Logger.warn( LoggerSource.extension,
With this fix I've tested and am happy to merge this PR
Fix applied, thank you.
This change would break all backwards compatibility as that string is searched for to detect a pico-vscode project, and the header is also specified in pico_platform.py so would need to be changed there too. Could you modify this PR to address those concerns?