Skip to content

Commit

Permalink
Fix document file path (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcz717 authored Jan 25, 2022
1 parent 1214338 commit a8bc916
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions LsifDotnet/Lsif/LsifIndexer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected record CachedSymbolResult(int ResultSetId, int? DefinitionResultId, in
public async IAsyncEnumerable<LsifItem> EmitLsif()
{
var solution = Workspace.CurrentSolution;
yield return new MetaDataVertex(NextId(), ToAbsoluteUri(solution.FilePath));
yield return new MetaDataVertex(NextId(), ToAbsoluteUri(Path.GetDirectoryName(solution.FilePath)));

foreach (var project in solution.Projects)
{
Expand Down Expand Up @@ -174,10 +174,9 @@ private bool SkipSymbol(ISymbol symbol, SyntaxToken token)
return false;
}

private static string ToAbsoluteUri(string? filePath)
private static string ToAbsoluteUri(string? path)
{
var directoryName = Path.GetDirectoryName(filePath);
return directoryName == null ? string.Empty : new Uri(directoryName).AbsoluteUri;
return path == null ? string.Empty : new Uri(path).AbsoluteUri;
}

private static bool NotKnownIdentifier(SyntaxToken token)
Expand Down

0 comments on commit a8bc916

Please sign in to comment.