Skip to content

Allow void elements to be specified in data provider #125

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

Merged
merged 2 commits into from
May 18, 2022

Conversation

hahn-kev
Copy link
Contributor

@hahn-kev hahn-kev commented Mar 19, 2022

This fixes #123

Please note, this PR drops support for checking void elements keygen and menuitem these are long ago depreciated and not used it any tests. If you need these you can add them back in via a custom data provider and set "void": true.

…ased on HTML Data manager, Add void to webCustomData.ts
@ghost
Copy link

ghost commented Mar 19, 2022

CLA assistant check
All CLA requirements met.

@aeschli
Copy link
Collaborator

aeschli commented Apr 8, 2022

I suggest to make isVoidElement a member of HTMLDataManager.

HTMLCompletion already gets a HTMLDataManager in the constructor.

I'd turn folding and the parser also a class that gets the HTMLCompletion as context.
Same for the selection range. It could get a parser as context

@aeschli aeschli self-assigned this Apr 8, 2022
}

public getSelectionRanges(document: TextDocument, positions: Position[]): SelectionRange[] {
const htmlDocument = this.htmlParser.parseDocument(document);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is a slight tweak to parse the document here, it used to be parsed inside getApplicableRanges which would happen for each position, now it only parses the document once.

@hahn-kev
Copy link
Contributor Author

hahn-kev commented May 8, 2022

ok @aeschli I've created classes for those 3 functions. The formatting makes it look like there are more changes than there really is, but I had to indent all the functions since they are all inside classes now.

@aeschli aeschli requested review from aeschli and dbaeumer May 18, 2022 14:14
@aeschli aeschli added this to the May 2022 milestone May 18, 2022
@aeschli aeschli merged commit f19bc0b into microsoft:main May 18, 2022
@aeschli
Copy link
Collaborator

aeschli commented May 18, 2022

Thanks a lot @hahn-kev, nice PR!

@hahn-kev
Copy link
Contributor Author

You're welcome, happy to contribute

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

Successfully merging this pull request may close these issues.

VOID Elements hardcoded for with non html langauges
3 participants