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

refactor(langauge-core): codegen based on Generator #3778

Merged
merged 24 commits into from
Dec 6, 2023

Conversation

johnsoncodehk
Copy link
Member

To reduce codegen function context, for past code:

function generateScript() {

	const codes = [];

	return codes;

	function generateSrc() {
		codes.push(...);
	}
	function generateHelperTypes() {
		codes.push(...);
	}
}

It should refactor to:

function generateScript() {

	yield* generateSrc();
	yield* generateHelperTypes();

	function generateSrc() {
		yield ...;
	}
	function generateHelperTypes() {
		yield ...;
	}
}

And codegen should be able to split into smaller files more easily in the future.

Base automatically changed from volar-1.12 to master December 6, 2023 13:54
@johnsoncodehk johnsoncodehk merged commit f0d1af7 into master Dec 6, 2023
6 checks passed
@johnsoncodehk johnsoncodehk deleted the refactor-codegen branch December 6, 2023 14:03
so1ve pushed a commit to so1ve/language-tools that referenced this pull request Dec 7, 2023
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.

1 participant