Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLOSED] Code hints broken for rest of line after HTML entity #3139

Open
core-ai-bot opened this issue Aug 29, 2021 · 9 comments
Open

[CLOSED] Code hints broken for rest of line after HTML entity #3139

core-ai-bot opened this issue Aug 29, 2021 · 9 comments

Comments

@core-ai-bot
Copy link
Member

Issue by peterflynn
Thursday Apr 04, 2013 at 07:18 GMT
Originally opened as adobe/brackets#3339


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

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Thursday Apr 04, 2013 at 07:19 GMT


@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.

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Thursday Apr 04, 2013 at 07:27 GMT


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.

@core-ai-bot
Copy link
Member Author

Comment by WebsiteDeveloper
Thursday Apr 04, 2013 at 07:43 GMT


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.

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Thursday Apr 04, 2013 at 07:49 GMT


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.

@core-ai-bot
Copy link
Member Author

Comment by WebsiteDeveloper
Thursday Apr 04, 2013 at 07:51 GMT


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

@core-ai-bot
Copy link
Member Author

Comment by pthiess
Monday Apr 08, 2013 at 18:17 GMT


Reviewed

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Tuesday Apr 09, 2013 at 05:02 GMT


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.

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Wednesday Apr 10, 2013 at 18:12 GMT


@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

@core-ai-bot
Copy link
Member Author

Comment by RaymondLim
Wednesday Apr 10, 2013 at 18:23 GMT


Fix verified.

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

No branches or pull requests

1 participant