From 652ba12d6e60957cbc4975b46f2b38425da54128 Mon Sep 17 00:00:00 2001 From: jxnkwlp Date: Thu, 3 Aug 2023 20:31:06 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20`Microsoft.CodeAnalysis`?= =?UTF-8?q?=20error=20when=20package=20upgrade?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...gwind.Abp.ElsaModule.ElsaExtensions.csproj | 2 +- .../Services/WorkflowCSharpEditorService.cs | 36 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/Passingwind.Abp.ElsaModule.ElsaExtensions/Passingwind.Abp.ElsaModule.ElsaExtensions.csproj b/src/Passingwind.Abp.ElsaModule.ElsaExtensions/Passingwind.Abp.ElsaModule.ElsaExtensions.csproj index eb6c5a3..a988e25 100644 --- a/src/Passingwind.Abp.ElsaModule.ElsaExtensions/Passingwind.Abp.ElsaModule.ElsaExtensions.csproj +++ b/src/Passingwind.Abp.ElsaModule.ElsaExtensions/Passingwind.Abp.ElsaModule.ElsaExtensions.csproj @@ -1,4 +1,4 @@ - + diff --git a/src/Passingwind.Abp.ElsaModule.ElsaExtensions/Services/WorkflowCSharpEditorService.cs b/src/Passingwind.Abp.ElsaModule.ElsaExtensions/Services/WorkflowCSharpEditorService.cs index 6007d2e..5838fb5 100644 --- a/src/Passingwind.Abp.ElsaModule.ElsaExtensions/Services/WorkflowCSharpEditorService.cs +++ b/src/Passingwind.Abp.ElsaModule.ElsaExtensions/Services/WorkflowCSharpEditorService.cs @@ -1,6 +1,5 @@ -using System; +using System; using System.Collections.Generic; -using System.Globalization; using System.Linq; using System.Text; using System.Threading; @@ -106,15 +105,15 @@ public async Task 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(); @@ -122,15 +121,16 @@ public async Task GetCompletionAsync(Workf { var textSpanToTextCache = new Dictionary(); - 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) {