lonely-lockley / archinsight

Simplicity in Code, Power in Design
https://archinsight.org
GNU Affero General Public License v3.0
51 stars 5 forks source link

Improve intellisense behavior in code editor #48

Open lonely-lockley opened 1 year ago

lonely-lockley commented 1 year ago

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:

  1. User opens a file to edit
  2. Frontend has a static dictionary prepared
  3. Frontend builds for the first time and then rebuilds on any change in file a dynamic declared identifiers dictionary
  4. Frontend rebuilds imported files dictionary when possible
  5. When Monaco is ready to show context input suggestions (intellisense) popup, parse current line and understand if a keyword or identifier expected
  6. Make correct suggestions
lonely-lockley commented 7 months ago

Added naive intellisense implementation without dynamic completion list build in #74

lonely-lockley commented 4 months ago

After #85 the only thing left here - add dynamic suggestions of declared imports and identifiers