Make SyntaxTheme::new_test only available in tests (#11909)

This PR addresses a TODO comment by making `SyntaxTheme::new_test` only
available in tests.

We needed to make it available when the `test-support` feature was
enabled for it to be used in tests outside of the `theme` crate.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-05-16 09:30:29 -04:00 committed by GitHub
parent f2e7c635ac
commit 4ba57d730b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -127,7 +127,7 @@ impl SyntaxTheme {
} }
} }
// TODO: Get this working with `#[cfg(test)]`. Why isn't it? #[cfg(any(test, feature = "test-support"))]
pub fn new_test(colors: impl IntoIterator<Item = (&'static str, Hsla)>) -> Self { pub fn new_test(colors: impl IntoIterator<Item = (&'static str, Hsla)>) -> Self {
SyntaxTheme { SyntaxTheme {
highlights: colors highlights: colors