Skip to content
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

Optimizations #370

Merged
merged 3 commits into from
Dec 14, 2024
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 @@ -32,9 +32,9 @@ public override IReadOnlyList<ITextEditorSymbol> GetSymbols()
if (localRazorSyntaxTree?.SemanticResultRazor is null)
return Array.Empty<ITextEditorSymbol>();

var symbols = ((CompilationUnit)localRazorSyntaxTree.SemanticResultRazor.CompilationUnit)
var symbols = localRazorSyntaxTree.SemanticResultRazor.CompilationUnit
.Binder
.SymbolsList;
.Symbols;

var originalText = _textEditorService.ModelApi.GetAllText(ResourceUri);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -27,7 +28,7 @@ public record SemanticResultRazor
/// diagnostics, on hover tooltips, etc...
/// </summary>
public SemanticResultRazor(
ICompilationUnit compilationUnit,
CSharpCompilationUnit compilationUnit,
List<AdhocTextInsertion> codebehindClassInsertions,
List<AdhocTextInsertion> codebehindRenderFunctionInsertions,
AdhocTextInsertion adhocTextInsertionOfTheRenderFunctionItselfIntoTheCodebehindClass,
Expand All @@ -40,7 +41,7 @@ public SemanticResultRazor(
ClassContents = classContents;
}

public ICompilationUnit CompilationUnit { get; }
public CSharpCompilationUnit CompilationUnit { get; }
public List<AdhocTextInsertion> CodebehindClassInsertions { get; }
public List<AdhocTextInsertion> CodebehindRenderFunctionInsertions { get; }
public AdhocTextInsertion AdhocTextInsertionOfTheRenderFunctionItselfIntoTheCodebehindClass { get; }
Expand Down
16 changes: 11 additions & 5 deletions Source/Lib/CompilerServices/Razor/RazorSyntaxTree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/// <summary>currentCharacterIn:<br/> -<see cref="InjectedLanguageDefinition.TransitionSubstring"/><br/></summary>
Expand Down
2 changes: 1 addition & 1 deletion Source/Lib/Ide/Ide.RazorLib/Luthetus.Ide.RazorLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>0.9.7.6</Version>
<Version>0.9.7.7</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@
Recent Changes:
<div>
<div>
<div>v <em class="luth_em">0.9.7.7 </em> (WIP_DATE)</div>
<ul>
<li>WIP_DESCRIPTION</li>
</ul>
</div>
<div>
<div>v <em class="luth_em">0.9.7.6 </em> (2024-12-13)</div>
<ul>
<li>Solution wide parse is 40% faster.</li>
Expand Down