File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -583,9 +583,9 @@ def GenerateCMake(folder, params):
583583 "# (note this can come from environment, CMake cache etc)\n \n "
584584 )
585585
586- # if you change the do never edit headline you need to change the check for it in extension.mts
586+ # if you change the do not edit headline you need to change the check for it in extension.mts
587587 cmake_header_us = (
588- "# == DO NEVER EDIT THE NEXT LINES for Raspberry Pi Pico VS Code Extension to work ==\n "
588+ "# == DO NOT EDIT THE FOLLOWING LINES for the Raspberry Pi Pico VS Code Extension to work ==\n "
589589 "if(WIN32)\n "
590590 " set(USERHOME $ENV{USERPROFILE})\n "
591591 "else()\n "
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import NewProjectCommand from "./commands/newProject.mjs";
1616import Logger , { LoggerSource } from "./logger.mjs" ;
1717import {
1818 CMAKE_DO_NOT_EDIT_HEADER_PREFIX ,
19+ CMAKE_DO_NOT_EDIT_HEADER_PREFIX_OLD ,
1920 cmakeGetSelectedBoard ,
2021 cmakeGetSelectedToolchainAndSDKVersions ,
2122 configureCmakeNinja ,
@@ -209,9 +210,14 @@ export async function activate(context: ExtensionContext): Promise<void> {
209210 // check if it has .vscode folder and cmake donotedit header in CMakelists.txt
210211 if (
211212 ! existsSync ( join ( workspaceFolder . uri . fsPath , ".vscode" ) ) ||
212- ! readFileSync ( cmakeListsFilePath )
213- . toString ( "utf-8" )
214- . includes ( CMAKE_DO_NOT_EDIT_HEADER_PREFIX )
213+ ! (
214+ readFileSync ( cmakeListsFilePath )
215+ . toString ( "utf-8" )
216+ . includes ( CMAKE_DO_NOT_EDIT_HEADER_PREFIX ) ||
217+ readFileSync ( cmakeListsFilePath )
218+ . toString ( "utf-8" )
219+ . includes ( CMAKE_DO_NOT_EDIT_HEADER_PREFIX_OLD )
220+ )
215221 ) {
216222 Logger . warn (
217223 LoggerSource . extension ,
Original file line number Diff line number Diff line change @@ -15,6 +15,9 @@ import { buildCMakeIncPath } from "./download.mjs";
1515
1616export const CMAKE_DO_NOT_EDIT_HEADER_PREFIX =
1717 // eslint-disable-next-line max-len
18+ "== DO NOT EDIT THE FOLLOWING LINES for the Raspberry Pi Pico VS Code Extension to work ==" ;
19+ export const CMAKE_DO_NOT_EDIT_HEADER_PREFIX_OLD =
20+ // eslint-disable-next-line max-len
1821 "== DO NEVER EDIT THE NEXT LINES for Raspberry Pi Pico VS Code Extension to work ==" ;
1922
2023export async function getPythonPath ( ) : Promise < string > {
@@ -322,7 +325,8 @@ export async function cmakeUpdateSDK(
322325 const cmakeFilePath = join ( folder . fsPath , "CMakeLists.txt" ) ;
323326 // This regex requires multiline (m) and dotall (s) flags to work
324327 const updateSectionRegex = new RegExp (
325- `^# ${ CMAKE_DO_NOT_EDIT_HEADER_PREFIX } .*# =+$` ,
328+ `^# (${ CMAKE_DO_NOT_EDIT_HEADER_PREFIX } ` +
329+ `|${ CMAKE_DO_NOT_EDIT_HEADER_PREFIX_OLD } ).*# =+$` ,
326330 "ms"
327331 ) ;
328332 const picoBoardRegex = / ^ s e t \( P I C O _ B O A R D \s + ( [ ^ ) ] + ) \) $ / m;
You can’t perform that action at this time.
0 commit comments