🐞 Segfault when using asset catalog colors
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 38/100
Piste de recherche
Commencez par ContentView.swift dans l’archive EditorThemeReproduction.zip liée et reproduisez le segfault au lancement en utilisant les valeurs NSColor du catalogue d’assets, en particulier NSColor.editorBackground. Comparez la construction défaillante de EditorTheme avec le cas fonctionnel usingColorSpace(.sRGB). C’est terminé lorsque les couleurs du catalogue d’assets peuvent définir un EditorTheme sans conversion explicite de l’espace colorimétrique et que l’application de reproduction se lance sans segfault.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Description
When creating an EditorTheme from asset catalog colours, a segfault occurs at launch unless the background colour is explicitly cast to sRGB (NSColor.editorBackground.usingColorSpace(.sRGB)!).
To Reproduce
- Create a new SwiftUI macOS app
- Add CodeEditSourceEditor as a dependency
- Add sRGB colors sets to the Asset catalog
- Use those colors through NSColor to define an EditorTheme (e.g.
NSColor.editorBackground) - Launch the app
- Something segfaults
- If you set the background to
NSColor.editorBackground.usingColorSpace(.sRGB)!, it doesn't
Expected Behavior
It should be possible to use colours from the asset catalog to define the theme colours without additional hijinks.
Version Information
CodeEditSourceEditor: 0.15.2
macOS: 15.7.4
Xcode: 26.3
Additional Context
Minimal reproduction project: EditorThemeReproduction.zip (ContentView.swift contains all the relevant code.)
How I'm creating the theme (the asset catalog is included with the above project):
extension EditorTheme {
/// Creates an ``EditorTheme`` from colors defined in the asset catalog.
static func fromAssetCatalog() -> Self {
EditorTheme(
text: EditorTheme.Attribute(color: NSColor.editorText),
insertionPoint: NSColor.editorInsertionPoint,
invisibles: EditorTheme.Attribute(color: NSColor.editorInvisibles),
// This segfaults:
background: NSColor.editorBackground,
// This does not, despite the asset catalog color sets being defined as sRGB
// background: NSColor.editorBackground.usingColorSpace(.sRGB)!,
lineHighlight: NSColor.editorLineHighlight,
selection: NSColor.editorSelection,
keywords: EditorTheme.Attribute(
color: NSColor.editorKeywords,
bold: true
),
commands: EditorTheme.Attribute(color: NSColor.editorCommands),
types: EditorTheme.Attribute(color: NSColor.editorTypes),
attributes: EditorTheme.Attribute(color: NSColor.editorAttributes),
variables: EditorTheme.Attribute(color: NSColor.editorVariables),
values: EditorTheme.Attribute(color: NSColor.editorValues),
numbers: EditorTheme.Attribute(color: NSColor.editorNumbers),
strings: EditorTheme.Attribute(color: NSColor.editorStrings),
characters: EditorTheme.Attribute(color: NSColor.editorCharacters),
comments: EditorTheme.Attribute(color: NSColor.editorComments)
)
}
}
Screenshots
- Langage dominant
- Swift
- Étoiles
- 720
- Forks
- 162
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de CodeEditApp/CodeEditSourceEditor
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
CodeEditApp/CodeEditSourceEditor#377 · 1 commentaire ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
CodeEditApp/CodeEditSourceEditor#376 · 1 commentaire ·
-
Difficulté 1/5 1-3 heures Accessibilité débutants 68/100
-
Difficulté 3/5 1-2 jours Accessibilité débutants 68/100
CodeEditApp/CodeEditSourceEditor#378 · 1 commentaire ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 32/100
Toutes les issues de CodeEditApp/CodeEditSourceEditor
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
area:general bug P1 security
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
uttrflow/uttrflow-swift#1333 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
maxgoedjen/secretive#840 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
manaflow-ai/cmux#13763 ·