Page 3 of 4

Re: PB language support for Visual Studio Code

Posted: Sun May 05, 2019 2:06 am
by eddy
Hi,
I'm working on the following features:
  • code explorer (outline panel on the left)
  • code validation
Update v0.1.2
Image

Re: PB language support for Visual Studio Code

Posted: Tue May 07, 2019 10:14 am
by Wolfram
Hi,

I'm using this code to compile on OSX. The Compile works, but the Run not.
What is wrong?

Code: Select all

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Compile (test)",
            "type": "shell",
            "command": "${PUREBASIC_HOME}/compilers/pbcompiler -e myTestApp.app -d -o PB_Editor_CreateExecutable=1 Test_PB.pb",
            "group": {
                "kind": "build",
                "isDefault": true
            }
        },
        {
            "label": "Compile (build)",
            "type": "shell",
            "command": "${PUREBASIC_HOME}/compilers/pbcompiler -e myTestApp.app -o PB_Editor_CreateExecutable=1 Test_PB.pb",
            "group": "build",

            
        },
        {
            "label": "Run",
            "type": "shell",
            "command": "~/Desktop/myTestApp",
            "dependsOn": [
                "Compile (test)"
            ],
            "group": {
                "kind": "test",
                "isDefault": true
            }
        }
    ]
}

Re: PB language support for Visual Studio Code

Posted: Tue May 07, 2019 11:45 am
by Programie
Wolfram wrote:Hi,

I'm using this code to compile on OSX. The Compile works, but the Run not.
What is wrong?
AFAIK, the "group" must be a hash containing a "kind" property (just like you already configured for the "Compile (test)" task).

Re: PB language support for Visual Studio Code

Posted: Tue May 07, 2019 1:07 pm
by Wolfram
I try this but it runs only if I use "Run Task... / Run". It will not start if I use "Run Task... / Compile (test)".
Also I get no debugger output.

Code: Select all

{
            "label": "Run",
            "type": "shell",
            "command": "open 'myTestApp.app'",
            "dependsOn": [
                "Compile (test)"
            ],
            "group": {
                "kind": "test",
                "isDefault": true
            },
            "problemMatcher": []
        }

Re: PB language support for Visual Studio Code

Posted: Sat Apr 04, 2020 4:54 pm
by chi
Maybe useful for some MS haters :wink: Eclipse Theia review

Re: PB language support for Visual Studio Code

Posted: Sat Aug 15, 2020 10:24 am
by Wolfram
Here is a working solution vor OSX

Code: Select all

{
    "version": "2.0.0",

    "options": {
        "env": {
            "mainFile" : "myMainFile.pb",
            "appName" : "myAppName",

            "PUREBASIC_HOME": "/Applications/PureBasic_562_x64.app/Contents/Resources",
            }
            },

    "tasks": [
        {
            "label": "Compile (test)",
            "type": "shell",
            "command": "pbcompiler -e ${appName}.app -d -t -f -ibp -o PB_Editor_CreateExecutable=1 ${mainFile}",
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": [
                "$eslint-compact"
            ]
        },
        {
            "label": "Compile (build)",
            "type": "shell",
            "command": "pbcompiler -e ${appName}.app -t -f -o PB_Editor_CreateExecutable=1 ${mainFile}",
            "group": "build",
            "problemMatcher": []
        },
        {
            "label": "Run",
            "type": "shell",
            "command": "${appName}.app/Contents/MacOS/${appName}",
            "dependsOn": [
                "Compile (test)"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": []
        }
    ]
}

Re: PB language support for Visual Studio Code

Posted: Sat Aug 15, 2020 11:58 am
by BarryG
So how do we compile our PureBasic apps with this? I press F5 and get prompted to select an environment, which Eddy's is already installed (both). Confused.

Re: PB language support for Visual Studio Code

Posted: Sat Aug 15, 2020 10:07 pm
by Wolfram
BarryG wrote:So how do we compile our PureBasic apps with this? I press F5 and get prompted to select an environment, which Eddy's is already installed (both). Confused.
This is an example of the tasks.json file for OSX.
It seams you are on Windows.

Re: PB language support for Visual Studio Code

Posted: Sun Aug 16, 2020 1:51 am
by BarryG
Wolfram wrote:This is an example of the tasks.json file for OSX.
It seams you are on Windows.
I still don't get it. The screenshots are of Windows apps. What is the point of this entire thread? Is it for compiling PureBasic code in Visual Studio Code or not? That's how it appears.

Re: PB language support for Visual Studio Code

Posted: Sun Aug 16, 2020 11:13 am
by Wolfram
BarryG wrote:
Wolfram wrote:This is an example of the tasks.json file for OSX.
It seams you are on Windows.
I still don't get it. The screenshots are of Windows apps. What is the point of this entire thread? Is it for compiling PureBasic code in Visual Studio Code or not? That's how it appears.
Visual Studio Code is cross platform and Eddy wrote an plugin for it to be able to write PB code with it.
You can download the plugins over the plugin manager of Visual Studio Code.
To be able to compile the code on macOS too you need to modify the tasks.json.

