[wingide-users] Indent analysis confused

Tom Stambaugh tms at zeetix.com
Wed Nov 4 12:50:06 MST 2009


I think the current behavior of WingIDE is superb, I think you've done a 
marvelous job of handling an extraordinarily difficult task. In my view, 
the current functionality does just the right thing -- I'm constantly 
impressed by how well it works inside long comment blocks and multi-line 
docstrings.

The workaround that I offered (adding an indent before the row of 
hashes) perhaps gets Michael most of the way to where he needs to go.

This sounds, to me, like a case of "if it ain't broke, don't fix it."

Wingware Support wrote:
> Tom Stambaugh wrote:
>> PyDoc and the various other tools that use docstrings (such as the 
>> "Source Assistant" of WingIDE) are likely to at least be stressed if 
>> not broken, because I would expect the un-indented second line of 
>> hashes to potentially violate the syntactically-significant whitespace 
>> grammar of Python. I know that comments are supposed to be invisible, 
>> but as you can see from the indent manager they really aren't.
> 
> The reason we chose to pay attention to comment position in the indent
> manager (for auto-indent only, I believe) was that _usually_ the comment's
> position is significant and using it is preferable to requiring the user
> to dedent twice for example in:
> 
> if x:
>   pass
> 
> # comment (had to dedent here)
> <don't want to have to dedent again here!>
> 
> This is a very common case in coding so I think what we're doing is
> in general correct.  The algorithm is actually more complex that just
> looking at comments all the time (e.g. it ignores block comments in
> certain cases).  As I noted earlier, I think we can enhance this to work
> OK in the case Michael reported w/o really breaking anything.  It's
> (probably) reasonable enough to stubbornly indent again for any first
> non-comment line in a code block.  Most comments here will already be
> indented to the "right" position.
> 
> This is good example of how being "smarter" in an IDE can backfire.  There
> is an unavoidable tension between doing more than just being a plain text
> editor and sometimes doing too much.
> 
> BTW, it's useful to get feedback like this.  A lot of the value in Wing
> is from long years of tweaking in response to user reports.
> 

-- 
Tom Stambaugh, Founder
Zeetix LLC/ZeeGuide/ZeeForge
27 Auburn Street
Brookline, MA 02446
617-734-8934 (land)
617-721-0446 (cell)


More information about the wingide-users mailing list