Autor Tema: BennuGD syntax package for Visual Studio Code IDE  (Leído 1184 veces)

KeiDash

  • Jr. Member
  • **
  • Mensajes: 77
  • Karma: 3
  • https://twitter.com/AMelianRGD
    • Mi Web
BennuGD syntax package for Visual Studio Code IDE
« en: Marzo 07, 2018, 11:08:52 pm »
Hello!

This last week I'm working on "the possibility of use Visual Studio Code for write BennuGD code and compile games on it".

I got it finally and I wrote a extension for this IDE for has the syntax highlighting support for BennuGD on this.

If someone wants to use it because they think it might be useful, here are the links to my github repository.

To Improve: block comments, I dont't know how to configure it yet, maybe in the next update.

Download the extension here

« última modificación: Marzo 08, 2018, 07:33:03 am por KeiDash »

warrior_rockk

  • Full Member
  • ***
  • Mensajes: 239
  • Karma: 11
Re:BennuGD syntax package for Visual Studio Code IDE
« Respuesta #1 en: Marzo 08, 2018, 07:24:29 am »

Yeah!!!! I was thinking on that this week! I think that Visual Studio Code is a powerful tool and maybe well be great for Bennu.
Many thanks man!

FreeYourMind

  • Hero Member
  • *****
  • Mensajes: 5629
  • Karma: 127
    • GECA soft
Re:BennuGD syntax package for Visual Studio Code IDE
« Respuesta #2 en: Marzo 08, 2018, 07:54:41 am »
very nice, thanks

JaViS

  • Global Moderator
  • *****
  • Mensajes: 1236
  • Karma: 26
    • Anarkade
Re:BennuGD syntax package for Visual Studio Code IDE
« Respuesta #3 en: Marzo 08, 2018, 01:30:23 pm »
Nice! I didn't know of the existence of this IDE, I will create a news on the home page linking to your repo.


Thanks!
Working on Anarkade. A couch multiplayer 2D shooter.

JaViS

  • Global Moderator
  • *****
  • Mensajes: 1236
  • Karma: 26
    • Anarkade
Re:BennuGD syntax package for Visual Studio Code IDE
« Respuesta #4 en: Marzo 08, 2018, 01:58:34 pm »
One Question. How do I compile and run the program from the IDE?
Working on Anarkade. A couch multiplayer 2D shooter.

KeiDash

  • Jr. Member
  • **
  • Mensajes: 77
  • Karma: 3
  • https://twitter.com/AMelianRGD
    • Mi Web
Re:BennuGD syntax package for Visual Studio Code IDE
« Respuesta #5 en: Marzo 09, 2018, 11:08:26 am »
One Question. How do I compile and run the program from the IDE?

Hi JaViS , thanks for your comment.

Well it's easy, I'm explain you.

Resumed, it's a simple batch file that comunicates the code and the binary files of bennuGD. You need to do the next:

1. Create a batch file (In my case I called it compile.bat) on the same path of your game code (each game use her own batch file). For example, you game calls "Tetris" and the main.prg file is located on C:\Code\Tetris\ . Put this .bat file in the same folder that your main.prg

2. Get the path of your BennuGD bin folder, in my case C:\BennuGD\bin\

3. Edit the .bat file like this:

Código: [Seleccionar]
@echo off

set "mainPath=C:\Code\Tetris\"
set "bennuPath=C:\BennuGD\bin\"

set "mainFile=main"
set "extension=.prg"

if exist %bennuPath%stderr.txt  del  %bennuPath%stderr.txt
if exist %bennuPath%stdout.txt  del %bennuPath%stdout.txt
if exist %mainPath%*.dcb del %mainPath%*.dcb

pushd %mainPath%

%bennuPath%bgdc.exe %mainPath%%mainFile%%extension%

if exist %bennuPath%stdout.txt  del  %bennuPath%stdout.txt
if exist %bennuPath%stderr.txt  del  %bennuPath%stderr.txt
if exist %bennuPath%stderr.txt  goto salida

%bennuPath%bgdi.exe %mainPath%%mainFile%
if exist %mainPath%stderr.txt  type %mainPath%stderr.txt

:salida
pause

If you need it (or someone) you can download a copy of my .bat file here

This file get the main paths and the main file of your code. Next, send at the compiler bgdc.exe the main.prg file and then, run the game compiled with bgdi.exe

How execute this on Visual Studio Code?

