Hi guys, i want to share something with you. It is possible to have smart intelligence autocomplete in a new kind of Editor called Sublime Text 2.
I’m using SublimeText 2 with a couple packages installed. It is actually working!! . SublimeText is absolutely amazing! (no i’m not affiliated with the makers) See steps below the images…
Now type a package name and press enter (repeat steps 4,5 and 6 this for every package)
Alignment
FileTemplates
Ini
PythonOpenModule
Quick File Creator
QuickFileMove
SidebarEnhancements
SublimeCodeIntel
SublimeRope
Terminal
Now everything is installed you will need to configure your project.
Open a folder for your project (File > open folder) (usualy …/MyProject/src)
Save your project (Project > Save Project As…) in the …/MyProject folder and edit it: (Project > Edit Project). (folders are set relative from MyProject folder as where i saved my project file here) Edit the file like this and save it.
ST2 is great! Been using if for a while now for other projects and was having thoughts on creating some kind of Panda3D plugin. But it seems that will not be neccessary
Install the shaderLanguages plugin via Package Control and you benefit from syntax highlighting in glsl files. If you want it to apply to .sha files to, just add sha to the fileTypes array in “OpenGL SL.tmLanguage”. That file is found inside the ShaderLanguages plugin directory.
C:\Users\<USERNAME>\AppData\Roaming\Sublime Text 2\Packages\ShaderLanguages\OpenGL SL.tmLanguage
It seems it doesn’t matter what I type to “config” file. The example you provided will work just fine without it (OnscreenImage example) but not with self.ground=self.loader.loadModel("model1)and then trying to autocomplete self.ground.??
Now when I clear data from “config” it does not matter at all.
How does it know to use panda if config file is empty?
How do I know that for example that main.py is included to project? Do I have to manually “Edit project” and add files? How does sublime know that it’s supposed to read .codeintel?
That’s normal, because in Python a method can return virtually anything. That said it’s not possible what object self.ground is until the code is executed and at that spot.
You can only do code completion for classes or objects that obviously are of a certain type - and even that is not really reliable, because in Python everything is so dynamic (you can even change the methods of a class or of an object from outside).
By the way, you don’t need to set up a project, configure anything or even install the add ons from the post above. The code completion works out of the box with only SublimeCodeIntel add on installed. At least that works for me on Linux (where you don’t have to worry about python paths anyway ).
Still thanks for the tip with the SublimeCodeIntel add on
Thank you for telling me, this saves me many hours.
I think it might work in Windows too without anything added to config, but if one wants to do that the structure above is correct. Also if you make changes to config, only way I could be sure (Windows) that it builds the index is 1. Remove CodeIntel 2. Close Sublime 3. Instal CodeIntel 4. Close Sublime
It still remains mystery to me how to choose what python interpreter is in use and how Sublime includes Panda3D files automatically
Wow! Thanks for pointing out this wonderful little text editor. The codeIntel is very neat.
I did a little bit of researching and found that out that the Komodo IDE whose codeIntel Sublime is based upon, has an even richer codeIntel feature set: It can even provide calltips! Unfortunately, it’s also $250 dollars more.
If you’re referring to help with Panda3D in conjunction with Sublime Text 2 then ask here. For other Panda3D questions please search the forums for it as it might already got answered - if not, feel free to open a new thread.
I was wondering if I could have some help with autocomplete. I have followed the tutorial as best I can. The auto compete works but only with items in document and dose not display all options in the scope of the module.
you cant achieve good autocompletion because some of things just cant be resolved from static files. best option is using pydev autocompletion from here.