File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ import { cmakeToolsForcePicoKit } from "./utils/cmakeToolsUtil.mjs";
101101import { NewRustProjectPanel } from "./webview/newRustProjectPanel.mjs" ;
102102import {
103103 CMAKELISTS_ZEPHYR_HEADER ,
104+ CMAKELISTS_ZEPHYR_REGEX ,
104105 OPENOCD_VERSION ,
105106 SDK_REPOSITORY_URL ,
106107} from "./utils/sharedConstants.mjs" ;
@@ -319,8 +320,8 @@ export async function activate(context: ExtensionContext): Promise<void> {
319320 await workspace . fs . readFile ( Uri . file ( cmakeListsFilePath ) )
320321 ) ;
321322
322- // Check for pico_zephyr in CMakeLists.txt
323- if ( cmakeListsContents . startsWith ( CMAKELISTS_ZEPHYR_HEADER ) ) {
323+ // Check for zephyr pico project prefix line in CMakeLists.txt
324+ if ( cmakeListsContents . trimStart ( ) . match ( CMAKELISTS_ZEPHYR_REGEX ) ) {
324325 Logger . info ( LoggerSource . extension , "Project is of type: Zephyr" ) ;
325326
326327 const vb = new VersionBundlesLoader ( context . extensionUri ) ;
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ export const LICENSE_URL_7ZIP = "https://7-zip.org/license.txt";
3737export const WINDOWS_X86_7ZIP_DOWNLOAD_URL = "https://www.7-zip.org/a/7zr.exe" ;
3838
3939export const CMAKELISTS_ZEPHYR_HEADER = "#pico-zephyr-project" ;
40+ export const CMAKELISTS_ZEPHYR_REGEX = / ^ # \s * p i c o - z e p h y r - p r o j e c t \s * $ / mi;
4041
4142export const HTTP_STATUS_OK = 200 ;
4243export const HTTP_STATUS_NOT_MODIFIED = 304 ;
You can’t perform that action at this time.
0 commit comments