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

Have a better parseComponent #532

Closed
octref opened this issue Nov 11, 2017 · 2 comments · Fixed by #1174
Closed

Have a better parseComponent #532

octref opened this issue Nov 11, 2017 · 2 comments · Fixed by #1174
Assignees
Labels
Milestone

Comments

@octref
Copy link
Member

octref commented Nov 11, 2017

Have a typed version of vue-template-compiler.parseComponent.
We still need the html parser, but the top level region dividing can be done using a simpler version.

Maybe base it on parse5. Same approach as https://github.com/prograhammer/vscode-tslint-vue.
This can be reused by a lot of third parties, such as ESLint, TSLint, formatters, etc which are only interested in a specific region of .vue file.
Should also output offsets, so linting error can be shown at right place, formatted code can be placed to right place, etc.

Ideally later we'd also want to use Vue's own parser for <template> region, so we get a richer AST for vue specific stuff.

In short term, we should disable scaffoldCompletions in custom blocks.

@octref octref self-assigned this Nov 11, 2017
@octref octref added the debt label Nov 11, 2017
@HerringtonDarkholme
Copy link
Member

I actually think our version of parseComponent is better. Note vue-template-compiler isn't designed for bad input, say, users are still typing their template code.

Vue's parser is intentionally designed for browser. That means a lot of AST info isn't available, in exchange for smaller runtime code.

@octref
Copy link
Member Author

octref commented Aug 10, 2018

This should fix #430 too.

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

Successfully merging a pull request may close this issue.

2 participants