Prepare a static dictionary of keywords. Create an algorithm to prepare a dynamic dictionary of declared identifiers. This features are best to be implemented at frontend to avoid backend access latencies. A dynamic dictionary may be built for a file that is currently open.
In future there will be need to add all identifiers from imported files. This can be achieved by an asynchronous call as this information updates with import section change only.
Intellisense must suggest keywords and identifiers only when a keyword or identifier expected by parser.
So, a full cycle seems to be like that:
User opens a file to edit
Frontend has a static dictionary prepared
Frontend builds for the first time and then rebuilds on any change in file a dynamic declared identifiers dictionary
Frontend rebuilds imported files dictionary when possible
When Monaco is ready to show context input suggestions (intellisense) popup, parse current line and understand if a keyword or identifier expected
Prepare a static dictionary of keywords. Create an algorithm to prepare a dynamic dictionary of declared identifiers. This features are best to be implemented at frontend to avoid backend access latencies. A dynamic dictionary may be built for a file that is currently open. In future there will be need to add all identifiers from imported files. This can be achieved by an asynchronous call as this information updates with import section change only. Intellisense must suggest keywords and identifiers only when a keyword or identifier expected by parser. So, a full cycle seems to be like that: