Skip to content

Commit

Permalink
Merge pull request #392 from fortran-lang/fix/issue-329
Browse files Browse the repository at this point in the history
chore: Fix parent scope issue in FortranAST class
  • Loading branch information
gnikit authored May 10, 2024
2 parents bd931e6 + 8b511d5 commit e25c46b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@

### Fixed

- Fixed bug where parent scope for includes in AST could be `None`
([#329](https://github.com/fortran-lang/fortls/issues/329))
- Fixed preprocessor bug with `if` and `elif` conditionals
([#322](https://github.com/fortran-lang/fortls/issues/322))
- Fixed bug where type fields or methods were not detected if spaces were
Expand Down
5 changes: 3 additions & 2 deletions fortls/parsers/internal/ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,9 @@ def resolve_includes(self, workspace, path: str | None = None):
added_entities = []
for child in include_ast.inc_scope.children:
added_entities.append(child)
parent_scope.add_child(child)
child.update_fqsn(parent_scope.FQSN)
if parent_scope is not None:
parent_scope.add_child(child)
child.update_fqsn(parent_scope.FQSN)
include_ast.none_scope = parent_scope
inc.scope_objs = added_entities

Expand Down

0 comments on commit e25c46b

Please sign in to comment.