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

HTML attributes code hinting filter #2263

Merged
merged 7 commits into from
Dec 6, 2012
Merged

HTML attributes code hinting filter #2263

merged 7 commits into from
Dec 6, 2012

Conversation

jbalsas
Copy link
Contributor

@jbalsas jbalsas commented Dec 1, 2012

This pull requests should cover some of this story about filtering code hints https://trello.com/card/code-hinting-filter/4f90a6d98f77505d7940ce88/592, in particular, filtering HTML attributes already used inside a tag.

It adds a new getTagAttributes method inside HTMLUtils that compiles a list of all used attributes inside a tag. This list is then used inside AttrHints to exclude the already used attributes from the complete list.


if (unfiltered.length) {
if (filtered.length) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switching to filtered is ok for your if block, but it's not ok for other if blocks. Make sure you also adjust others.

@jbalsas
Copy link
Contributor Author

jbalsas commented Dec 2, 2012

Ooops... thanks! I don't know how did I miss that...

Fixed, double-checked and changes pushed ;)

@ghost ghost assigned RaymondLim Dec 3, 2012
it("should not find attributes before the tag is opened", function () {
var pos = {"ch": 0, "line": 0};
setContentAndUpdatePos(pos,
['<html>', '<body>', '<div class="clearfix">'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our coding guideline is to use double quotes for all strings and the one nested inside then can use a single quote. So can you switch to double-quotes in all your test cases?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, no problem, will fix that.

I actually copy/pasted from one of the tests above and all the existing ones have the quotes inverted. Do you want me to change those as a bonus, or should we let them be for now?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, please do change them if you don't mind.

@jbalsas
Copy link
Contributor Author

jbalsas commented Dec 6, 2012

@RaymondLim All the quotes have been updated (hopefully) and the I've modified and fixed the test.

@RaymondLim
Copy link
Contributor

Looks good, merging now

RaymondLim added a commit that referenced this pull request Dec 6, 2012
HTML attributes code hinting filter
@RaymondLim RaymondLim merged commit adf0c29 into adobe:master Dec 6, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants