Page 1 of 1

anyone using VsCode with Purebasic?

Posted: Tue Jul 29, 2025 11:05 pm
by rootuid
I'm aware of these two plugins:
PureBasic Extension last updated 2018
PureBasic language last updated 2018
Both of them don't appear to work in 2025. Are there any other Purebasic plugins?

How do I compile and debug from VsCode? I imagine I tell VsCode to use the purebasic command line compiler somehow, anyone done this ?

Thanks in advance :)

Re: anyone using VsCode with Purebasic?

Posted: Wed Jul 30, 2025 9:48 am
by Axolotl
I guess you found the (one and only) implementation.

Eddy introduced his work here: PB language support for Visual Studio Code

And don't forget eddy on github
Here you can see, that the project is (super) old.

Sorry, I cannot answer your question, because I never used the vscode.

alternative code editor

Posted: Fri Aug 01, 2025 2:01 pm
by Piero
In case, for alternatives, search akelpad (win) or textmate (mac) on this forum…

I use TextMate as an IDE tool for "advanced editing/completion"; I only implemented error check, because I can quickly return to PB and compile/debug there (PB IDE isn't so bad after all)
PS: If you have a Mac, also search "fuzzy completion"…

Re: anyone using VsCode with Purebasic?

Posted: Fri Aug 01, 2025 3:37 pm
by skywalk
PB IDE really just missing split view and variable finders. Else, really good flow.

Re: anyone using VsCode with Purebasic?

Posted: Fri Aug 01, 2025 6:40 pm
by AZJIO
rootuid wrote: Tue Jul 29, 2025 11:05 pm How do I compile and debug from VsCode?
I think many beginners try to start writing code in their usual editor and try to build a connection with the compiler. But after a while, you'll realize that it's better to write in a standard IDE.
1. The IDE understands the compiler directives that are located at the end of the file. You'll need to write an analyzer for these data to link the compiler to a different editor.
2. You'll need to create a list for auto-completing functions and keywords when typing.
3. The debugger interacts with the IDE, showing the values of variables during debugging and highlighting lines with errors.
4. There are many tools written for the IDE, but they may not be compatible with your editor because they use Scintilla.

A javascript example for searching for an icon and the name of an exe file

Code: Select all

function ExeFindSource(pFile, pExt) {
	var pTmp = AkelPad.ReadFile(pFile);
	var Pos1 = pTmp.indexOf('; Executable = ')
	if (Pos1 != -1)
	{
		Pos1 += 15 //  pStart.length
		var Pos2 = pTmp.indexOf('.' + pExt, Pos1)
		if (Pos2 != -1)
		{
			pTmp = pTmp.substring(Pos1, Pos2 + 4)
			pTmp = sFileDir + '\\' + pTmp
			return pTmp
		}
	}
	return sFileWiExt + pExt
}

function IconFindSource(pFile) {
	var pTmp = AkelPad.ReadFile(pFile);
	var Pos1 = pTmp.indexOf('; UseIcon = ')
	if (Pos1 != -1)
	{
		Pos1 += 12 //  pStart.length
		var Pos2 = pTmp.indexOf('.ico', Pos1)
		if (Pos2 != -1)
		{
			pTmp = pTmp.substring(Pos1, Pos2 + 4)
			var fso = new ActiveXObject("Scripting.FileSystemObject");
			pTmp = sFileDir + '\\' + pTmp
			if (fso.FileExists(pTmp))
			{
				pTmp = ' /ICON "' + pTmp + '"'
			} else {
				pTmp = ''
			}
		}
	}
	return pTmp
}