raml-org / api-modeling-framework

DEPRECATED - This project has been moved
https://github.com/aml-org/amf
Other
27 stars 11 forks source link

Interactive edition of the spec text in the monaco editor #23

Open antoniogarrote opened 7 years ago

antoniogarrote commented 7 years ago

Once the app has become really editable, we should try to provide some auto-completion features through the Monaco editor we are using to display the text of the different syntaxes for the model.

The lexical information for the tokens in the editor matching the nodes in the model is available for YAML/RAML parsed models and should be exposed through the class LexicalInfo but the connection is missing.

You can track how the information is generated, merged into the YAM AST as meta-data, and finally added to the model elements.

That's the information that should be exposed through the LexicalInfo TS class. Debugging and finishing the elementLexicalInfo function in model_proxy.ts should be enough for getting the lexical inforamtion available.

The lexical information is not present in the JSON parser.

Changing the implementation of api-modelling-framework.parser.syntax.json/parse-string to get an AST using some JSON-AST library as we are doing with the YAML parser might be an option for JSON/OpenAPI.