FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Xharbour builder and vscode setup?
Posts: 97
Joined: Mon Nov 21, 2005 10:29 AM
Xharbour builder and vscode setup?
Posted: Sat Jun 28, 2025 03:00 PM
Does anyone have vscode build setup for xHarbour commercial builder xbuild.exe,
more precicely to pass xbuild error output to vscode ?


Output on terminal:

* Executing task: d:\xhb201801\bin\xbuild.exe d:\fivewin\xharbour\wpv\exe2022\wpohivah.exe.xbp -CON

D:\fivewin\xharbour\wpv\exe2022\wpohivah.exe->WPOHIVAH.obj

Type: C >>>xhb.exe -o"obj\WPOHIVAH.c" -m -w -n -pOobj\ -DPOHIVAHE -DFIVEWIN -es2 -I"D:\Fivewin\xharbour\INCLUDE" -I"D:\FIVDB226\INCLUDE" -I"C:\fwh202212\include" -I"d:\xhb201801\include" -I"d:\xhb201801\include\w32" "D:\Fivewin\xharbour\wpv\WPOHIVAH.PRG"<<<

xHarbour 1.2.3 Intl. (SimpLex) (Build 20170902)
Copyright 1999-2017, http://www.xharbour.org http://www.harbour-project.org/
Compiling 'D:\Fivewin\xharbour\wpv\WPOHIVAH.PRG' and generating preprocessed output to 'obj\WPOHIVAH.ppo'...
D:\Fivewin\xharbour\wpv\WPOHIVAH.PRG(162) Error E0017 Unclosed control structure at line 159
1 error

No code generated

* The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command d:\xhb201801\bin\xbuild.exe d:\fivewin\xharbour\wpv\exe2022\wpohivah.exe.xbp -CON" terminated with exit code: 1.
* Terminal will be reused by tasks, press any key to close it.

Nothing appeares on "Problems" panel in vscode.


"problemMatches" section suggested by chatgpt :-)


{
"version": "2.0.0",
"tasks": [
{
"label": "Build with xBuild",
"type": "shell",
"command": "d:\\xhb201801\\bin\\xbuild.exe",
"args": [
"d:\\fivewin\\xharbour\\wpv\\exe2022\\wpohivah.exe.xbp",
"-CON"
],
"options": {
"cwd": "${workspaceFolder}"
},
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": {
"owner": "xharbour",
"fileLocation": ["absolute"],
"pattern": {
"regexp": "^(.*\\.prg)\\((\\d+)\\)\\s+Error\\s+([A-Z0-9]+)\\s*[:\\-]?\\s+(.*)$",
"file": 1,
"line": 2,
"code": 3,
"message": 4
}
}
}
]
}

Thanks,

Taavi
Posts: 97
Joined: Mon Nov 21, 2005 10:29 AM
Re: Xharbour builder and vscode setup?
Posted: Sun Jun 29, 2025 09:42 AM

With chatgpt I was able to get correct problemMatcher pattern with 3 test samples, seems really amazing..

Maybe it will help someone as first step to switch to vscode:

Sample build task for vscode using xharbour builder:

{

"version": "2.0.0",

"tasks": [

{

  "label": "Build with xBuild",

  "type": "shell",

  "command": "d:\\xhb201801\\bin\\xbuild.exe",

  "args": [

    "d:\\fivewin\\xharbour\\wpv\\exe2022\\wpohivah.exe.xbp",

    "-CON",

    "-NoErr"

    ],

  "options": {

    "cwd": "${workspaceFolder}"

  },

  "group": {

    "kind": "build",

    "isDefault": true

  },

"problemMatcher": {

"owner": "xharbour",

"fileLocation": ["absolute"],

"pattern": {

"regexp": "^([A-Z]:.*\\.PRG)\\((\\d+)\\)\\s+(Error|Warning)\\s+([EW]\\d+)\\s+(.*)$",

"file": 1,

"line": 2,

"severity": 3,

"code": 4,

"message": 5

}

}

}

]

}

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Xharbour builder and vscode setup?
Posted: Sun Jun 29, 2025 06:29 PM

Dear Taavi,

Basically the idea is to generate a log file and then provide it to Copilot agent, so it can analyze it and continue its work

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion