Fix: support #include hover and go-to-definition in nvim#529
Open
Ayushishivhare09 wants to merge 5 commits intofortran-lang:masterfrom
Open
Fix: support #include hover and go-to-definition in nvim#529Ayushishivhare09 wants to merge 5 commits intofortran-lang:masterfrom
Ayushishivhare09 wants to merge 5 commits intofortran-lang:masterfrom
Conversation
for more information, see https://pre-commit.ci
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #529 +/- ##
==========================================
+ Coverage 44.43% 46.91% +2.48%
==========================================
Files 35 35
Lines 4803 4832 +29
==========================================
+ Hits 2134 2267 +133
+ Misses 2669 2565 -104 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
This PR adds proper support for preprocessor #include statements in fortls when using Neovim or any LSP client. Previously, #include statements were not recognized for hover or go-to-definition.
Key changes:
Added tracking for preprocessor #include statements (pp_include_statements) in FortranAST and pp_includes in FortranFile.
Resolves #include paths relative to the current file and include_dirs.
Updated langserver.py to provide go-to-definition for #include lines.
Added comprehensive tests for both normal and nested #include statements.
Minor cleanup and refactoring in debug and preprocessor code.
Testing:
Verified go-to-definition and hover for #include statements.
All existing tests pass successfully.
Impact:
Fully backward-compatible; standard Fortran INCLUDE behavior is unchanged.
Improves developer experience for projects using preprocessors.
Fixes#498