Skip to content

Commit a772247

Browse files
committed
Fix concurrency warnings
The static props can just return the string on the fly, not an actually issue.
1 parent bda034d commit a772247

File tree

2 files changed

+55
-54
lines changed

2 files changed

+55
-54
lines changed

Sources/CodeEditor/Language.swift

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
// CodeEditor
44
//
55
// Created by Helge Heß.
6-
// Copyright © 2021 ZeeZide GmbH. All rights reserved.
6+
// Copyright © 2021-2024 ZeeZide GmbH. All rights reserved.
77
//
88

99
public extension CodeEditor {
1010

1111
@frozen
12-
struct Language: TypedString {
12+
struct Language: TypedString, Sendable {
1313

1414
public let rawValue : String
1515

@@ -20,45 +20,45 @@ public extension CodeEditor {
2020

2121
public extension CodeEditor.Language {
2222

23-
static var accesslog = CodeEditor.Language(rawValue: "accesslog")
24-
static var actionscript = CodeEditor.Language(rawValue: "actionscript")
25-
static var ada = CodeEditor.Language(rawValue: "ada")
26-
static var apache = CodeEditor.Language(rawValue: "apache")
27-
static var applescript = CodeEditor.Language(rawValue: "applescript")
28-
static var bash = CodeEditor.Language(rawValue: "bash")
29-
static var basic = CodeEditor.Language(rawValue: "basic")
30-
static var brainfuck = CodeEditor.Language(rawValue: "brainfuck")
31-
static var c = CodeEditor.Language(rawValue: "c")
32-
static var cpp = CodeEditor.Language(rawValue: "cpp")
33-
static var cs = CodeEditor.Language(rawValue: "cs")
34-
static var css = CodeEditor.Language(rawValue: "css")
35-
static var diff = CodeEditor.Language(rawValue: "diff")
36-
static var dockerfile = CodeEditor.Language(rawValue: "dockerfile")
37-
static var go = CodeEditor.Language(rawValue: "go")
38-
static var http = CodeEditor.Language(rawValue: "http")
39-
static var java = CodeEditor.Language(rawValue: "java")
40-
static var javascript = CodeEditor.Language(rawValue: "javascript")
41-
static var json = CodeEditor.Language(rawValue: "json")
42-
static var lua = CodeEditor.Language(rawValue: "lua")
43-
static var markdown = CodeEditor.Language(rawValue: "markdown")
44-
static var makefile = CodeEditor.Language(rawValue: "makefile")
45-
static var nginx = CodeEditor.Language(rawValue: "nginx")
46-
static var objectivec = CodeEditor.Language(rawValue: "objectivec")
47-
static var pgsql = CodeEditor.Language(rawValue: "pgsql")
48-
static var php = CodeEditor.Language(rawValue: "php")
49-
static var python = CodeEditor.Language(rawValue: "python")
50-
static var ruby = CodeEditor.Language(rawValue: "ruby")
51-
static var rust = CodeEditor.Language(rawValue: "rust")
52-
static var shell = CodeEditor.Language(rawValue: "shell")
53-
static var smalltalk = CodeEditor.Language(rawValue: "smalltalk")
54-
static var sql = CodeEditor.Language(rawValue: "sql")
55-
static var swift = CodeEditor.Language(rawValue: "swift")
56-
static var tcl = CodeEditor.Language(rawValue: "tcl")
57-
static var tex = CodeEditor.Language(rawValue: "tex")
58-
static var twig = CodeEditor.Language(rawValue: "twig")
59-
static var typescript = CodeEditor.Language(rawValue: "typescript")
60-
static var vbnet = CodeEditor.Language(rawValue: "vbnet")
61-
static var vbscript = CodeEditor.Language(rawValue: "vbscript")
62-
static var xml = CodeEditor.Language(rawValue: "xml")
63-
static var yaml = CodeEditor.Language(rawValue: "yaml")
23+
@inlinable static var accesslog : Self { Self(rawValue: "accesslog") }
24+
@inlinable static var actionscript : Self { Self(rawValue: "actionscript") }
25+
@inlinable static var ada : Self { Self(rawValue: "ada") }
26+
@inlinable static var apache : Self { Self(rawValue: "apache") }
27+
@inlinable static var applescript : Self { Self(rawValue: "applescript") }
28+
@inlinable static var bash : Self { Self(rawValue: "bash") }
29+
@inlinable static var basic : Self { Self(rawValue: "basic") }
30+
@inlinable static var brainfuck : Self { Self(rawValue: "brainfuck") }
31+
@inlinable static var c : Self { Self(rawValue: "c") }
32+
@inlinable static var cpp : Self { Self(rawValue: "cpp") }
33+
@inlinable static var cs : Self { Self(rawValue: "cs") }
34+
@inlinable static var css : Self { Self(rawValue: "css") }
35+
@inlinable static var diff : Self { Self(rawValue: "diff") }
36+
@inlinable static var dockerfile : Self { Self(rawValue: "dockerfile") }
37+
@inlinable static var go : Self { Self(rawValue: "go") }
38+
@inlinable static var http : Self { Self(rawValue: "http") }
39+
@inlinable static var java : Self { Self(rawValue: "java") }
40+
@inlinable static var javascript : Self { Self(rawValue: "javascript") }
41+
@inlinable static var json : Self { Self(rawValue: "json") }
42+
@inlinable static var lua : Self { Self(rawValue: "lua") }
43+
@inlinable static var markdown : Self { Self(rawValue: "markdown") }
44+
@inlinable static var makefile : Self { Self(rawValue: "makefile") }
45+
@inlinable static var nginx : Self { Self(rawValue: "nginx") }
46+
@inlinable static var objectivec : Self { Self(rawValue: "objectivec") }
47+
@inlinable static var pgsql : Self { Self(rawValue: "pgsql") }
48+
@inlinable static var php : Self { Self(rawValue: "php") }
49+
@inlinable static var python : Self { Self(rawValue: "python") }
50+
@inlinable static var ruby : Self { Self(rawValue: "ruby") }
51+
@inlinable static var rust : Self { Self(rawValue: "rust") }
52+
@inlinable static var shell : Self { Self(rawValue: "shell") }
53+
@inlinable static var smalltalk : Self { Self(rawValue: "smalltalk") }
54+
@inlinable static var sql : Self { Self(rawValue: "sql") }
55+
@inlinable static var swift : Self { Self(rawValue: "swift") }
56+
@inlinable static var tcl : Self { Self(rawValue: "tcl") }
57+
@inlinable static var tex : Self { Self(rawValue: "tex") }
58+
@inlinable static var twig : Self { Self(rawValue: "twig") }
59+
@inlinable static var typescript : Self { Self(rawValue: "typescript") }
60+
@inlinable static var vbnet : Self { Self(rawValue: "vbnet") }
61+
@inlinable static var vbscript : Self { Self(rawValue: "vbscript") }
62+
@inlinable static var xml : Self { Self(rawValue: "xml") }
63+
@inlinable static var yaml : Self { Self(rawValue: "yaml") }
6464
}

Sources/CodeEditor/ThemeName.swift

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
// CodeEditor
44
//
55
// Created by Helge Heß.
6-
// Copyright © 2021 ZeeZide GmbH. All rights reserved.
6+
// Copyright © 2021-2024 ZeeZide GmbH. All rights reserved.
77
//
88

99
public extension CodeEditor {
1010

1111
@frozen
12-
struct ThemeName: TypedString {
12+
struct ThemeName: TypedString, Sendable {
1313

1414
public let rawValue : String
1515

@@ -20,14 +20,15 @@ public extension CodeEditor {
2020

2121
public extension CodeEditor.ThemeName {
2222

23-
static var `default` = pojoaque
23+
@inlinable static var `default` : Self { pojoaque }
24+
@inlinable static var pojoaque : Self { Self(rawValue: "pojoaque") }
25+
@inlinable static var agate : Self { Self(rawValue: "agate") }
26+
@inlinable static var ocean : Self { Self(rawValue: "ocean") }
2427

25-
static var pojoaque = CodeEditor.ThemeName(rawValue: "pojoaque")
26-
static var agate = CodeEditor.ThemeName(rawValue: "agate")
27-
static var ocean = CodeEditor.ThemeName(rawValue: "ocean")
28-
29-
static var atelierSavannaLight =
30-
CodeEditor.ThemeName(rawValue: "atelier-savanna-light")
31-
static var atelierSavannaDark =
32-
CodeEditor.ThemeName(rawValue: "atelier-savanna-dark")
28+
@inlinable
29+
static var atelierSavannaLight : Self {
30+
Self(rawValue: "atelier-savanna-light") }
31+
@inlinable
32+
static var atelierSavannaDark : Self {
33+
Self(rawValue: "atelier-savanna-dark") }
3334
}

0 commit comments

Comments
 (0)