PB IDE plugin : smart indent, remove spaces, autocompletions

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

PB IDE plugin : smart indent, remove spaces, autocompletions

Post by eddy »

:arrow: v3.9beta - Download >> PureBasic Editor Extension
old version v3.8 - Download >> PureBasic Editor Extension

:arrow: Demo Video : http://www.screencast.com/users/rineddy ... f7280bb9d8
:arrow: Demo Screenshot : http://media1.pikeo.com/images/server17 ... U7J71Z.png

Features :
- Option: backspace unindents (like DELPHI)
* obsolete *- Option: auto-indent on the fly (directly after keying RETURN or SPACE )
* obsolete *- Option: indent custom tags ;< ;> (like JAPBE)
* obsolete *- Option: indent custom keywords (ex: Class..EndClass StartShooting..StopShooting)
* obsolete *- Option: indent compiler directives (compilerIf...compilerEndif)
* obsolete *- Option: indent DataSection
* obsolete *- Option: indent Start...Stop PB commands (like Start3D Stop3D)

- Option: remove extra empty lines (directly after keying RETURN )
- Option: remove trailling spaces on the fly (directly after keying RETURN )
- Option: autocomplete comment block
- Option: autocomplete custom keywords (ex: Class..EndClass, StartShooting..StopShooting)
- Option: autocomplete compiler directives
- Option: autocomplete 'end' matching keyword (directly after keying
RETURN )
- Option: autocomplete Start...Stop PB commands
- Option: fix up the spacings (with customizable spacing rules)
- Option: format whole source at loading (with customizable formatting rules)
- Option: ticker caret
- Option: indent guide
- Option: preview folded lines
- Option: disable splashscreen
- debugger
- single instance for each opened PB editor
- save preferences
- auto-start mode
- ADDED : toolbar icon to open the configuration panel
- ADDED : toolbar icon to format whole source
- ADDED : configuration panel
- ADDED : easy installation
TODO list :
- customize tabs (popupmenu, mouse click to close)

How to install :
1- unzip this file
2- stop your PB editor (if it's running)
3- double-click on EXE file and confirm your installation.
(the installation backup your preference file)

Image

Image

Image


http://www.datafilehost.com/download-83e1e8a0.html
Last edited by eddy on Wed Apr 07, 2010 11:19 pm, edited 89 times in total.
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Post by eddy »

[released v2.3]
- ADDED : trim trailling spaces
- OPTIMIZED : only visible lines are analyzed now

Remark : "trim trailling spaces" function does not remove empty lines.
Last edited by eddy on Fri Apr 04, 2008 10:46 am, edited 1 time in total.
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Post by eddy »

w.i.p
- EndKeyword : 80% ( I have to fix a coloring problem after any insertion )
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Post by #NULL »

'Next' doesn't decrease the indent here.
..[end]structure[union], [End]Select, Case, Default
ok.. i see, it wasn't meant to be finished.

i really like it and will definately use it when it's working better. thank you :)

<edit>
is there a possibility to apply it to more code than visible? ..like the selection, as an idea.
i personally would also like to have start/stopdrawing()-blocks indented (maybe possible as optional?)

<edit>
you're creating a separate *.ini for each sourcefile with a different path? wouldn't it be better to have one *.ini in the directory of the tool.exe only?
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Post by eddy »

#NULL wrote:'Next' doesn't decrease the indent here.
..[end]structure[union], [End]Select, Case, Default
ok.. i see, it wasn't meant to be finished.
Could you post a screenshot of this problem (a wrong indent result) ?
<edit>
is there a possibility to apply it to more code than visible? ..like the selection, as an idea.
i personally would also like to have start/stopdrawing()-blocks indented (maybe possible as optional?)
- about customization... yes
- about selection... do you mean a option in context menu ?
<edit>
you're creating a separate *.ini for each sourcefile with a different path? wouldn't it be better to have one *.ini in the directory of the tool.exe only?
- I don't see the user case but why not...
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Post by #NULL »

you could check if there is a selection and apply it to it, or apply it just as you are doing currently if there's nothing selected (i guess it's possible to detect that).


that's what it looks like:

Code: Select all

