Skip to content

Refactoring: centralize uri computation in solidlsp #1080

@MischaPanch

Description

@MischaPanch

The code computing

        absolute_file_path = Path(self.repository_root_path, relative_file_path)
        uri = absolute_file_path.as_uri()

is repeated all over the place in slight variations. We also may compute absolute paths in various places. We should introduce an internal _FilePath dataclass with entries relative_path, absolute_path, uri and a method _get_file_path(relative_path), and use that everywhere.

Affects code in ls.py and downstream in solidlsp

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions