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.

Bug 162367 - add option to use single quotes instead of double quotes in autocompletion
Summary: add option to use single quotes instead of double quotes in autocompletion
Status: VERIFIED FIXED
Alias: None
Product: web
Classification: Unclassified
Component: HTML Editor (show other bugs)
Version: 6.x
Hardware: Sun All
: P2 blocker with 2 votes (vote)
Assignee: Marek Fukala
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-10 07:34 UTC by Jindrich Sedek
Modified: 2013-01-18 14:02 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jindrich Sedek 2009-04-10 07:34:20 UTC
type this code in HTML:
---------
<table | >
---------
invoke code completion at position of "|", select some item on the list, press Enter -> you get
<table align="|">

it can be desired to complete with single quots, I mean to get <table align='|'>

some option for this would be very useful
Comment 1 Marek Fukala 2009-04-10 09:03:58 UTC
we could also:

- look at the exiting attributes in the tag and use the same style of the attr values (unqoted/single/double)
- look at some previous tags and use the same style

Comment 2 isaak 2009-05-23 21:27:33 UTC
Your first suggestion would be a good solution but I'd also like an option to disable auto completion for attribute
quotes, perhaps the best way to implement this is by adding an option with the following values: double quotes, single
quotes, auto, disable. The auto choice would apply both suggestions, i.e.:

- For the first attribute look at the previous tag and if none are available leave it unquoted
- For next attributes look at the previous attribute and apply the same quotes

Because the cursor gets placed between the tags it would be also very useful if both quotes are deleted on a backspace
press, instead of the left one only. This would allow us to type much faster :-).

I hope that this will be implemented in the 6.7 final release because it's the only part of NetBeans that's annoying me.
Comment 3 Jindrich Sedek 2009-06-03 08:02:02 UTC
I'm sorry but this will not be implemented in 6.7. Hopefully next release. Note - P5 is the lowest priority - see 
http://wiki.netbeans.org/BugPriorityGuidelines
Comment 4 isaak 2009-06-16 14:26:46 UTC
Actually, I think Eclipse-like behaviour would be better and easier to implement into the IDE. Instead of what I
mentioned above, quotes should be autocompleted after one is typed.

For example:

=> One types: <div id=
(Nothing special happens here.)
=> When adding a single quote: <div id='
This will be autocompleted to: <div id='|' (| = cursor)
After pressing enter the cursor will be placed after the last quote

This would work the same with double quotes
Comment 5 loko007 2011-12-02 20:05:33 UTC
the option to autocomplete quotes is really crazy:
when you enter <input id=", sometimes you obtain <input id="|"  (| = position of the cursor) and sometimes it give <input id=""|, and you must go backward to correct the mistake. it never give the same thing.
i lost a lot of time because i'm always correcting the mistakes of the IDE...

and when you write <input id=xxx  />, you forgot the quotes and you go backward to add quotes, the IDE add TWO quotes like that :
<input id=""xxx""  />
after, when you want to delete, one quotes, it delete TWO quotes like and you obtnais <input id=""xxx  />

correct that please, it's horrible !!!...

or add an option to avoid this autocompletion in order to active bracket completion without quotes completion
Comment 6 Marek Fukala 2011-12-02 20:18:26 UTC
(In reply to comment #5)
> the option to autocomplete quotes is really crazy:
> when you enter <input id=", sometimes you obtain <input id="|"  (| = position
> of the cursor) and sometimes it give <input id=""|, and you must go backward to
> correct the mistake. it never give the same thing.
> i lost a lot of time because i'm always correcting the mistakes of the IDE...
> 
> and when you write <input id=xxx  />, you forgot the quotes and you go backward
> to add quotes, the IDE add TWO quotes like that :
> <input id=""xxx""  />
> after, when you want to delete, one quotes, it delete TWO quotes like and you
> obtnais <input id=""xxx  />
> 
> correct that please, it's horrible !!!...
> 
> or add an option to avoid this autocompletion in order to active bracket
> completion without quotes completion

What build? AFAIR nothing like that is happening in the latest builds...
Comment 7 Marek Fukala 2011-12-02 20:22:46 UTC
loko007, see my previous comment + create a new defect for the problem if you can reproduce it in 7.1 or dev build. Thank you.
Comment 8 loko007 2011-12-02 20:29:14 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > the option to autocomplete quotes is really crazy:
> > when you enter <input id=", sometimes you obtain <input id="|"  (| = position
> > of the cursor) and sometimes it give <input id=""|, and you must go backward to
> > correct the mistake. it never give the same thing.
> > i lost a lot of time because i'm always correcting the mistakes of the IDE...
> > 
> > and when you write <input id=xxx  />, you forgot the quotes and you go backward
> > to add quotes, the IDE add TWO quotes like that :
> > <input id=""xxx""  />
> > after, when you want to delete, one quotes, it delete TWO quotes like and you
> > obtnais <input id=""xxx  />
> > 
> > correct that please, it's horrible !!!...
> > 
> > or add an option to avoid this autocompletion in order to active bracket
> > completion without quotes completion
> What build? AFAIR nothing like that is happening in the latest builds...

with the the latest build version 7.0.1: it happens ALWAYS. the behavior of quotes autocompletion is never the same
Comment 9 Marek Fukala 2011-12-02 20:35:15 UTC
so is it altering? Once correct once not? I remember several issues related to that are - AFAIR it used to behave differently for class and id attributes than for the rest. Anyway please try the behaviour in 7.1 or latest dev build. If you can still reproduce there then I'll fix it.
Comment 10 Marek Fukala 2012-10-15 12:11:28 UTC
closing