You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Accurate include paths and preprocessor definitions via CMake #133
The vscode CMake Tools extension talks to the C/C++ extension API to provide accurate preprocessor definitions and include paths. If vscode-fortran-support would provide a similar API then the CMake Tools extension could use it in the same way. This would avoid having to manually configure include paths etc. if CMake is used as build system.
Reacted by Nagy-Egri Máté Ferenc, Qiang, Sebastian Müller, gnikit, Albert Ziegenhagel and Renier Marchand
I think I should clarify what the status of this feat req is. You can have extremely accurate and functional include paths by using glob patterns. So using cmake to have accurate include paths is not that important anymore.
The circumstances that I can foresee this being the only solution are:
There are conflicting include files, hence using a global include would lead to linter conflicts. Although I am not sure if that is possible when you use the -fsyntax-only flag.
You want a plug and play experience with your build system i.e. not having to configure linter paths manually.
The use case I have for this is a complex and always changing compile environment.
The compile environment that I'm working in, has a large set of dependencies and the versions used change often. This is all managed using multiple include paths with specific versions. It would really help if cmake information could be used to configure fortls environment.
Supporting cmake projects via a compile_commands.json or any similar mechanism would be very much welcome. I work on a very large cmake project with several changing sub-projects and external dependencies. The predominant language is C++ with some Fortran. clangd works very well here, using compile_commands.json. However, try as I might, I can't get fortls to understand how to include the various modules, which are are distributed between sub-projects.
It feels like there's a very real opportunity to have a plug and play experience with the linter, given that's exactly what clangd does with compile_commands.json.
Alternatively, any advice on how to convert a compile_commands.json file to a suitable .fortls file would be very much welcome.
Activity
MuellerSeb commentedon Apr 22, 2020
Any news on this?
machsix commentedon Sep 7, 2021
https://github.com/rizsotto/Bear
This looks like a cool tool if someone prefer Makefile
gnikit commentedon May 9, 2022
I think I should clarify what the status of this feat req is. You can have extremely accurate and functional include paths by using glob patterns. So using cmake to have accurate include paths is not that important anymore.
The circumstances that I can foresee this being the only solution are:
-fsyntax-onlyflag.renierm commentedon Jun 22, 2024
The use case I have for this is a complex and always changing compile environment.
The compile environment that I'm working in, has a large set of dependencies and the versions used change often. This is all managed using multiple include paths with specific versions. It would really help if cmake information could be used to configure fortls environment.
Basically, the conflicting include file scenario.
odlomax commentedon Jul 9, 2025
Supporting cmake projects via a
compile_commands.jsonor any similar mechanism would be very much welcome. I work on a very large cmake project with several changing sub-projects and external dependencies. The predominant language is C++ with some Fortran.clangdworks very well here, usingcompile_commands.json. However, try as I might, I can't getfortlsto understand how to include the various modules, which are are distributed between sub-projects.It feels like there's a very real opportunity to have a plug and play experience with the linter, given that's exactly what
clangddoes withcompile_commands.json.Alternatively, any advice on how to convert a
compile_commands.jsonfile to a suitable.fortlsfile would be very much welcome.machsix commentedon May 9, 2026
fortls may support this feature soon
fortran-lang/fortls#512