I have had this thought in the back of my head for a while but reading this thread Newbie question: How did fpm figure the dependency graph? - #5 by awvwgk reminded me again. Could we expose the fpm source parsing module and specifically the dependency graph to an API to be queried by VS Code so that we can deduce the correct lint order and allow for project initialisation, even in projects that do not use fpm.
Currently, I implemented an extremely naive algorithm of searching via glob patterns for all Fortran sources and then running them through the linter, which is a hit or miss way of initialising since you can easily lint files out of order.
The functionality that I am suggesting is something along the lines of:
Give a list of Fortran files to fpm/Let fpm find all Fortran files in a directory
Run fpm and deduce the dependency graph of the Fortran files
Return a list of Fortran files, to be run by the linter in the correct order/ Allow fpm to run with the linter arguments (would allow for easy parallel linting if fpm is configured with OpenMP)
It was in the plans. It would facilitate auto-generating CMake and Make files for incorporation into other projects (possibly via an fpm plugin); easy generation of dependency graphics independent of ford and doxygen; and so on. Have not heard much about whether that is active at the moment though.
There are discussion and issue features at the github site that help make tracking the issues easier
that you might want to open something on as well.
Thanks for the heads up @urbanjost. Do you know if the output of --show-model is formatted in some sort of serialisation language e.g. JSON, YAML, TOML etc.
Yeah, that would be great. I think JSON is easier for JS/TS parsing since it is natively supported. I can add it to my TODO list and have a look today.