Essential Text Editor add-ons for coders

Another round of Text Editor menu updates, including recently unexposed navigation and select operators:
https://developer.blender.org/D5434

Not having a full-featured modern IDE with support for bpy autocompletion and the rest of python holds back Blender add-on development from taking off like a rocket. Having to know so much of the library before it can be used in an external editor is a huge drawback, so it’s great to see someone tackling making the internal editor better until that can be sorted out.

3 Likes

Have you seen this?

It’s really helpful, couldn’t imagine developing addons without it.

1 Like

Can fake-bpy-module be used in the Blender Text Editor?

If anyone is here, who knows how to code in C, and want to contribute, then here are a few simple(I hope) tasks, which could improve the Text Editor:

Proposals:

  • In the Header, next to the text drop down menu, is a copy icon. This should be changed to FILE_NEW since, pressing the button will add a new text-block.
  • Ctrl+F for Find should auto-add selected text to the Find search box(like Find Set Selected).
  • Ctrl+H for Replace should open the sidebar, and add current selection to the replace box, before doing replace, so it is possible so read what will be replaced with what, before doing it.
  • Add search direction: Up & down.
  • Add replace all(in current document). (The current All button is for continuing search over all text blocks)
  • Text Auto Complete: Always use the Python API lib, even though the current text block do not have .py extension(yet). Could be added to Properties to unselect Python API for auto complete.
  • Register, Live Edit and Make Internal are missing proper documentation, since it is very hard to understand what these functions are for.
  • Add: Remove Trailing Whitespace, since it’s annoying to use an external editor for this simple thing.
  • Organize templates in sub-menus when there are several entries in the same categories ex: Gizmo, Operator and UI.
  • Comment operator is missing a tooltip.

Yesterday the Text Editor Menus got an update:
https://developer.blender.org/D5434

And today the Python Console and the Info Editor got the menus reworked:
https://developer.blender.org/D5443
https://developer.blender.org/D5444

I have no idea, so I can’t say.

What I can say is keep up the good work!

A new Text Editor operator:

image

6 Likes

My suggestion would be to add a quasi-intelligent assistant in the shape of a paperclip character, giving advice in text balloons.

2 Likes

Thanks, but why? Do you think trying to improve the neglected Blender Text Editor is equivalent to odd stuff in Windows Vista?

It was just a silly joke. Sometimes I can’t resist it. :slightly_smiling_face:

1 Like

I thought about this one. but I will give you his site where you can contact him. but he hasn’t much time :slight_smile: https://lapineige.fr/wp/

You can contact me here too :slight_smile:
What would you like to see integrated in the add-on ? :slight_smile:

I don’t think I have any speciffic requests for you add-on, which I like and updated to 2.80(I hope that is okay? Look above to a link to the gist)

The general situation is that with the many free IDEs around and the Blender dev. ressources are allocated on other areas of Blender, those of us, who anyway end up spending time on coding in the Text Editor and therefore would like to get rid of the shortcommings, maybe need to get together and do an organized collaborative effort.

With the lack of C coders, there is an option to add operators (functions) coded in Python to the official Blender. So all of us add-on coders could potentially commit improvements in Python, however the current showstopper is a few functions missing from the C coded api like “get selection”.

So if someone here could help us out with this, we could start a dialogue on what essential functions are missing and how to implementeret them.

Imo, the general ambition should not be to turn the Text Editor into a fully fledged IDE, but to add essential tools for making quality code and tools for easing working with the API. And maybe consider how design it, in order to help newbees get up and running coding Blender add-ons with ease.

I guess we could have a chat room at blender.chat - if we’re enough people.

So who wants to contribute to improving the text editor? (Throw a like at this post if you do)

1 Like

That’s even very cool :slight_smile:
I didn’t have time to do it yet.
I you want, you can submit a PR on my gitlab (or github if you prefer) repository, so I can add your changes to the official repo.

How do you guys like the horizontal “toggle Find and Replace UI” in the footer? This way does the sidebar not take up vertical space, when you need to use the find function in the Blender Text Editor:
Horizontal_find_search

@lapineige There is a link in this post: Essential Text Editor add-ons for coders - #32 by tin2tin

5 Likes

I like it.

You should be able to make use of activate_init to focus the input field.

The new toggle comment operator needs some work imo.

  • It doesn’t do anything to a line unless there’s a selection. Ideally it should comment active line.
  • When making a reverse selection, toggling commenting still moves the cursor.

While not related to the latest updates, I just noticed that the menu entry View comes before Text - this breaks the convention of File, Edit, Format, View.

Unfortunately, the Blender Devs didn’t like it: https://developer.blender.org/D5474 so the idea is abandoned. I might make an add-on out of it, so thank you for the activate function.

In all Blender menus the first entry is always View, so it’s a consistency thing, though this makes Blender less industry standard.

On the toggle comment function, I think some work was done to make the work on current(unselected) line, have you checked one of the latest beta builds? Else, maybe you can add a comment here: https://developer.blender.org/rB91fa07dfb18f35783177db47d4c721e5a03aad43

Campbell, the moderator of the Text Editor, send me a link to this Jedi-module which have auto completion, style checking and much more. Implementing something like in the Text Editor is way out of my skill set, but maybe someone here would find it an interesting project?

1 Like

I updated this one for additional search options:

Search-For-Online-Reference

Blender Text Editor: Search online for current or selected word.

Search in:

  • API Reference
  • Python Reference
  • Blender Stack Exchange
  • Blender Source Code
  • Github

Location: Text Editor > Edit > Search API Reference or Context menu.

3 Likes