Code hints broken for rest of line after HTML entity #3339

Closed
peterflynn opened this Issue Apr 4, 2013 · 9 comments

Projects

None yet

5 participants

@peterflynn
Adobe Systems Incorporated member

Start with the following code:

<html><body>

&nbsp; foo

</body></html>
  1. Place the cursor after "foo"
  2. Type any letter or number
  3. Type another letter or number
  4. Press esc, then type another letter or number
  5. Type "<"
  6. Press ctrl+space

Result:
2 - code hints pop up listing all HTML entities
3 - entity hints remain visible; there is no sign of the list being filtered down at all
4 - same entity hints pop up again
5 - no code hints appear
6 - same entity hints pop up again

Expected:
2, 3, 4 - no code hints
5, 6 - HTML tag code hints pop up

@redmunds redmunds was assigned Apr 4, 2013
@peterflynn
Adobe Systems Incorporated member

@WebsiteDeveloper @redmunds I'm assuming this broke due to #3237.

In addition to a fix, we should add a couple of unit tests in this area.

@peterflynn
Adobe Systems Incorporated member

I would question whether SpecialCharHints should have anything other than "&" in its trigger keys. In other words, unless implicitChar is null or "&", hasHints() should always return false. This also avoids the added compute cost of calling _getQuery() on virtually every keystroke while editing HTML.

@WebsiteDeveloper

the problem is, that removing all the trigger keys except "&" does show hints when "&" is typed but when one types "&a" then no hints are displayed anymore. I'll look into it and also add a few unit tests.

@peterflynn
Adobe Systems Incorporated member

I'm seeing a few other problems with this extension. Let me know if you prefer I break these out into separate bugs:

  • Typing "&" inside an attribute value throws an exception.
  • Typing "&" (somewhere valid) and then pressing backspace throws an exception.
  • If I place the cursor in the middle of an entity and invoke hints with ctrl+space, then choose a different value (or even the same value), it only replaces the text to the left of the cursor -- not the entire entity. So if you place your cursor like this: &m|dash; choosing mdash again gives you this code: &mdash;dash;. All our other HTML code hints correctly replace the entire token.
@WebsiteDeveloper

please split those up i already have a fix for the cases mentioned in this bug.

@pthiess
Adobe Systems Incorporated member

Reviewed

@peterflynn peterflynn was assigned Apr 9, 2013
@redmunds

FBNC back to @peterflynn. All of the "few other problems" seem to be fixed for me as well. I think the last bullet (only replacing part of existing entity) should be fixed in this sprint, but the exceptions can be split off into a separate bug. Should probably also open a bug for the unit tests.

@peterflynn
Adobe Systems Incorporated member

@RaymondLim do you have cycles to verify this one? You know more about code hinting functionality than I do anyway :-)

Feel free to reassign back to me if you're overbooked though

@RaymondLim RaymondLim was assigned Apr 10, 2013
@RaymondLim

Fix verified.

@RaymondLim RaymondLim closed this Apr 10, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment