Support Forum

Please or Register to create posts and topics.

Visual Studio Code

If any one is interested, you can actually develop code for the Boriel compiler very effectively in visual studio code. I've developed tasks which call David's bat files, in the same way as the Boriel IDE, it works really well.

If anyone would like to see them, let me know.

This together with the zxbasic addon for Visual Studio Code, provides a really nice environment, and with a little effort could be used to produce development environments for non windows users.

Mikele has reacted to this post.
Mikele

That sounds interesting. Boriel editor is ok but not very comfortable. Would you share more information?

Kind regards,

Michal

Sure. These are the windows instructions.

1. Install Visual Studio Code (it's free)

2. Install the ZX-BASIC extension from the visual studio code market place. This includes support for the boriel syntax.

3. Open the folder where your source *.bas files are located.

4. Open the tasks.json file which is generated automatically by vscode. This defines a series of project specific "tasks". Replace the contents of this file with the tasks.json file included here.

    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Boriel Compile Current",
            "type": "shell",
            "windows": {
                "command": "c:\\temp\\boriel\\NextBuildv5\\Scripts\\Compile.bat"
            },
            "args": [
                "\"${fileDirname}\\temp.bas\"",
                "-S",
                "24576",
                "-o",
                "output.bin",
                "-O",
                "2",
                "--heap-size=1000",
                "--emmit-backend",
                "--explicit"
            ],
            "problemMatcher": []
        },
        {
            "label": "Boriel Create Temp",
            "type": "shell",
            "windows": {
                "command": "copy-item"
            },
            "args": [
                "-path",
                "${file}",
                "-destination",
                "${fileDirname}\\temp.bas"
            ]
        },
        {
            "label": "Boriel Compile And Run",
            "dependsOn": [
                "Boriel Create Temp",
                "Boriel Compile Current"
            ],
            "problemMatcher": []
        }
    ]
}

Note you'll need to modify the

"command": "c:\\temp\\boriel\\NextBuildv5\\Scripts\\Compile.bat"

line to point to the location where the compile.bat file is located in your nextbuild install.  (note it doesn't work if  the path has spaces in).

5. From the Terminal select the Run Task, "Boriel Compile And Run". This will compile the .bas file in the current editor window, and then run cspect in exactly the same way as the Boriel IDE functions.

 

 

Uploaded files:
  • compileAndRun.png
Mikele has reacted to this post.
Mikele

Thank you for explanation! I've just installed VSCode and ZXBasic extension but I have a problem with the Terminal.  My tasks.jason has 2 problems but i'm not sure what kind of problem.  I don't have ane space in the pathname.

Any suggestions?

Michal

There was a { missing from the very top of the file I cut and pasted.

Mikele has reacted to this post.
Mikele

Ah... ok!

Now it does work!

Thank you. I need to test it more but it looks awesome 🙂

Thank you!

ljg701 has reacted to this post.
ljg701

Can this be adapted to work for the linux version of VScode? What about integrating the .bat's into the tasks?

I think the batch files would need to be converted to something else for Linux. I believe David is thinking about converting the batch files to python, which should help make the visual studio code approach work on Mac and Linux including the Raspberry pi 4.

In the meantime I suspect if you've got Wine installed inside Linux, it may be possible to get the bat files to work as is?

For someone such as me who has no real programming skills i thought that the visual code for linux would be the perfect solution.Unfortunately i had nothing but problems,i think the first hurdle was Visual Code is now a native program for linux,so the bat files wont work,unless you ran visual code via wine.Next was the carriage return,which was setup as native windows for visual code (CF) and after much reading and screaming was to be (LF)? on linux (forgive me if i have these wrong,i seemed to have repressed many of the bad memory's).
I was slowly trying to convert said bats to bash and then i thought why call another script when you could include all those instructions in the build script.

Anyhoo,at the moment i found an old laptop ran windows 10 and have Visual Studio Community installed with the SpectNetIde extension.Looks great and i am now experimenting...(got "A" to print to screen lol).
I run Manjaro kde on my main computer and i am now comfortable with it,however to get a working environment for spectrum development was a bit beyond me.
Oh forgot to mention,have NextBuild to play with also 🙂