Codea Air Code 2.0 - Beta

Hi @Bri_G! Thanks again for testing all this!

I just pushed version 1.1.5 of the extension which should help understand when the extension is properly connected to Codea. The ‘> <’ corner icon does not actually reflect the connection status, it only shows which IP was used for the host. The new connection indicator will be beside that icon and looks like this:

Connected:
Screenshot 2023-05-29 at 10.45.52 PM

Connection error:
Screenshot 2023-05-29 at 10.46.21 PM

If you see this red indicator, it means you are not properly connected to Codea. You can click this status bar indicator to retry connecting.

You can attach to Codea anytime while it’s running. However, it is true that VSCode will not show any project file until a project is opened in Codea. This is something we want to improve in the future, making it possible to select a project to open directly from VSCode.

I am not sure which buttons you are saying become greyed out. Being attached from VSCode to Codea should not have any impact on the buttons in Codea. Could you please share a screenshot of that potential issue?

The VSCode Explorer shows you a view of the files for the loaded project. It can be confusing because in Codea, we do not display the file extension in your tabs, but behind the scenes, the corresponding files have the lua file extension (e.g. Main.lua). The icon/dot you are referring to might be the Lua icon which VSCode displays automatically based on the file extension:

Screenshot 2023-05-29 at 10.51.58 PM

The different ‘>’ icons indicate folders. Clicking that arrow shows or hides the files found under that folder. For this extension, we’ve chosen to display all files under a folder which has the name of the loaded project. If your project has dependencies, they will be shown under a Dependencies folder.

If by saving the project tab you mean saving the file in VSCode, that is indeed how it’s meant to work. It is an automatic update in the sense that you do not have to make the same changes manually in Codea, they are automatically uploaded as soon as you save the file in VSCode.

Finally, the error message you shared shows a few hints as to what might have happened. Untitled-1 is the default filename if you do File → New Text File in VSCode, and it appears you tried to save that file under “main.lua”. Right now, it is not possible to create new projects in VSCode and thus you should not create files named “main.lua” (or Main.lua), but it seems like this case can currently cause some issues and confusing errors. We’ll see what we can do to improve this!

Thanks again!

@jfperusse - thanks for the feedback, you just prompted me to mention another observation -

Two things, firstly I was trying to create files in Codea using the input box and OK button on the top menu bar in VScode. I think that was what was generating the error that fired up the error box I posted. I somehow managed to generate a Main.lua and a main.lua in the project also
a file that had something like ##!-main.lua in the tab list for the project and in Codea. I managed to delete them though.
When you save in VSCode is there a default location on your PC/Mac ?

@Bri_G Yes, I managed to get a weird filename as well when trying to save as main.lua.

When you save in VSCode files for a Codea project, files are not stored on your machine, they get uploaded to your iOS device. VSCode only keeps them in memory.

@jfperusse - just loaded up VScode and it threw an error out straight away because I hadn’t set my iPad up first. Closed it, set up Codea on my iPad with a project file open and it threw out an error that it couldn’t find a file, the file was present and came before the Icon@2x.png and Info.plist files. If clicked on VScode provided the listing. Restarted and all seemed OK ran the project from the iPad and it ran OK then pressed the pause button in the controls at the top of the VScode listing window - got an error that the file was not found posted that error. While trying to restore the system I got three file errors in total. Couldn’t get the project to close on the iPad control - had to use the run button for in the top central controls.

Attached the error message images, not I didn’t see the masking of the buttons on the iPad controls with this version.



53C53724-500F-4D5D-A2B7-E96733B75154

@jfperusse - another thing I’m not sure about is the opening screen from the VScode editor. It’s the Codea reference/links in that window (image attached) ?

@jfperusse - just playing around with VSCode using it to edit a query from @KIller.jo and it kept throwing up errors to a font command, which appeared OK. Played around with the code on the iPad also tried to load other projects in - one was overwritten with the @Killer.Jo’s project code. Tried to load a new blank template and it threw up an error (attached) which to me looks like it keeps looking for the initial project I was editing. I have probably tried to exit one project without closing it. Tried closing VSCode and reconnecting during this, at one stage it was showing brken connection. I think it needs to hold the working file in a buffer and compare it to any that we attempt to load subsequently flash up an error and identify what the clash is.

Sorry if I keep firing up these issues - probably my lack of experience in this remote editing.

Edit: - is there any way that you can provide a list of projects on the iPad Codea project window (ignoring the > folder linked files) so that you can open and cut and paste from one project to another ?

Hello @Bri_G! Sorry to see you’re having all these issues with Air Code. If you get a connection error because Codea isn’t currently running on your iPad, you shouldn’t have to close VSCode. You can simply launch Codea on your iPad and go back to VSCode (either switch to another window and back to VSCode, or click the bottom left connection error message to try connecting again).

For the file which was not present, I see it’s still referring to a lowercase main.lua file which is not what is normally created by Codea (should be Main.lua) so I think this is related to the issue where it shouldn’t be possible to create such a file, which I’ll look into as soon as possible.

The opening (or “Welcome”) screen you are seeing is a default window VSCode opens with new workspaces. It shows the recently opened workspaces/folders. You can safely ignore it and close the tab. I will see if we can avoid it when opening a Codea workspace.

There is currently no way to open two different projects. However, since each project has a different folder name, you can keep tabs opened for closed projects (if you keep your mouse over a file tab, you should see its path to confirm which project it’s been opened from). Support for multiple projects and switching the active project is something we want to look into as well.

For the font command error, if you have repro steps / sample code, please share here and I’ll have a look!

Thank you!

@jfperusse - thanks for the feedback, since my last posting been using it successfully. Resolved the font issue, it wasn’t down to Aircode 2.

I will post any other issues I find but no new ones for the last couple of weeks.

Programming like this is a real boon - I only miss the font names etc we’re very used to in Codea.

Thanks again.

1 Like

@jfperusse Hi, I don’t appear to be able to launch my WebRepo project at all since the introduction of AirCode 2.0. Codea crashes entirely when I attempt to run it.

It’d be great if you could look into it when you get a chance. Thanks!

Latest WebRepo build:
https://codeawebrepo.co.uk/webrepo_latest.zip

1 Like

@jfperusse - Tried loading Codea via VSCode over the last couple of days and I can’t get to log in. I know there has been at least one upgrade to VSCode - is there any chance it may have upset Aircode 2.

I checked my IP settings as we have had a couple of breaks in the power recently but they have not changed.

Interesting. I took a look and it may be related to the new debugger code. Thanks for posting it, we’ll use it to identify the issue

1 Like

@jfperusse managed to identify the issue and we were able to work a fix into Codea. To go into detail, it has to do with the fact that you are loading a binary chunk (where you decode the ZIP_BIN and load it with load). It surfaced an issue with the debug support we added for Air Code

Edit: beta is with Apple waiting for review

@sim @jfperusse Perfect, I’ve just tested it out on the new beta and it all seems to be working again.

Thanks for the quick fix! I really appreciate it :slight_smile:

2 Likes