-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix CMAKE_DO_NOT_EDIT_HEADER_PREFIX grammar #103
Conversation
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - couple of suggestions, but other than that looks good
Co-authored-by: will-v-pi <[email protected]>
Co-authored-by: will-v-pi <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually one more change is needed in extension.mts
, else it won't detect older projects as pico projects - this diff would work
diff --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 by will-v-pi to detect older projects as pico projects
forgot deletion of old
Fix applied, thank you. |
No description provided.