Skip to content

It also works with VisualStudio2026.#57

Open
NW-Lab wants to merge 3 commits intoralphwetzel:mainfrom
NW-Lab:Win_VS2026_Add
Open

It also works with VisualStudio2026.#57
NW-Lab wants to merge 3 commits intoralphwetzel:mainfrom
NW-Lab:Win_VS2026_Add

Conversation

@NW-Lab
Copy link
Contributor

@NW-Lab NW-Lab commented Jan 18, 2026

Hello

The Windows version of Moddable SDK v7 is now Visual Studio 2026, so I added it.

Thank you.

Copilot AI review requested due to automatic review settings January 18, 2026 06:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR attempts to add support for Visual Studio 2026 by checking for the existence of Visual Studio version "18" directory and falling back to Visual Studio 2022 if not found. The changes update Windows-specific build tool initialization in two locations within the mcu_plugin.js file.

Changes:

  • Added conditional checks to detect Visual Studio 2026 (version 18) installation
  • Maintained fallback to Visual Studio 2022 when VS2026 is not present
  • Updated both the MODDABLE tools version check and ESP32 build command initialization

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

mcu_plugin.js Outdated
Comment on lines 282 to 294
if (fs.existsSync(`${process.env["ProgramFiles"]}\\Microsoft Visual Studio\\18`)) {
let testcmd = [
`CALL "${process.env["ProgramFiles"]}\\Microsoft Visual Studio\\18\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat" > nul`,
`cd /D ${MODDABLE}\\build\\bin\\win\\debug`,
'dumpbin /headers xsbug.exe | findstr "machine"'
].join(" && ");
} else {
let testcmd = [
`CALL "${process.env["ProgramFiles"]}\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat" > nul`,
`cd /D ${MODDABLE}\\build\\bin\\win\\debug`,
'dumpbin /headers xsbug.exe | findstr "machine"'
].join(" && ");
}
Copy link

Copilot AI Jan 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The testcmd variable is declared with let inside both the if and else blocks, making it scoped only to those blocks. However, it's used outside at line 297 in execSync(testcmd, ...). This will cause a ReferenceError at runtime. The variable declaration should be moved before the if statement, and only the assignment should be inside the blocks.

Copilot uses AI. Check for mistakes.
mcu_plugin.js Outdated
Comment on lines 282 to 289
if (fs.existsSync(`${process.env["ProgramFiles"]}\\Microsoft Visual Studio\\18`)) {
let testcmd = [
`CALL "${process.env["ProgramFiles"]}\\Microsoft Visual Studio\\18\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat" > nul`,
`cd /D ${MODDABLE}\\build\\bin\\win\\debug`,
'dumpbin /headers xsbug.exe | findstr "machine"'
].join(" && ");
} else {
let testcmd = [
Copy link

Copilot AI Jan 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable testcmd.

Suggested change
if (fs.existsSync(`${process.env["ProgramFiles"]}\\Microsoft Visual Studio\\18`)) {
let testcmd = [
`CALL "${process.env["ProgramFiles"]}\\Microsoft Visual Studio\\18\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat" > nul`,
`cd /D ${MODDABLE}\\build\\bin\\win\\debug`,
'dumpbin /headers xsbug.exe | findstr "machine"'
].join(" && ");
} else {
let testcmd = [
let testcmd;
if (fs.existsSync(`${process.env["ProgramFiles"]}\\Microsoft Visual Studio\\18`)) {
testcmd = [
`CALL "${process.env["ProgramFiles"]}\\Microsoft Visual Studio\\18\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat" > nul`,
`cd /D ${MODDABLE}\\build\\bin\\win\\debug`,
'dumpbin /headers xsbug.exe | findstr "machine"'
].join(" && ");
} else {
testcmd = [

Copilot uses AI. Check for mistakes.
mcu_plugin.js Outdated
Comment on lines 282 to 289
if (fs.existsSync(`${process.env["ProgramFiles"]}\\Microsoft Visual Studio\\18`)) {
let testcmd = [
`CALL "${process.env["ProgramFiles"]}\\Microsoft Visual Studio\\18\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat" > nul`,
`cd /D ${MODDABLE}\\build\\bin\\win\\debug`,
'dumpbin /headers xsbug.exe | findstr "machine"'
].join(" && ");
} else {
let testcmd = [
Copy link

Copilot AI Jan 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable testcmd.

Suggested change
if (fs.existsSync(`${process.env["ProgramFiles"]}\\Microsoft Visual Studio\\18`)) {
let testcmd = [
`CALL "${process.env["ProgramFiles"]}\\Microsoft Visual Studio\\18\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat" > nul`,
`cd /D ${MODDABLE}\\build\\bin\\win\\debug`,
'dumpbin /headers xsbug.exe | findstr "machine"'
].join(" && ");
} else {
let testcmd = [
let testcmd;
if (fs.existsSync(`${process.env["ProgramFiles"]}\\Microsoft Visual Studio\\18`)) {
testcmd = [
`CALL "${process.env["ProgramFiles"]}\\Microsoft Visual Studio\\18\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat" > nul`,
`cd /D ${MODDABLE}\\build\\bin\\win\\debug`,
'dumpbin /headers xsbug.exe | findstr "machine"'
].join(" && ");
} else {
testcmd = [

Copilot uses AI. Check for mistakes.
NW-Lab and others added 2 commits January 18, 2026 16:22
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor Author

@NW-Lab NW-Lab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made it easier to read thanks to Copilot's suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants