I've been plugging away at porting the TypeScript VS Code extension into Nim. There are a number of design issues I'm running into and they're centered around how to reason about nim files, projects, and determining what the user most likely intends. I'd like to avoid IDE specific config and instead keep things as light as possible, the nim/nims/cfg/nimble files and directory layouts should do the heavy lifting.
Without solving too much at once, I'm trying to get a mental model around a "project". The most burning question I believe that would answer is how to reason about nimsuggest usage. Influencing:
As far as any IDE is concerned, one of two things happens:
2. a user opens a folder and then all sorts of projects might exist In the second case there is a requirement for a deep model.
What follows is my attempt at building up a model as I haven't really found anything online that does this.
Single nim file project directory, with:
Single nimscript file project
Single nim file project and nimscript config
Single nim file project, nimscript config, and project .nim.cfg
Many nim files and project foo -- other details handled by above
Many nim files, foo.nim project, bar.nim is queried via nimsuggest foo.nim but that's probably not right if we try to run bar.nim just by itself?
These are things that I know will be required, but I haven't modeled.
TODO nimble based project:
Also very much ignoring:
My current concern is that I'm not seeing strong delineations and a very large degree of variance is allowed -- that's rather frightening. I'm hoping that's entirely my newness.