Skip to content

Commit

Permalink
simpler
Browse files Browse the repository at this point in the history
  • Loading branch information
hauner committed Apr 14, 2024
1 parent 152ece7 commit 295ec0a
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,8 @@ class TypeMappingSchemaProvider: ContentAwareJsonSchemaFileProvider {

val start = String(file.virtualFile.inputStream.readNBytes(64))
val regex = Regex("""^${TypeMappingFileType.KEY}:\s+(v\d+)\s*$""", RegexOption.MULTILINE)

val match = regex.find(start)
if (match == null)
return null

val version = match.groups[1]
if (version == null)
return null
val match = regex.find(start) ?: return null
val version = match.groups[1] ?: return null

return getSchema(version.value)
}
Expand Down

0 comments on commit 295ec0a

Please sign in to comment.