File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
SourceKitLSPDevUtils/Sources/ConfigSchemaGen Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -156,10 +156,14 @@ struct OptionSchemaContext {
156
156
}
157
157
let name : String
158
158
if let rawValue = $0. rawValue? . value {
159
- if let stringLiteral = rawValue. as ( StringLiteralExprSyntax . self) , stringLiteral. segments. count == 1 {
160
- name = stringLiteral. segments. first!. description
159
+ if let stringLiteral = rawValue. as ( StringLiteralExprSyntax . self) ,
160
+ let literalValue = stringLiteral. representedLiteralValue
161
+ {
162
+ name = literalValue
161
163
} else {
162
- throw ConfigSchemaGenError ( " Only string literals without interpolation are supported as enum case raw values: \( caseDecl) " )
164
+ throw ConfigSchemaGenError (
165
+ " Only string literals without interpolation are supported as enum case raw values: \( caseDecl) "
166
+ )
163
167
}
164
168
} else {
165
169
name = $0. name. text
You can’t perform that action at this time.
0 commit comments