Skip to content

refactor(language-core): make embeddedCodes optional in VirtualCode#137

Merged
johnsoncodehk merged 2 commits intomasterfrom
embedded-codes-optional
Feb 20, 2024
Merged

refactor(language-core): make embeddedCodes optional in VirtualCode#137
johnsoncodehk merged 2 commits intomasterfrom
embedded-codes-optional

Conversation

@remcohaszing
Copy link
Member

In many cases embeddedCodes is always empty. It might as well be optional.

In many cases `embeddedCodes` is always empty. It might as well be
optional.
@rchl
Copy link
Contributor

rchl commented Feb 20, 2024

Breaking change (maybe someone relies on it being an empty array and uses length check)? If so, is it really worth changing?

@remcohaszing
Copy link
Member Author

For Volar VirtualCode is input. volar-services doesn’t use embeddedCodes anywhere. So this could indeed be a breaking change, but only on a type level. This is easy to resolve using a non-null assertion or optional chaining.

@johnsoncodehk johnsoncodehk changed the title Make embeddedCodes optional in VirtualCode refactor(language-core): make embeddedCodes optional in VirtualCode Feb 20, 2024
@johnsoncodehk
Copy link
Member

johnsoncodehk commented Feb 20, 2024

I agree that embeddedCodes should be optional, the purpose of it being required in the past was to guide developers to implement embedded code (due to lack of documentation). But I'm sure we'll make progress on the documentation soon.

Since this is a breaking change, this will be released in 2.1 (Volar does not follow semantic versioning)

@johnsoncodehk johnsoncodehk merged commit d18261b into master Feb 20, 2024
@remcohaszing remcohaszing deleted the embedded-codes-optional branch February 20, 2024 16:15
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.

3 participants