From 2e09b82d25a67744a774471e551cffbb3a0ef9b5 Mon Sep 17 00:00:00 2001
From: Luthetus <45454132+huntercfreeman@users.noreply.github.com>
Date: Fri, 13 Dec 2024 17:42:46 -0500
Subject: [PATCH 1/2] Update versions
---
Source/Lib/Ide/Ide.RazorLib/Luthetus.Ide.RazorLib.csproj | 2 +-
.../Shareds/Displays/Internals/IdeInfoDisplay.razor | 6 ++++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/Source/Lib/Ide/Ide.RazorLib/Luthetus.Ide.RazorLib.csproj b/Source/Lib/Ide/Ide.RazorLib/Luthetus.Ide.RazorLib.csproj
index b19b4afb7..fedec9484 100644
--- a/Source/Lib/Ide/Ide.RazorLib/Luthetus.Ide.RazorLib.csproj
+++ b/Source/Lib/Ide/Ide.RazorLib/Luthetus.Ide.RazorLib.csproj
@@ -4,7 +4,7 @@
net8.0
enable
enable
- 0.9.7.6
+ 0.9.7.7
diff --git a/Source/Lib/Ide/Ide.RazorLib/Shareds/Displays/Internals/IdeInfoDisplay.razor b/Source/Lib/Ide/Ide.RazorLib/Shareds/Displays/Internals/IdeInfoDisplay.razor
index 6e9b16e73..ed3a4658f 100644
--- a/Source/Lib/Ide/Ide.RazorLib/Shareds/Displays/Internals/IdeInfoDisplay.razor
+++ b/Source/Lib/Ide/Ide.RazorLib/Shareds/Displays/Internals/IdeInfoDisplay.razor
@@ -172,6 +172,12 @@
Recent Changes:
+
v 0.9.7.7 (WIP_DATE)
+
+
+
v 0.9.7.6 (2024-12-13)
- Solution wide parse is 40% faster.
From 82488fc5c7fdb8770e87657cf0c318ee13732cab Mon Sep 17 00:00:00 2001
From: Luthetus <45454132+huntercfreeman@users.noreply.github.com>
Date: Sat, 14 Dec 2024 12:10:38 -0500
Subject: [PATCH 2/2] Fix: embedded C# in Razor files
---
.../Razor/CompilerServiceCase/RazorResource.cs | 4 ++--
.../CompilerServiceCase/SemanticResultRazor.cs | 5 +++--
.../CompilerServices/Razor/RazorSyntaxTree.cs | 16 +++++++++++-----
3 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/Source/Lib/CompilerServices/Razor/CompilerServiceCase/RazorResource.cs b/Source/Lib/CompilerServices/Razor/CompilerServiceCase/RazorResource.cs
index 33f5218b9..bf8037f86 100644
--- a/Source/Lib/CompilerServices/Razor/CompilerServiceCase/RazorResource.cs
+++ b/Source/Lib/CompilerServices/Razor/CompilerServiceCase/RazorResource.cs
@@ -32,9 +32,9 @@ public override IReadOnlyList GetSymbols()
if (localRazorSyntaxTree?.SemanticResultRazor is null)
return Array.Empty();
- var symbols = ((CompilationUnit)localRazorSyntaxTree.SemanticResultRazor.CompilationUnit)
+ var symbols = localRazorSyntaxTree.SemanticResultRazor.CompilationUnit
.Binder
- .SymbolsList;
+ .Symbols;
var originalText = _textEditorService.ModelApi.GetAllText(ResourceUri);
diff --git a/Source/Lib/CompilerServices/Razor/CompilerServiceCase/SemanticResultRazor.cs b/Source/Lib/CompilerServices/Razor/CompilerServiceCase/SemanticResultRazor.cs
index d16d1be06..173f2582d 100644
--- a/Source/Lib/CompilerServices/Razor/CompilerServiceCase/SemanticResultRazor.cs
+++ b/Source/Lib/CompilerServices/Razor/CompilerServiceCase/SemanticResultRazor.cs
@@ -3,6 +3,7 @@
using Luthetus.TextEditor.RazorLib.CompilerServices.Interfaces;
using Luthetus.TextEditor.RazorLib.CompilerServices.Syntax.Nodes;
using Luthetus.TextEditor.RazorLib.Lexers.Models;
+using Luthetus.CompilerServices.CSharp.CompilerServiceCase;
namespace Luthetus.CompilerServices.Razor.CompilerServiceCase;
@@ -27,7 +28,7 @@ public record SemanticResultRazor
/// diagnostics, on hover tooltips, etc...
///
public SemanticResultRazor(
- ICompilationUnit compilationUnit,
+ CSharpCompilationUnit compilationUnit,
List codebehindClassInsertions,
List codebehindRenderFunctionInsertions,
AdhocTextInsertion adhocTextInsertionOfTheRenderFunctionItselfIntoTheCodebehindClass,
@@ -40,7 +41,7 @@ public SemanticResultRazor(
ClassContents = classContents;
}
- public ICompilationUnit CompilationUnit { get; }
+ public CSharpCompilationUnit CompilationUnit { get; }
public List CodebehindClassInsertions { get; }
public List CodebehindRenderFunctionInsertions { get; }
public AdhocTextInsertion AdhocTextInsertionOfTheRenderFunctionItselfIntoTheCodebehindClass { get; }
diff --git a/Source/Lib/CompilerServices/Razor/RazorSyntaxTree.cs b/Source/Lib/CompilerServices/Razor/RazorSyntaxTree.cs
index 86bdf8ef6..0612ec5b5 100644
--- a/Source/Lib/CompilerServices/Razor/RazorSyntaxTree.cs
+++ b/Source/Lib/CompilerServices/Razor/RazorSyntaxTree.cs
@@ -109,17 +109,23 @@ public void ParseCodebehind()
lexer.Lex();
- // TODO: (2024-12-12)
- /*var parser = new CSharpParser(lexer);
-
- var compilationUnit = parser.Parse(new CSharpBinder(), lexer.ResourceUri);
+ var compilationUnit = new CSharpCompilationUnit(
+ _codebehindResourceUri,
+ new CSharpBinder());
+
+ compilationUnit.Lexer = lexer;
+
+ compilationUnit.BinderSession = (CSharpBinderSession)compilationUnit.Binder.StartBinderSession(_codebehindResourceUri);
+
+ var parser = new CSharpParser();
+ parser.Parse(compilationUnit);
SemanticResultRazor = new SemanticResultRazor(
compilationUnit,
_codebehindClassInsertions,
_codebehindRenderFunctionInsertions,
renderFunctionAdhocTextInsertion,
- classContents);*/
+ classContents);
}
/// currentCharacterIn:
-