Re: PB language support for Visual Studio Code

Posted: Wed Dec 22, 2021 3:59 pm
by swhite
Hi

I installed Visual Studio Code on my Linux PC and then added this extension but when I open a PB file there is no syntax colouring etc. Is it suppose to work in VS Code under Linux?

Thanks,
Simon

Re: PB language support for Visual Studio Code

Posted: Thu Aug 04, 2022 10:19 am
by jacdelad
For my work I have to learn C# now ( :x ) and use Visual Studio Code. I found this extension and became curious. Installing was easy, but I get several errors:
c:\Users\jacde\.vscode\extensions\eddy-r.purebasic-extension-0.1.6\server\out\index.js:33
services_1.Client.connection.workspace.getWorkspaceFolders().then(folders => folders.forEach(folder => {
^

TypeError: Cannot read properties of null (reading 'forEach')
at c:\Users\jacde\.vscode\extensions\eddy-r.purebasic-extension-0.1.6\server\out\index.js:33:94
[Info - 11:18:53] Connection to server got closed. Server will restart.
c:\Users\jacde\.vscode\extensions\eddy-r.purebasic-extension-0.1.6\server\out\index.js:33
services_1.Client.connection.workspace.getWorkspaceFolders().then(folders => folders.forEach(folder => {
^

TypeError: Cannot read properties of null (reading 'forEach')
at c:\Users\jacde\.vscode\extensions\eddy-r.purebasic-extension-0.1.6\server\out\index.js:33:94
[Info - 11:18:54] Connection to server got closed. Server will restart.
c:\Users\jacde\.vscode\extensions\eddy-r.purebasic-extension-0.1.6\server\out\index.js:33
services_1.Client.connection.workspace.getWorkspaceFolders().then(folders => folders.forEach(folder => {
^

TypeError: Cannot read properties of null (reading 'forEach')
at c:\Users\jacde\.vscode\extensions\eddy-r.purebasic-extension-0.1.6\server\out\index.js:33:94
[Info - 11:18:54] Connection to server got closed. Server will restart.
c:\Users\jacde\.vscode\extensions\eddy-r.purebasic-extension-0.1.6\server\out\index.js:33
services_1.Client.connection.workspace.getWorkspaceFolders().then(folders => folders.forEach(folder => {
^

TypeError: Cannot read properties of null (reading 'forEach')
at c:\Users\jacde\.vscode\extensions\eddy-r.purebasic-extension-0.1.6\server\out\index.js:33:94
[Info - 11:18:54] Connection to server got closed. Server will restart.
c:\Users\jacde\.vscode\extensions\eddy-r.purebasic-extension-0.1.6\server\out\index.js:33
services_1.Client.connection.workspace.getWorkspaceFolders().then(folders => folders.forEach(folder => {
^

TypeError: Cannot read properties of null (reading 'forEach')
at c:\Users\jacde\.vscode\extensions\eddy-r.purebasic-extension-0.1.6\server\out\index.js:33:94
[Error - 11:18:54] Connection to server got closed. Server will not be restarted.
...which may be a problem on my side.

My question is: Is this project still under maintenance or given up?

Re: PB language support for Visual Studio Code

Posted: Tue Mar 28, 2023 11:19 am
by Torp
It's really a shame that the project is at a standstill.
I saw that there was a Github on the project and I tried to understand how it worked to try to improve it, but in fact I understand nothing... :( :)

Re: PB language support for Visual Studio Code

Posted: Fri May 26, 2023 7:46 am
by real
Hi,

I installed "PureBasic Language" and "PureBasic Extension". Looks nice, but if I try to run my code w/o debugging VSCode says:
"You don't have an extension for debugging purebasic. Should we find a purebasic extension in the Marketplace?"

Maybe I missed something. Could anybody help, please? I'm new to VSCode.

Thanks
René

Re: PB language support for Visual Studio Code

Posted: Tue Jan 30, 2024 5:13 pm
by Inner
First sorry for nercoing an old thread..
Torp wrote: Tue Mar 28, 2023 11:19 am It's really a shame that the project is at a standstill.
I saw that there was a Github on the project and I tried to understand how it worked to try to improve it, but in fact I understand nothing... :( :)
You're not really missing much to be honest, the process sounds like fun but it's actually counter productive. eg.

Lets use a new editor.

hours later, of trying to get back to what you already had with Pure Basic IDE and failing because MS Visual Code is really a pile of junk and a incomprehensible nightmare that simply doesn't act like an IDE should, you end up back at PB IDE which is far superior if you ask me, visual studio 2022 on the other hand now that's pretty decent but not fit for task however that being compiling Pure Basic code.