Skip to content

Commit

Permalink
🐛 fix Microsoft.CodeAnalysis error when package upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
jxnkwlp committed Aug 3, 2023
1 parent 8d9b73d commit 652ba12
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading;
Expand Down Expand Up @@ -106,31 +105,32 @@ public async Task<WorkflowCSharpEditorCompletionResult> GetCompletionAsync(Workf

var sourceText = await document.GetTextAsync(cancellationToken);

CompletionTrigger completionTrigger = CompletionTrigger.Invoke;
var triggerText = sourceText.GetSubText(position <= 0 ? 0 : position - 1)?.ToString();
if (triggerText.Length > 0)
{
if (triggerText[0] != '.')
completionTrigger = CompletionTrigger.CreateInsertionTrigger(triggerText[0]);
}
//CompletionTrigger completionTrigger = CompletionTrigger.Invoke;
//var triggerText = sourceText.GetSubText(position <= 0 ? 0 : position - 1)?.ToString();
//if (triggerText.Length > 0)
//{
// if (triggerText[0] != '.')
// completionTrigger = CompletionTrigger.CreateInsertionTrigger(triggerText[0]);
//}

var completionResult = await completionService.GetCompletionsAsync(document, position, completionTrigger, cancellationToken: cancellationToken);
var completionResult = await completionService.GetCompletionsAsync(document, position, cancellationToken: cancellationToken);

var results = new List<WorkflowCSharpEditorCompletionItem>();

if (!completionResult.IsEmpty)
{
var textSpanToTextCache = new Dictionary<TextSpan, string>();

var completions = completionResult.ItemsList.Where(x =>
{
if (!textSpanToTextCache.TryGetValue(x.Span, out var spanTxt))
{
spanTxt = textSpanToTextCache[x.Span] = sourceText.GetSubText(x.Span).ToString();
}
var completions = completionResult.ItemsList;
//.Where(x =>
//{
// if (!textSpanToTextCache.TryGetValue(x.Span, out var spanTxt))
// {
// spanTxt = textSpanToTextCache[x.Span] = sourceText.GetSubText(x.Span).ToString();
// }

return helper.MatchesPattern(x, spanTxt, CultureInfo.InvariantCulture);
});
// return helper.MatchesPattern(x, spanTxt, CultureInfo.InvariantCulture);
//});

foreach (var item in completions)
{
Expand Down

0 comments on commit 652ba12

Please sign in to comment.