microsoft / vscode-arduino

Visual Studio Code extension for Arduino
Other
1.17k stars 226 forks source link

Custom platform doesn't display properly in BoardSelector View #1190

Open AqeeAqee opened 3 years ago

AqeeAqee commented 3 years ago

Hi there! To make my usb device have a custom product name, I create custom boards.txt and put it into my sketch folder. ("C:\Users\aqee\Documents\Arduino\hardware\aqee\avr\boards.txt") and as well the platform.txt. It works well in arduino IDE. image

But in vscode arduino board selector view, there is a "(undefined)" after my board name. Actually, everything goes well, except not looking good somehow. image

Maybe, something I setuped wrongly, point me pls if there is.

Files in my "C:\Users\aqee\Documents\Arduino\hardware\aqee\avr\" folder, as your reference: boards.txt platform.txt

Best wishes!

AqeeAqee commented 3 years ago

A little investigate I did: https://github.com/microsoft/vscode-arduino/blob/4efe14d2252f5aa718b790fa0057d8f513d6b313/src/views/app/components/BoardSelector.tsx#L35 Binding with platform in view.

And custom platform is really pushed in with packageName: https://github.com/microsoft/vscode-arduino/blob/4efe14d2252f5aa718b790fa0057d8f513d6b313/src/arduino/boardManager.ts#L340

But not with naming parameter as other platform loading: https://github.com/microsoft/vscode-arduino/blob/4efe14d2252f5aa718b790fa0057d8f513d6b313/src/arduino/boardManager.ts#L304

So I guess, packageName didn't set into right place. I tried to setup debug environment on my PC and have a try, but failed. So not very sure. Just hope it helps.