Structure my_s
  x.l
  StructureUnion
  a.b
  c.d
  EndStructureUnion
  EndStructure
  
  
  If 1
    n=3
    Debug n
    EndIf
    
    
    
    Select n
      Case 3
        n*10
        Default
        Debug "default"
        EndSelect
        
        
        
        For i=0 To 10
          n=i
          Debug n
          Next
          
          
          
          DataSection
          Data.l 12
          Data.b 34
          EndDataSection
          
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Post by eddy »

weird I can't reproduce this problem.

- Is there another external tool installed ?
- Did you make your test in UTF8 mode ?
- Did you make your test with the last PB version or older ?

I have to improve the debugger to analyse this bug
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Post by #NULL »

all other tools disabled (not many anyway). i also tried with(out) unicode (that couldn't influence your programm anyway, could it?). i tried with PB 4.10, 4.20b2 and b3. always the same result.

..i made a copy of my pb-4.10 installation, startet the ide with /portable, configured the tool there, and it works! i will look further which pb setting of mine could be causing it.

<edit>
found it: i have to "enable bolding of keywords" to get your tool working. (i always disable that, because it destroys the monospace-matrix)

<edit>
when i close the ide very quickly right after opening it, PureEditorExtension stays alive as a process (-->taskmanager). maybe that's only because of the delay from your little splash screen? (it looks very nice actually, but could become annoying if you like your ide quick)
User avatar
Michael Vogel
Addict
Addict
Posts: 2797
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Post by Michael Vogel »

The smart indent function seems to work fine with 4.20ß3 (but not with 4.02) and thats much better than my own Autoindent work :wink:

When the whole code runs fine, try to find some nice descriptions for the options (e.g. "remove trailing spaces" instead of "do trailing spaces")

Michael
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Post by eddy »

#NULL wrote:found it: i have to "enable bolding of keywords" to get your tool working. (i always disable that, because it destroys the monospace-matrix)

when i close the ide very quickly right after opening it, PureEditorExtension stays alive as a process (-->taskmanager). maybe that's only because of the delay from your little splash screen? (it looks very nice actually, but could become annoying if you like your ide quick)
Ok I can fix that: keyword and splashscreen slowdown

Michael Vogel wrote:The smart indent function seems to work fine with 4.20ß3 (but not with 4.02) and thats much better than my own Autoindent work :wink:

When the whole code runs fine, try to find some nice descriptions for the options (e.g. "remove trailing spaces" instead of "do trailing spaces")

Michael
I'll externalize the resource file laster .
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Post by eddy »

[released v2.4]
- FIXED : quick-close editor while splashscreen
- FIXED : indent (for non-bold keywords)
- ADDED : I make some tests with special keywords (it works !!)
- UPDATED : PASTE support "indent" & "trim trailling spaces"
  • dataSection EndDataSection
  • start3d stop3d
  • startdrawing stopdrawing
  • startprinting stopprinting
  • startspecialfx stopspecialfx
TODO : Of course, I have to add a "custom keywords" list :lol:

indent test result

Code: Select all

ProcedureCDLL DUMMY(param.l)
	;///// STRUCTURE
	Structure TEST
		a.l
		b.s
		StructureUnion
			x.l
			xx.f
			xxx.s
		EndStructureUnion
	EndStructure
	
	;///// NEW BLOCK
	Start3D()
		If a>3
			Select a
				Case 10
				Case 20
				Case 30
				Default
					Debug "POP"
			EndSelect
		EndIf
	Stop3D()
EndProcedure
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Post by #NULL »

great, thanks.

just no indent here within datasection.

<edit>
about the custom list: in jaPBe you can simply add a ;> at the end of a line to indent following lines (and ;< to close the indent again) like

Code: Select all

myStartProc() ;>
  myStuff()
myFinishProc() ;<
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Post by eddy »

good idea it's OK
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
#NULL
Addict
Addict
Posts: 1497
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Post by #NULL »

some problems with If

Code: Select all

If n
  works=#True
EndIf

If Not n
works=#False
EndIf

If (Not n)
  works=#True
EndIf

User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Post by eddy »

I see...Its always the 'non-bold keyword' problem.
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
Post Reply