GLBasic code editor - BR GLB IDE, with VB .Net source... Update: 21.10.2021

Previous topic - Next topic

dreamerman

BR GLB IDE (may change)
This is my attempt to make code editor with features that standard IDE is missing.
Written in Visual Basic 2013 with .NET 4.5 and ScintillaNet 3.x, a source code editor for GLBasic. Free, full source code included (WIP project so beware of coding style).

Current version: 21.10.2021
Download link in attachments - so I can easily count them ;)

What does it look like?


Features
Feature list:
- custom lexer for code coloring, syntax highlighting (all GLB keywords and user typed),
- code folding (Subs, Functions, Types, //#region),
- colored margins to see what part of code were modified,
- colored background for tabs with source names (color depends on source modification counter),
- customisable styles, that can be easily shared,
- bookmarks, saved in separate file,
- auto-completion (see attached gif) for both GLB keywords (full list), and dynamically typed user functions, types and variables, (includes identification of global, local variables/functions),
- hints (function arguments, comments) for all standard GLB functions, and user typed functions,
- show function/type definition (press CTRL and click on word (if it's a function) to go to its definition, works also with types and normal variables),
- quite advanced types handing - identifies nested types, functions in types and all what comes with it,
- support for older GLB v12 up to newest Steam v16 compilers,
- each project is compiled/built in separate temporary directory, skipping unchanged files during compilation (similar to IncrediBuild),
- and more, ah and full source code included,
NOTE: Not all functions have their own menus, try using same keyboard shortcuts as in standard editor.


FUNCTION HINTS:

AUTO-COMPLETE:




Current issues:
- Current version of Scintilla doesn't use hard tabs (like most of modern text editors/ide), default soft tabs are 4 spaces width,
- Only basic project management,
- Not bullet-proof for errors,
- Compiling tested only for WIN32/64 platform, other platforms could be working,
- Find&Replace is binded to one Scintilla object (can't do multiple file search/replace without writing new component),
- DEBUG command doesn't work (it just don't show info), to replace it use STDOUT with this fix:
Code (glbasic) Select
INLINE
}
extern "C" {
#include <cstdio>
}
namespace __GLBASIC__ {
ENDINLINE

FUNCTION stdout_fix:
INLINE
setbuf(stdout, NULL);
ENDINLINE
ENDFUNCTION

and use 'stdout_fix()' function at start of your sources, and STDOUT as equivalent of DEBUG.


Current TODO
Fix bugs.


What you need to get it work?
1. Download and install .Net 4.5 Framework Redistributable / Client Pack, newer system have it built-in.
2. Compile any project with normal GLB IDE, and copy 'glblicence.inc' ('C:\Users\-X-\AppData\Local\Temp\glbasic' or '%temp%\glbasic') to app directory. This file is needed by glbasic compiler, but files from temp dir are always deleted, so we need to have it in some place and copy each time before compiling.
3. Run my IDE, goto 'tools->Options', type proper path to your GLBasic dir (to know where is the compiler, for example: 'C:\Program Files (x86)\GLBasic_v15'), also specify company name, save cfg.
4. Load your project, edit, select win32 platform, compile. All should work now.


Legacy projects - no longer updated.
To keep this post clean download links will be separated from main editor attachment.

BR GLD IDE ver VB 2010
Previous version of my code editor, made with VB 2010, .Net 2.0 and ScintillaNET 2.x

Pre GPC - precompiler to use with your favorite IDE
Simply it's PureBasic project with command line interface, that can open and compile GLB projects, you just need to pass any legit source code as argument, and app will handle the rest. Thats why it can be used with external code editors like SublimeText (as they can't read GLB project themselves).
This archive includes SumblimeText 'package' started by Albert here
Check my source code editor for GLBasic - link Update: 20.04.2020

mentalthink

 :enc: :enc: HI dreamerman this can be absolutely cool, can use GLbasic in any IDE, I like a lot the GLBasic Ide but perhaps in CodeBlocks or Sublime Text can be wonderfull pick code in GLBasic...

I hope when you finished the project make a tutorial for know how make the process to add the Compiler and all the needed for working...

Thanks a lot, and Welcome, I think you are "newbie"  :P here!!!
Thanks!!!

dreamerman

Setup is really simple, only few steps, I have change first post a little so now it's clearly written how to setup app.
For SublimeText most of GLBasic functions are defined now, so auto-completion is more usefully. Still this editor isn't perfect, no function list and so on :/

I looked into CodeBlocks custom syntax highlighting and it's little complicated - need to write scintilla lexer and some additional things.
Is there any other good, free IDE with auto-completion, hints with easy configuration for custom languages? Or it would be better to write new IDE from scratch..
Check my source code editor for GLBasic - link Update: 20.04.2020

mentalthink

I now text Editor 2, it's possible configure our own languajes and put the keywords for autocomplete.

dreamerman

hm.. no replies? :p Unfortunately I didn't found other good cross language IDE that could be easily configured to use with GLB, and would have all needed features, so I decided to write my own editor for GLB. Based on ScintillaNet and written in VB .Net, most important to me is to have hint's for user typed functions and auto-completion for them. Still .Net version of Scintilla is old and doesn't have all newer features and bugfixes but it should be sufficient for what I plan to add in my editor.

You can download current version from first post, this is very limited release - just to show how hints and other stuff will work, I need to finish some things, then I will add compiling, and later other features.
Ah and remember it's not planned to be most beautiful IDE, just to have all features working.
Check my source code editor for GLBasic - link Update: 20.04.2020

Marmor

i wish we have a ide written in purebasic for win/mac/linux .

mentalthink

And I say in GLbasic don't it's possible make the IDE?¿, sure works in Mac , LINUX and PC... without problems...
Use Net o PureBasic what advantage have front GLBasic, the buttons or make the IDE?¿.

dreamerman

@up
In short, GLB isn't best language for making applications, you would need to made advanced edit control with many features similar to Scintilla, all ui stuff, and so on..

It tooked to long but I returned to this project some time ago and now you can see what is new in 3 public version of my IDE.
Compiling for win32 works ok, there are some issues with other platforms, but autocomplete, hints and all that stuff is working, give it a try ;]
To compile projects you need copy 'glblicence.inc' file from 'C:\Users\-X-\AppData\Local\Temp\glbasic' to ide application dir - standard glb ide generates that file before compiling.
Second thing, GLB doesn't close stdout stream after each line, so to get info from DEBUG function attach that source:

Code (glbasic) Select
INLINE
        }
                extern "C" {
                        #include <cstdio>
                }
        namespace __GLBASIC__ {
ENDINLINE

TYPE test_type2
        some_var%
ENDTYPE

//fix glb stdout
FUNCTION stdout_fix:
        INLINE
                setbuf(stdout, NULL);
        ENDINLINE
ENDFUNCTION

and use 'stdout_fix()' function at start of your sources.

If there would be some problems with refreshing variables, functions, save current file or switch to edit another file in project and get back to previous file, that will parse first file again, and all missing stuff should be recognized.

Edit: current problems: arrays bug, does not recognize function arguments as local defined variables..
Check my source code editor for GLBasic - link Update: 20.04.2020

erico


Hemlos

My favorite IDE is Gedit with a terminal in the bottom =D
Bing ChatGpt is pretty smart :O


dreamerman

Little update, arrays parsing fixed, all word identification functions are using custom code now (so #$% are no longer problem, at least shouldn't be).
The priority is to add new functions for tracking changes in code.
btw. in first post I have attached gif that shows how autocomplete functions is working with types.  ;)
Check my source code editor for GLBasic - link Update: 20.04.2020

dreamerman

No comments? :P
New version uploaded, most important changes from last ver:
- changes in function parsing variables (fixed type identification, other changes),
- function arguments are now treated as local variables (so are visible on autocomplete list),
- updates in 'code change tracking' functions (some new bugs, but they will be fixed with next update),
Check my source code editor for GLBasic - link Update: 20.04.2020

erico

Ops, I will bring some comments today or tomorrow, got into some workload here that is detracting me from doing the things I want.

Schranz0r

If i leftclick on the codeside i got a error, see attachnment!

DETAILS:
Code (glbasic) Select
Informationen über das Aufrufen von JIT-Debuggen
anstelle dieses Dialogfelds finden Sie am Ende dieser Meldung.

************** Ausnahmetext **************
System.InvalidCastException: Ungültige Konvertierung von der Zeichenfolge  in Typ Integer. ---> System.FormatException: Die Eingabezeichenfolge hat das falsche Format.
   bei Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String Value, NumberFormatInfo NumberFormat)
   bei Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value)
   --- Ende der internen Ausnahmestapelüberwachung ---
   bei Microsoft.VisualBasic.CompilerServices.Conversions.ToInteger(String Value)
   bei WindowsApplication1.Form1.Search4NestedInfo() in D:\projekty\vstudio\my_glb_ide\Form1.vb:Zeile 1172.
   bei WindowsApplication1.Form1.Scintilla_List_Click(Object sender, EventArgs e) in D:\projekty\vstudio\my_glb_ide\Form1.vb:Zeile 542.
   bei System.Windows.Forms.Control.OnClick(EventArgs e)
   bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   bei System.Windows.Forms.Control.WndProc(Message& m)
   bei ScintillaNET.Scintilla.WndProc(Message& m) in C:\Users\jslusser\Projects\ScintillaNET\Releases\2.5\ScintillaNET\Scintilla.cs:Zeile 2222.
   bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Geladene Assemblys **************
