Skip to content

Attribute error on startup in objects.py resolve_includes #329

Closed
@AnsonKoch

Description

@AnsonKoch

Describe the bug
When starting fortls from VS Code, within particular arrangements of Fortran source code, fortls crashes with an attribute error. This is traced back to objects.py, in the resolve_includes method, where it is caused by parent_scope being None.

To Reproduce
Unsure as to what exactly it is about my source that causes this. Unfortunately, I am unable to share my code here.

Setup information (please complete the following information):

  • OS: windows 10
  • Python Version 3.12
  • fortls Version 2.13.0
  • Code editor used vs code
  • the Fortran extension for the code editor and its version Modern Fortran 3.2.0

Additional context
I edited objects.py by adding an if statement to bypass the problem lines, by checking if parent_scope is not None. This seems to have fixed the problem, but I have not reviewed the fortls code to know if my modification will produce other errors down the road.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions