-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCloudFormationLanguage.scala
24 lines (18 loc) · 1.19 KB
/
CloudFormationLanguage.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package cloudformation
import miksilo.editorParser.parsers.editorParsers.UntilTimeStopFunction
import miksilo.languageServer.core.language.Language
import miksilo.languageServer.languages.{JsonLanguage, YamlLanguage}
import miksilo.modularLanguages.core.SolveConstraintsDelta
import miksilo.modularLanguages.core.deltas.{Delta, LanguageFromDeltas, ParseUsingTextualGrammar}
import miksilo.modularLanguages.deltas.json.ModularJsonLanguage
import miksilo.modularLanguages.deltas.yaml.ModularYamlLanguage
class CloudFormationLanguage(resourceSpecificationOption: Option[String]) {
val cloudFormationTemplate = new CloudFormationTemplate(resourceSpecificationOption)
val jsonDeltas: Seq[Delta] = Seq(cloudFormationTemplate) ++
ModularJsonLanguage.deltas ++ Seq(SolveConstraintsDelta)
val jsonLanguage: Language = LanguageFromDeltas(Seq(ParseUsingTextualGrammar(UntilTimeStopFunction(200))) ++ jsonDeltas)
val yamlDeltas: Seq[Delta] = Seq(ModularYamlLanguage.parserDelta) ++
Seq(ConvertObjectMemberKeysToStrings, ConvertTagsToObjectDelta, cloudFormationTemplate) ++
ModularYamlLanguage.deltasWithoutParser ++ Seq(SolveConstraintsDelta)
val yamlLanguage: Language = LanguageFromDeltas(yamlDeltas)
}