microsoft / design-to-code

A system of development tools, and utilities used à la carte or as a suite to build enterprise-grade websites and applications.
MIT License
24 stars 6 forks source link

Add a utility to identify the position of a dictionary item in Monaco Editor #94

Closed janechu closed 2 years ago

janechu commented 2 years ago

Pull Request

📖 Description

This PR adds a utility function for finding a dictionary item by ID in a Monaco Editor value. This uses the parse from vscode-html-languageservice to traverse the DOM structure and is consolidated with the DataDictionary which is then reinterpreted into columns and line numbers for the Monaco Editors position.

🎫 Issues

Addresses the first bullet in #53

👩‍💻 Reviewer Notes

Check to make sure the logic and comments are clear. This may not be the most efficient solution as it traverses the complete tree until it finds the dictionary item, however optimizations may come later from the use of this function in the MonacoAdapter class.

✅ Checklist

General

⏭ Next Steps