Skip to content

Commit

Permalink
Merge pull request #371 from Luthetus/staging
Browse files Browse the repository at this point in the history
Staging
  • Loading branch information
Luthetus authored Dec 14, 2024
2 parents 6d83c08 + 520047f commit 15f46f5
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 10 deletions.
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

0 comments on commit 15f46f5

Please sign in to comment.