Re: [Pydev-code] New pydev jython scripts: Assign stuff to variable if it is None
Brought to you by:
fabioz
From: Joel H. <yo...@if...> - 2006-09-19 22:04:58
|
> > What do you think? > > Shouldn't be too hard. I'll see if I can find the time to implement > it. There. I've put together a prototype implementation. But whatever you do, do not commit this one yet! It's still way too immature, and I'd appreciate some feedback before I finish up on this one. My thoughts: * Is the constructor / other method separation a good idea? I think so, but I'm not sure... I can't think of any rational examples for why it would be a bad idea... I don't think I'd ever want empty mutables as default arg values to my methods... * My old script assign parameters to attributes should not move the cursor after inserting the new lines. If it would leave the cursor alone, it would work better in conjunction with these and other context sensitive assistants that operate on method def lines. * For constructors, should I combine this with my old hack, so that one assist proposal does all the arg None checking and assignment to attributes? Is it a clever idea to let one propsal do so much? Next question: What should I name such a monster? "Do the usual thing"? * I also noticed a design flaw in RegexBasedAssistProposal. The newline delimiter should be added to self.vars already in the isValid() method. This is fixed in the attached implementation. Any pointers and suggestions are welcome. Cheers! /Joel |