PureBasic Forum
https://www.purebasic.fr/english/

PB language support for Visual Studio Code
https://www.purebasic.fr/english/viewtopic.php?f=14&t=71170
Page 2 of 3

Author:  Kiffi [ Sun Dec 09, 2018 1:47 pm ]
Post subject:  Re: PB language support for Visual Studio Code

eddy wrote:
I published the Purebasic extension for VS Code. :D

Congratulations!

Install count + 1 :D

Author:  Programie [ Sun Dec 09, 2018 3:44 pm ]
Post subject:  Re: PB language support for Visual Studio Code

eddy wrote:
I published the Purebasic extension for VS Code. :D

I just installed it, too. Thanks for your great work!

I'm looking forward to using vscode as my PB IDE instead of the official one once the most important features like auto completion are fully implemented.

I just have one minor issue: Is the indention hard coded to "Tab Size: 3"? Because I can't find any settings for that. I used spaces instead of tabs in other languages and currently have the PB IDE configured to use 2 spaces for indention. How to configure vscode to use (2) spaces instead of tabs without having to configure that per file?

Author:  eddy [ Sun Dec 09, 2018 4:06 pm ]
Post subject:  Re: PB language support for Visual Studio Code

How to change Tab size
  • Press F1
  • Enter "settings"
  • Select Open Settings
  • Enter "tab size"
This will change Tab Size global setting.

Image

Author:  Programie [ Sun Dec 09, 2018 4:10 pm ]
Post subject:  Re: PB language support for Visual Studio Code

eddy wrote:
How to change Tab size
  • Press F1
  • Enter "settings"
  • Select Open Settings
  • Enter "tab size"


I know that. I've already changed tabs to spaces for vscode and it's working fine for other files. But once I open a file containing PB code, the tab size is set to 3 for that file. I have to manually change it per file every time.

Author:  eddy [ Sun Dec 09, 2018 4:18 pm ]
Post subject:  Re: PB language support for Visual Studio Code

Programie wrote:
eddy wrote:
How to change Tab size
  • Press F1
  • Enter "settings"
  • Select Open Settings
  • Enter "tab size"


I know that. I've already changed tabs to spaces for vscode and it's working fine for other files. But once I open a file containing PB code, the tab size is set to 3 for that file. I have to manually change it per file every time.


I declared some custom parameters for Purebasic. You can change PureBasic Tab Size setting as follows :

Image

Author:  Programie [ Sun Dec 09, 2018 4:32 pm ]
Post subject:  Re: PB language support for Visual Studio Code

Oh yes, I just found them, too. Weird, there is not category "PureBasic", just "PureBasic configuration" bellow "Extensions" which only allows me to change a few other settings. Maybe that's caused because the name is surrounded by brackets? It's named "[purebasic]" instead of "purebasic".

Author:  eddy [ Sun Dec 09, 2018 4:37 pm ]
Post subject:  Re: PB language support for Visual Studio Code

In this case, I wonder if it's a good idea to have PureBasic Tab Size setting ?
:?

Author:  Wolfram [ Tue Jan 08, 2019 11:13 pm ]
Post subject:  Re: PB language support for Visual Studio Code

Do you think there is a way to install it in Visual Studio Code on OSX?

Author:  IceBite [ Wed Jan 09, 2019 10:21 am ]
Post subject:  Re: PB language support for Visual Studio Code

Ty for the great work,

i just have one question, how do i compile/run/debug in visual studio code or am i only able to edit the code in vsc and compile it in purebasic itself ?

greetings Fabian

Author:  GG [ Wed Jan 09, 2019 11:55 am ]
Post subject:  Re: PB language support for Visual Studio Code

Hi all,

Is it possible to configure inside VS Code to be able to call PB Compiler directly from Visual Code ?

Author:  NicTheQuick [ Wed Jan 09, 2019 12:53 pm ]
Post subject:  Re: PB language support for Visual Studio Code

I am always using real tabs instead of spaces, is this also possible? I have to check out your extension tomorrow.

Author:  Everything [ Wed Jan 09, 2019 7:11 pm ]
Post subject:  Re: PB language support for Visual Studio Code

I like VSCode, for cpp and c# it's the best choice but with PB syntax I expected to see usual code styling (bold\highlighted keywords similar to PB IDE).

Author:  Programie [ Wed Jan 09, 2019 7:28 pm ]
Post subject:  Re: PB language support for Visual Studio Code

GG wrote:
Is it possible to configure inside VS Code to be able to call PB Compiler directly from Visual Code ?


I'm using Tasks of vscode for that.

tasks.json of one of my projects (stored in .vscode/tasks.json inside the project folder):

Code:
{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Compile (test)",
            "type": "shell",
            "command": "${PUREBASIC_HOME}/compilers/pbcompiler --executable src/purebasic_compilation0.out --debugger --constant PB_Editor_CreateExecutable=0 src/gui.pb",
            "group": {
                "kind": "test"
            }
        },
        {
            "label": "Compile (build)",
            "type": "shell",
            "command": "${PUREBASIC_HOME}/compilers/pbcompiler --executable keyboard-mapper --constant PB_Editor_CreateExecutable=1 src/gui.pb",
            "group": {
                "kind": "build",
                "isDefault": true
            }
        },
        {
            "label": "Run",
            "type": "shell",
            "command": "src/purebasic_compilation0.out",
            "dependsOn": [
                "Compile (test)"
            ],
            "group": {
                "kind": "test",
                "isDefault": true
            }
        }
    ]
}

Author:  GG [ Thu Jan 10, 2019 12:05 pm ]
Post subject:  Re: PB language support for Visual Studio Code

Thanks a lot Programie !
Adapted for my needs under Windows from your example; it works well :

Code:
{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Compile (test)",
            "type": "shell",
            "command": "d:\\Applications\\PureBasic\\compilers\\pbcompiler /exe gencalend.exe /debugger /constant PB_Editor_CreateExecutable=0 /constant PB_Editor_CompileCount=1 gencalend.pb",
            "group": {
                "kind": "build",
                "isDefault": true
            }
        },
        {
            "label": "Compile (build)",
            "type": "shell",
            "command": "d:\\Applications\\PureBasic\\compilers\\pbcompiler /exe gencalend.exe /constant PB_Editor_CreateExecutable=1 /constant PB_Editor_CompileCount=1 gencalend.pb",
            "group": "build"
        },
        {
            "label": "Run",
            "type": "shell",
            "command": "gencalend.exe",
            "dependsOn": [
                "Compile (test)"
            ],
            "group": {
                "kind": "test",
                "isDefault": true
            }
        }
    ]
}

Author:  eddy [ Wed Feb 13, 2019 10:44 am ]
Post subject:  Re: PB language support for Visual Studio Code

Hi,

Thanks GG and Programie, I'll use your code to add "Create PB project" command :D

I've done no progress for my other tasks ... lack of time or motivation :oops:

I'm searching an example coded in typescript :
- to implement autocompletion
- to retrieve PB keywords by using a compiler command line

Page 2 of 3 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/