Using JSON as input for code completion

How can a code completion based on an external JSON file be achieved in MPS?

Example JSON file

{
"name":"John",
"age":30,
"car":"Dodge",
"birth_data":{
"place":"Los Angelis",
"date":"15.02.1990"
}
}

Example DSL:

import "../my.json" as myData

print(myData.name)
print(myData.age)
print(myData.car)
print(myData.birth_data.place)
print(myData.birth_data.date)

So, basically I want to be able to autocomplete within the editor on key that is stored in the json file.

Is it doable in MPS without writing (maybe generating?) concepts related to the JSON's Key/Value?

 

 

Please sign in to leave a comment.