Wing IDE 5

Wing IDE 5

Smart code indentation feature?
Dear Wing devs,

1. does Wing have a document-wide code indentation feature? I'm talking about a one similar to Ctrl + Shift + F in Eclipse, Shift + Alt + F in Netbeans or Ctrl + E/Ctrl + F in Visual Studio.

2. consider a code snippet like:

#-------------------------------------------------------------------- def filePath(self): """OS dependent""" pass #-------------------------------------------------------------------- def password(self): """OS dependent""" pass

How can I fix the indentation in Wing? In named IDEs this is pretty easy by selecting the code fragment a pressing an appropriate shortcut, but I can't find anything like that in Wing's context menu.

3. is there a possibility to define a custom personality (even if it means writing a custom plugin)? I'm missing Netbeans' default shortcut layout, and editing every shortcut by hand would by a real pain in the ♥♥♥.
Laatst bewerkt door zombies ate my brain.; 7 mrt 2015 om 10:35
< >
1-3 van 3 reacties weergegeven
In Wing you would first press Tab on the comment line and then select the lines in the second def (not selecting all of first/last is OK) and press Tab. This assumes you're using the default configuration of the Tab key, which is context sensitive but in if within the line does indent-to-match. Look in the Source > Indentation menu for the key bindings for explicit indent/outdent operations, and see also the Editor > Indentation and User Interface > Keyboard preferences.

If this wrong indentation appeared as a result of something you did in Wing, please let me know. We try to avoid issues like that when pasting.

As you probably saw there are keyboard personalities in the Editor > Personality menu. You could edit one of the keymap.* files in your Wing installation (top level directory) to mutate it into a Netbeans personality. If you do that and want to share it we'ld be happy to include it in future versions and expand on it based on user feedback. For any detailed questions about this, emailing support@wingware.com will be quicker. We don't get notifications emailed to us when there is activity in the Steam community (not our choice; Valve doesn't seem to support this for vendors).
Sorry I missed that your first question was separate from the example. There is an Indentation tool for converting indent style/size (in the Tools menu) but you can't fix indentation document-wide in Python because there's no way to know for sure when you reached the end of a scope. In your example, the second def could be a nested def and thus indented correctly. The presence of 'pass' or 'return' does imply it's not indented right (and some of our features use that as a cue) but there are more cases where you can't know than where you can.
Hey, thanks for the answer!

Origineel geplaatst door *******:
you can't fix indentation document-wide in Python because there's no way to know for sure when you reached the end of a scope. In your example, the second def could be a nested def and thus indented correctly.
Yes, you're right. Most of the cases the indentation is not explicit and context-dependent so it's probably not worth it. As for custom personality, that's neat! As the personality file format is pretty obvious, I wrote a small conversion script that mirrors the keymap.eclipse with replaced shortcuts based on nb shortcut schemes. Did not test every shortcut out yet, but still the most common used (like debugger controls or line operations) are mirrored correctly. Uploaded it on GitHub[github.com] so you can try it out and include the generated personality file when necessary.
Laatst bewerkt door zombies ate my brain.; 21 mrt 2015 om 15:08
< >
1-3 van 3 reacties weergegeven
Per pagina: 1530 50