1. Go into your Visual Studio Code and the folder of your game code (C:\Code\Tetris)
2. Doble click on main.prg (now you see the file at the right)
3. Go to menu View > Open debug console and at the botton of your vsc appears a new window. Then, in this window click on Terminal and you will see something like windows command line (it's the same, you can use the commands of cmd like dir, cls, xcopy, etc)
4. This terminal must has your game folder as currect folder.
5. Now, you can write compile.bat here in the terminal, press enter and the code it's executed and any error o something response of the compiler writes here.

 

JaViS

  • Global Moderator
  • *****
  • Mensajes: 1236
  • Karma: 26
    • Anarkade
Re:BennuGD syntax package for Visual Studio Code IDE
« Respuesta #6 en: Marzo 09, 2018, 02:02:53 pm »
Very detailed explanation!! thank you for taking the time to explain it.


there is already a news on the site about the extension. hope it gets more attention
Working on Anarkade. A couch multiplayer 2D shooter.

warrior_rockk

  • Full Member
  • ***
  • Mensajes: 239
  • Karma: 11
Re:BennuGD syntax package for Visual Studio Code IDE
« Respuesta #7 en: Marzo 13, 2018, 09:18:19 am »
But, isn`t there a way to integrate the compilation onto the interface?

KeiDash

  • Jr. Member
  • **
  • Mensajes: 77
  • Karma: 3
  • https://twitter.com/AMelianRGD
    • Mi Web
Re:BennuGD syntax package for Visual Studio Code IDE
« Respuesta #8 en: Marzo 13, 2018, 02:54:13 pm »
But, isn`t there a way to integrate the compilation onto the interface?

Well, yes it's possible, I'm explain you.

You can create a configuration in Debug menu item (create new configuration) but before this, you need to implement bennu language on vscode and for the moment, this doesn't exists (Someone would have to do it)

Once the language exists on vscode, you can create your custom debugs like press F5 an run the code.

in other way, you can create your own task (Task menu) to execute the .bat file directly. For the moment I don't have time to do it

Why use vscode instead of notepad++? For me, the reasons are various.

Visually, it's more comfortable
I can execute the code without open the main.prg file
I can view multiple files at the same time, to see the functions and processes

Notepad++ it's a strong IDE, but for me has a little shortcomings

I'm trying to find the way to execute all with a simple key in vscode
« última modificación: Marzo 13, 2018, 02:59:31 pm por KeiDash »

warrior_rockk

  • Full Member
  • ***
  • Mensajes: 239
  • Karma: 11
Re:BennuGD syntax package for Visual Studio Code IDE
« Respuesta #9 en: Marzo 14, 2018, 07:26:16 am »
I am pretty comfortable with Notepad++ now because I already have the reasons that you noticed:





-I have autocompletion
-I have a script to execute the code without open the main.prg file
-I can view multiple files
-I have a project window, console output window and a process/functions window


My lack, and the reason to look for another editor, is the posiblity of autocompletion , not for the sintax, but for the user variables, user functions, etc..
I want to see if is posible to implement this important feature on Visual Studio Code...

KeiDash

  • Jr. Member
  • **
  • Mensajes: 77
  • Karma: 3
  • https://twitter.com/AMelianRGD
    • Mi Web
Re:BennuGD syntax package for Visual Studio Code IDE
« Respuesta #10 en: Marzo 16, 2018, 07:35:18 pm »
I am pretty comfortable with Notepad++ now because I already have the reasons that you noticed:





-I have autocompletion
-I have a script to execute the code without open the main.prg file
-I can view multiple files
-I have a project window, console output window and a process/functions window


My lack, and the reason to look for another editor, is the posiblity of autocompletion , not for the sintax, but for the user variables, user functions, etc..
I want to see if is posible to implement this important feature on Visual Studio Code...

Can you explain how to you did it? I never can see the functions/process definitions and never seen a console embeded  on the botton- Can you explain it please?

Regards

warrior_rockk

  • Full Member
  • ***
  • Mensajes: 239
  • Karma: 11
Re:BennuGD syntax package for Visual Studio Code IDE
« Respuesta #11 en: Marzo 20, 2018, 08:07:03 am »
Of course.




The process/function list is a plugin called SourceCookfier that you can download from plugin manager. It's allow to define a code structure for you custom language. There are my settings for BennuGD:


The console is another plugin called NpExec. It's allow to have a console window to send commands and read output info. It have the possiblity to store scripts to run batch and you can assign a color to error line and doble click in the error goes to the source code line!!


This is my console output filter to do this:





To run my code without the main.prg file opened, i made a NppExec script to compile and run always the main.prg file of the current project directory
« última modificación: Marzo 20, 2018, 08:18:43 am por warrior_rockk »

SplinterGU

  • Hero Member
  • *****
  • Mensajes: 12749
  • Karma: 375
Re:BennuGD syntax package for Visual Studio Code IDE
« Respuesta #12 en: Marzo 20, 2018, 01:21:13 pm »
nice!
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

warrior_rockk

  • Full Member
  • ***
  • Mensajes: 239
  • Karma: 11
Re:BennuGD syntax package for Visual Studio Code IDE
« Respuesta #13 en: Marzo 20, 2018, 02:55:10 pm »
I just realize that I forgot the main settings of the SourceCookifier process list. I attached the configuration file for BennuGD