Skip to content

Allow void elements to be specified in data provider#125

Merged
aeschli merged 2 commits intomicrosoft:mainfrom
hahn-kev:main
May 18, 2022
Merged

Allow void elements to be specified in data provider#125
aeschli merged 2 commits intomicrosoft:mainfrom
hahn-kev:main

Conversation

@hahn-kev
Copy link
Copy Markdown
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
Copy Markdown

ghost commented Mar 19, 2022

CLA assistant check
All CLA requirements met.

@aeschli
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Collaborator

aeschli commented May 18, 2022

Thanks a lot @hahn-kev, nice PR!

@hahn-kev
Copy link
Copy Markdown
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