mscorlib
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.5483 (Win7SP1GDR.050727-5400).
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll.
----------------------------------------
my_glb_ide
    Assembly-Version: 1.0.0.0.
    Win32-Version: 1.0.0.0.
    CodeBase: file:///C:/Users/sliver/Desktop/dream_GLB_ide/Dream_GLB_ide/my_glb_ide.exe.
----------------------------------------
Microsoft.VisualBasic
    Assembly-Version: 8.0.0.0.
    Win32-Version: 8.0.50727.5483 (Win7SP1GDR.050727-5400).
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll.
----------------------------------------
System
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.5467 (Win7SP1GDR.050727-5400).
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll.
----------------------------------------
System.Windows.Forms
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.5483 (Win7SP1GDR.050727-5400).
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll.
----------------------------------------
System.Drawing
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.5483 (Win7SP1GDR.050727-5400).
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll.
----------------------------------------
System.Runtime.Remoting
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.5483 (Win7SP1GDR.050727-5400).
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll.
----------------------------------------
ScintillaNET
    Assembly-Version: 2.5.2.0.
    Win32-Version: 2.5.2.0.
    CodeBase: file:///C:/Users/sliver/Desktop/dream_GLB_ide/Dream_GLB_ide/ScintillaNET.DLL.
