It is currently Sat Sep 22, 2018 12:30 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Sublime 3 - Python3 - linux :)
PostPosted: Mon Sep 03, 2018 11:02 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Jan 20, 2014 6:32 pm
Posts: 168
I am not the original author of this I only tried to fix the original from:

Code:
https://www.purebasic.fr/english/viewtopic.php?f=7&t=49273&hilit=sublime&sid=b9075562ea241772e64f71c2249197b2


I made some slight changes to make it work on Sublime 3, and with Python3 and on Linux :)

Doubt it will work on Windows or OSX.

Anyways here it is:
https://sync.usingssl.com/index.php/s/kcNgbJEf4mYYkdd

You will probably need to edit the file "PureBasic.sublime-build" and correct the paths to your installation.

I dont use the "pbcompiler" much so I dont know all the switches.

Can view what I left / added / removed the "Sublime -> Tools -> PureBasic - Compiler Options" menu.

If you change something or want something added let me know and I can try.

Also I am very new to python so I tried what I could to fix the "PureBasic.py" and it seems to be working but if some one has more skill/knowledge then me then please check it.

Have fun.

_________________
WARNING: I dont know what I am doing! I just put stuff here and there and sometimes like magic it works. So please improve on my code and post your changes so I can learn more. TIA


Top
 Profile  
Reply with quote  
 Post subject: Re: Sublime 3 - Python3 - linux :)
PostPosted: Tue Sep 04, 2018 5:13 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Apr 26, 2003 2:49 pm
Posts: 552
That's great, thanks.
I did a quick test and found a little issue, if you have a folder with the same name of the file you try to compile in the same location it fails.
Is it possible to have a function listing to jump to a function?


Top
 Profile  
Reply with quote  
 Post subject: Re: Sublime 3 - Python3 - linux :)
PostPosted: Tue Sep 04, 2018 5:30 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Jan 20, 2014 6:32 pm
Posts: 168
Justin wrote:
That's great, thanks.
I did a quick test and found a little issue, if you have a folder with the same name of the file you try to compile in the same location it fails.
Is it possible to have a function listing to jump to a function?


do you mean can have the file and folder in same directory? or do you mean when the file to compile is in a folder that has the same name?

Also can you please give me an example of what u mean by jump to function? I dont understand fully.

Thanks

_________________
WARNING: I dont know what I am doing! I just put stuff here and there and sometimes like magic it works. So please improve on my code and post your changes so I can learn more. TIA


Top
 Profile  
Reply with quote  
 Post subject: Re: Sublime 3 - Python3 - linux :)
PostPosted: Tue Sep 04, 2018 6:17 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Apr 26, 2003 2:49 pm
Posts: 552
I can't test the folder thing now, i will check later.

The function listing is like the procedure browser in the PB IDE, a listbox that displays the available procedures on the current file and when you click on one the editor jumps to the procedure declaration.
I think ST has something like a go to symbol option that displays the available methods/structures o whatever and you can jump to the declaration.


Top
 Profile  
Reply with quote  
 Post subject: Re: Sublime 3 - Python3 - linux :)
PostPosted: Tue Sep 04, 2018 7:31 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Jan 20, 2014 6:32 pm
Posts: 168
you mean like this?

https://forum.sublimetext.com/t/how-can-i-easily-jump-to-defintion-of-function-help/10087

_________________
WARNING: I dont know what I am doing! I just put stuff here and there and sometimes like magic it works. So please improve on my code and post your changes so I can learn more. TIA


Top
 Profile  
Reply with quote  
 Post subject: Re: Sublime 3 - Python3 - linux :)
PostPosted: Tue Sep 04, 2018 9:02 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Apr 26, 2003 2:49 pm
Posts: 552
Yes something like that, it's pretty good now, although it does not update live, you have to close it and open again to reflect the changes, is there a shortcut to refresh?
Also it would be nice if scanned for structures and interfaces and maybe the ';- ' marker like in the PB IDE.

Can the structures and interface autocomplete be implemented? Like when you type a structure and pops up the structure fields.

Forget the folder issue it was a problem of mine.

Another thing i have noticed is that the debug statements only appear in the console after the program exits, not during execution, this can be a problem. Maybe using to separate steps build / run would solve it?
For example:
Code:
debug "open"

OpenWindow(0, 0, 0, 600, 300, "foo", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)

debug "opened"
   
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow

debug "exit"

Debugs only show when you exit.


Top
 Profile  
Reply with quote  
 Post subject: Re: Sublime 3 - Python3 - linux :)
PostPosted: Wed Sep 05, 2018 12:17 am 
Offline
Enthusiast
Enthusiast

Joined: Mon Jan 20, 2014 6:32 pm
Posts: 168
Try updating the "PureBasic.sublime-build"

to look like this particularly line 2 just make sure you fix your PB location

Code:
{
    "cmd": ["stdbuf","-oL","/opt/purebasic/compilers/pbcompiler", "$file"],
    "path": "/opt/purebasic/compilers:$PATH",
    "file_regex": "\\s'?(.:.+\\.pb)'?",
    "line_regex": "[ ]*Line ([0-9]*)",
    "target": "buildpb",
    "selector": "source.purebasic=",
    "env":
  {
    "PUREBASIC_HOME": "/opt/purebasic"
  }
}


That should show the debug stuff.

_________________
WARNING: I dont know what I am doing! I just put stuff here and there and sometimes like magic it works. So please improve on my code and post your changes so I can learn more. TIA


Top
 Profile  
Reply with quote  
 Post subject: Re: Sublime 3 - Python3 - linux :)
PostPosted: Wed Sep 05, 2018 9:05 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Apr 26, 2003 2:49 pm
Posts: 552
Hi vwidmer, it's strange the first time i tried it it worked, then it does not work any more, when building, the status bar shows Building for a few seconds and nothing happens. removing "stdbuf","-oL", builds as before.


Top
 Profile  
Reply with quote  
 Post subject: Re: Sublime 3 - Python3 - linux :)
PostPosted: Wed Sep 05, 2018 9:08 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Jan 20, 2014 6:32 pm
Posts: 168
maybe try just running something like

Code:
stdbuf -oL date


in a terminal and see if there is some issue.

or maybe try replacing stdbuf with the full path? Mine is "/usr/bin/stdbuf"

can find it via

Code:
which stdbuf

_________________
WARNING: I dont know what I am doing! I just put stuff here and there and sometimes like magic it works. So please improve on my code and post your changes so I can learn more. TIA


Top
 Profile  
Reply with quote  
 Post subject: Re: Sublime 3 - Python3 - linux :)
PostPosted: Thu Sep 06, 2018 10:02 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Apr 26, 2003 2:49 pm
Posts: 552
The date works well.
The editor same as before, the first time build works showing the debugs well, and then it does not work anymore.

I have noticed that the language plugin format is very similar to the visual studio code one, maybe it would be easy for you to port it? It is free and really good.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye