Skip to content

Needed changes for Notebook UI Support #1321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,18 @@ public CodeLens ResolveCodeLens(CodeLens codeLens, ScriptFile scriptFile)
continue;
}

DocumentUri uri = DocumentUri.From(foundReference.FilePath);
// For any vscode-notebook-cell, we need to ignore the backing file on disk.
if (uri.Scheme == "file" &&
scriptFile.DocumentUri.Scheme == "vscode-notebook-cell" &&
uri.Path == scriptFile.DocumentUri.Path)
{
continue;
}

acc.Add(new Location
{
Uri = DocumentUri.From(foundReference.FilePath),
Uri = uri,
Range = foundReference.ScriptRegion.ToRange()
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,10 @@ internal static List<string> GetLinesInternal(string text)
internal static bool IsUntitledPath(string path)
{
Validate.IsNotNull(nameof(path), path);

return path.ToLower().StartsWith("untitled:");
return string.Equals(
DocumentUri.From(path).Scheme,
Uri.UriSchemeFile,
StringComparison.OrdinalIgnoreCase);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ public bool TryGetFile(DocumentUri documentUri, out ScriptFile scriptFile)
// List supported schemes here
case "file":
case "untitled":
case "vscode-notebook-cell":
break;

default:
Expand Down