shon242,
I don't remember how this worked when I first tried VS code several years ago but with the v1.73.1 version of VS code neither the syntax highlighting nor the F4, F5 & F6 keybindings work and this is because in the current version of VS code the default language for files with the ".bas" extension is now set to Visual Basic.
Provided that you have followed the instructions on the
Visual Studio Code - Software - PICAXE page to install the picaxe extensions then you can set the file association for ".bas" files permanently to "PICAXE Basic" in v1.73.1 this way:
Open a file with the ".bas" extension
Press ctrl-k, m to bring up a pulldown list named "Select Language Mode". (press ctrl-k, release the keys and then press m)
Choose the option "Configure File Association for '.bas'...". This will give you another pulldown list to choose from.
Scroll down and select "PICAXE Basic". If you type the first few characters of "picaxe" it will filter the list to just those options that start with "pic".
Hippy,
I recently setup Visual Studio Code to try it out. The VS code interface has changed such that the instructions on the
Visual Studio Code - Software - PICAXE page to setup Keybidings are out-of-date.
These are the existing "Setup Keybindings" instructions:
Select the File, Open File menu option, and select the keybindings/keybindings.json file downloaded and unzipped earlier.
Select the File, Preferences, Keyboard Shortcuts menu option.
This will bring up two additional "keybindings.json" edit windows. The middle one is the global bindings, the one on the right are personal bindings.
Copy the keybindings.json contents from the left window into the personal bindings to the right hand edit window.
Close and save the right hand personal bindings window, close the other two windows.
This is the process I needed to use to setup the keybindings in the current v1.73.1 version of VS code:
Select the File, Open File menu option, and select the keybindings/keybindings.json file downloaded and unzipped earlier.
Select the File, Preferences, Keyboard Shortcuts menu option.
This will bring up the Keyboard Shortcuts Window.
Choose the Show User Keybindings command from the More Actions (...) menu in the top left-hand corner of the Keyboard Shortcuts Window. The firast time you alter these it will bring up a window with an empty User Keybindints json file.
Copy the keybindings.json contents from the left window into the right-hand User Keybindings window.
Close and save the right-hand User Keybindings window, close the other two windows.
NOTE: After you have updated the User Keybindings json file choosing Show User Keybindings command from the More Actions (...) menu will display a list of editable keybindings, not the json file.
To configure keyboard shortcuts through the JSON file, open Keyboard Shortcuts editor and click the Open Keyboard Shortcuts (JSON) button on the right of the editor title bar.