Page 2 of 4

Re: PB language support for Visual Studio Code

Posted: Sun Dec 09, 2018 1:47 pm
by Kiffi
eddy wrote:I published the Purebasic extension for VS Code. :D
Congratulations!

Install count + 1 :D

Re: PB language support for Visual Studio Code

Posted: Sun Dec 09, 2018 3:44 pm
by Programie
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?

Re: PB language support for Visual Studio Code

Posted: Sun Dec 09, 2018 4:06 pm
by eddy
How to change Tab size
  • Press F1
  • Enter "settings"
  • Select Open Settings
  • Enter "tab size"
This will change Tab Size global setting.

Image

Re: PB language support for Visual Studio Code

Posted: Sun Dec 09, 2018 4:10 pm
by Programie
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.

Re: PB language support for Visual Studio Code

Posted: Sun Dec 09, 2018 4:18 pm
by eddy
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

Re: PB language support for Visual Studio Code

Posted: Sun Dec 09, 2018 4:32 pm
by Programie
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".

Re: PB language support for Visual Studio Code

Posted: Sun Dec 09, 2018 4:37 pm
by eddy
In this case, I wonder if it's a good idea to have PureBasic Tab Size setting ?
:?

Re: PB language support for Visual Studio Code

Posted: Tue Jan 08, 2019 11:13 pm
by Wolfram
Do you think there is a way to install it in Visual Studio Code on OSX?

Re: PB language support for Visual Studio Code

Posted: Wed Jan 09, 2019 10:21 am
by IceBite
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

Re: PB language support for Visual Studio Code

Posted: Wed Jan 09, 2019 11:55 am
by GG
Hi all,

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

Re: PB language support for Visual Studio Code

Posted: Wed Jan 09, 2019 12:53 pm
by NicTheQuick
I am always using real tabs instead of spaces, is this also possible? I have to check out your extension tomorrow.

Re: PB language support for Visual Studio Code

Posted: Wed Jan 09, 2019 7:11 pm
by Everything
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).

Re: PB language support for Visual Studio Code

Posted: Wed Jan 09, 2019 7:28 pm
by Programie
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: Select all

{
    "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
            }
        }
    ]
}

Re: PB language support for Visual Studio Code

Posted: Thu Jan 10, 2019 12:05 pm
by GG
Thanks a lot Programie !
Adapted for my needs under Windows from your example; it works well :

Code: Select all

{
    "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
            }
        }
    ]
}

Re: PB language support for Visual Studio Code

Posted: Wed Feb 13, 2019 10:44 am
by eddy
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