This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | #{} autocomplete | ||
---|---|---|---|
Product: | ruby | Reporter: | jerrett <jerrett> |
Component: | Code Completion | Assignee: | issues@ruby <issues> |
Status: | NEW --- | ||
Severity: | blocker | ||
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
jerrett
2007-07-17 00:55:38 UTC
I just noticed that even though i have "Insert closing brackets automatically" is disabled, it still inserts closing brackets. I actually like it everywhere else though, just not with the #{} - and I would like it there too, if it was automatically adding the closing bracket - instead of adding the opening AND closing bracket :) I didn't realize the code wasn't hooked up to the editor-wide "insert matching bracket" setting, I'm fixing that now. But regarding the "#{" behavior; this was added specifically beause TextMate users asked for it. When I received this bug I forwarded it to the dev@ruby.netbeans.org alias and asked what TextMate is doing to avoid this feature getting in the way, and here are two comments I received: "TextMate doesn't do anything special. I think it's just a matter of being aware of the interpolation context you're in. If I'm inside a double quoted string, I expect # to start an interpolation. If I want literal #'s, I use single quotes." "I agree, it doesn't bother me in TM either, my brain is programmed to expect it. Would sure be nice to keep it in, somehow. Could you have an option for "turn on TextMate-style expansions"? :) " The #{} expansion should only be kicking in in double-quoted strings (where #{} expressions are valid), and not in single-quoted strings. Is there a reason you're entering a lot of "#"'s in double quoted strings? I'm just wondering what your use case is. I can imagine people relying on #{} insertions a lot (e.g. to print out strings with embedded value substitutions). Entering "#" as part of user output seems a lot less common, unless it's part of some common API (I remember BASIC used it in its formatting output API, similar to printf). In other words, is this biting you a lot, or is it pretty rare? If it's rare it might be worthwhile the additional productivity offered for the more common operation. But if this is really a conflict which happens a lot I'll need to think of some other solution. (I'd like to avoid options as much as possible.) I've been doing a bunch of Hpricot stuff lately, which uses CSS selectors... @document.at("div#someid"). I suppose it's more likely that a # will be followed by {} than not, but it seems a bit odd to have it predict what I might want. I'm used to auto-complete closing things that have to be closed, not opening and closing things that might need to be there :) If it auto-closed the } after you type #{ it would work more like autocomplete and less like magicks, but would still give the added handy-ness. I agree with you though that trying to avoid more options is smart. Anyway, food for thought - It's not occurring that often, it's just annoying when it does! Totally agreed/support this one whoops - I actually meant I like the auto-complete the way it apparently is (although I haven't seen this working yet). As a hobbyist programmer this make sense to me and suits my usage. I'm assuming that it would only work within the appropriate context, for example mainly in the case when you are quoting a string within an *.RHTML file. |