Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

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

Closed
peterflynn opened this issue Apr 4, 2013 · 9 comments · Fixed by #3340
Closed

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

peterflynn opened this issue Apr 4, 2013 · 9 comments · Fixed by #3340

Comments

@peterflynn
Copy link
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

@ghost ghost assigned redmunds Apr 4, 2013
@peterflynn
Copy link
Member Author

@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
Copy link
Member Author

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
Copy link
Contributor

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
Copy link
Member Author

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
Copy link
Contributor

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

@pthiess
Copy link
Contributor

pthiess commented Apr 8, 2013

Reviewed

@ghost ghost assigned peterflynn Apr 9, 2013
@redmunds
Copy link
Contributor

redmunds commented Apr 9, 2013

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
Copy link
Member Author

@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

@ghost ghost assigned RaymondLim Apr 10, 2013
@RaymondLim
Copy link
Contributor

Fix verified.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants