Skip to content
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
8 changes: 5 additions & 3 deletions src/Microsoft.DotNet.Interactive.CSharp/CSharpKernel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -448,10 +448,12 @@ private async Task<IEnumerable<CompletionItem>> GetCompletionList(string code,
}

var items = new List<CompletionItem>();
foreach (var item in completionList.ItemsList)

foreach (CodeAnalysis.Completion.CompletionItem item in completionList.ItemsList)
{
var description = await service.GetDescriptionAsync(document, item, contextCancellationToken);
var completionItem = item.ToModel(description);
// TODO: Getting a description for each item significantly slows this overall operation. We should look into caching approaches but shouldn't block completions here.
// var description = await service.GetDescriptionAsync(document, item, contextCancellationToken);
var completionItem = item.ToModel(CompletionDescription.Empty);
items.Add(completionItem);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ private static string ResolveRefAssemblyPath()
if (Directory.Exists(appRefDir))
{
var latestRuntimeDirAndVersion =
Directory.GetDirectories(appRefDir)
.Select(dir => Path.GetFileName(dir))
Directory
.GetDirectories(appRefDir)
.Select(Path.GetFileName)
.Select(dir => new { Directory = dir, Version = TryParseVersion(dir, out var version) ? version : new Version() })
.Where(dir => dir.Version <= runtimeVersion)
.OrderByDescending(dirPair => dirPair.Version)
.Select(dirInfo => Path.Combine(appRefDir, dirInfo.Directory, "ref", $"net{dirInfo.Version.Major}.{dirInfo.Version.Minor}"))
.Where(candidateRefDir => Directory.Exists(candidateRefDir))
.FirstOrDefault();
.FirstOrDefault(Directory.Exists);
if (latestRuntimeDirAndVersion is { })
{
refAssemblyDir = latestRuntimeDirAndVersion;
Expand Down
19 changes: 6 additions & 13 deletions src/Microsoft.DotNet.Interactive.Formatting/HtmlFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,6 @@ internal static void FormatAndStyleAsPlainText(
return true;
}),

//new HtmlFormatter<decimal>((d, context) =>
//{
// FormatAndStyleAsPlainText(d, context);
// return true;
//}),


new HtmlFormatter<TimeSpan>((timespan, context) =>
{
PocketView view = span(timespan.ToString());
Expand Down Expand Up @@ -217,12 +210,12 @@ type.Namespace is not null &&
return true;
}),

// decimal should be displayed as plain text
new HtmlFormatter<decimal>((value, context) =>
{
FormatAndStyleAsPlainText(value, context);
return true;
}),
// // decimal should be displayed as plain text
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this it taken out?

// new HtmlFormatter<decimal>((value, context) =>
// {
// FormatAndStyleAsPlainText(value, context);
// return true;
// }),

// Try to display object results as tables. This will return false for nested tables.
new HtmlFormatter<object>((value, context) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ public async Task magic_command_completion_commands_and_events_have_offsets_norm
}

[Theory]
[InlineData(Language.CSharp, "System.Environment.Command$$Line", "Gets the command line for this process.")]
[InlineData(Language.CSharp, "System.Environment.Command$$Line", "Gets the command line for this process.", Skip = "Disabled pending https://github.com/dotnet/interactive/issues/2637")]
public async Task completion_doc_comments_can_be_loaded_from_bcl_types(Language language, string markupCode, string expectedCompletionSubstring)
{
using var kernel = CreateKernel(language);
Expand All @@ -336,7 +336,7 @@ public async Task completion_doc_comments_can_be_loaded_from_bcl_types(Language
}

[Theory]
[InlineData(Language.CSharp, "/// <summary>Adds two numbers.</summary>\nint Add(int a, int b) => a + b;", "Ad$$", "Adds two numbers.")]
[InlineData(Language.CSharp, "/// <summary>Adds two numbers.</summary>\nint Add(int a, int b) => a + b;", "Ad$$", "Adds two numbers.", Skip = "Disabled pending https://github.com/dotnet/interactive/issues/2637")]
[InlineData(Language.FSharp, "/// Adds two numbers.\nlet add a b = a + b", "ad$$", "Adds two numbers.")]
public async Task completion_doc_comments_can_be_loaded_from_source_in_a_previous_submission(Language language, string previousSubmission, string markupCode, string expectedCompletionSubString)
{
Expand All @@ -357,7 +357,7 @@ public async Task completion_doc_comments_can_be_loaded_from_source_in_a_previou
}

[Theory]
[InlineData(Language.CSharp)]
[InlineData(Language.CSharp, Skip = "Disabled pending https://github.com/dotnet/interactive/issues/2637")]
[InlineData(Language.FSharp)]
public async Task completion_contains_doc_comments_from_individually_referenced_assemblies_with_xml_files(Language language)
{
Expand Down Expand Up @@ -394,7 +394,7 @@ public class C
.ContainSingle(ci => !string.IsNullOrEmpty(ci.Documentation) && ci.Documentation.Contains("This is the answer."));
}

[Fact]
[Fact(Skip = "Disabled pending https://github.com/dotnet/interactive/issues/2637")]
public async Task csharp_completions_can_read_doc_comments_from_nuget_packages_after_forcing_the_assembly_to_load()
{
using var kernel = CreateKernel(Language.CSharp);
Expand Down