----------------------------------------
System.Configuration
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.5483 (Win7SP1GDR.050727-5400).
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll.
----------------------------------------
System.Xml
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.5483 (Win7SP1GDR.050727-5400).
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll.
----------------------------------------
mscorlib.resources
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.5483 (Win7SP1GDR.050727-5400).
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll.
----------------------------------------
System.Windows.Forms.resources
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.5420 (Win7SP1.050727-5400).
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_de_b77a5c561934e089/System.Windows.Forms.resources.dll.
----------------------------------------
Microsoft.VisualBasic.resources
    Assembly-Version: 8.0.0.0.
    Win32-Version: 8.0.50727.5420 (Win7SP1.050727-5400).
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualBasic.resources/8.0.0.0_de_b03f5f7f11d50a3a/Microsoft.VisualBasic.resources.dll.
----------------------------------------

************** JIT-Debuggen **************
Um das JIT-Debuggen (Just-In-Time) zu aktivieren, muss in der
Konfigurationsdatei der Anwendung oder des Computers
(machine.config) der jitDebugging-Wert im Abschnitt system.windows.forms festgelegt werden.
Die Anwendung muss mit aktiviertem Debuggen kompiliert werden.

Zum Beispiel:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

Wenn das JIT-Debuggen aktiviert ist, werden alle nicht behandelten
Ausnahmen an den JIT-Debugger gesendet, der auf dem
Computer registriert ist, und nicht in diesem Dialogfeld behandelt.


I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard