Skip to content

Commit

Permalink
[lsp] Fixes sourceUnitNameToUri() path path resolving in relation to …
Browse files Browse the repository at this point in the history
…include paths being used.
  • Loading branch information
christianparpart committed May 16, 2022
1 parent c145eae commit 3f425f3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libsolidity/lsp/FileRepository.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ string FileRepository::sourceUnitNameToUri(string const& _sourceUnitName) const
return "file:///" + _sourceUnitName;
else if (_sourceUnitName.find("/") == 0)
return "file://" + _sourceUnitName;
else if (auto const resolvedPath = tryResolvePath(_sourceUnitName); resolvedPath.message().empty())
return "file://" + resolvedPath.get().generic_string();
else
return "file://" + m_basePath.generic_string() + "/" + _sourceUnitName;
}
Expand Down

0 comments on commit 3f425f3

Please sign in to comment.