Reworked diagnostics, saves line positions in memory, instead of calculating later.
This commit is contained in:
@@ -7,9 +7,9 @@ namespace Upsilon.Utilities
|
||||
{
|
||||
public static class SearchHelper
|
||||
{
|
||||
public static BoundScope GetScopeAt(this BoundScript script, int characterPosition)
|
||||
public static BoundScope GetScopeAt(this BoundScript script, int linePosition, int characterPosition)
|
||||
{
|
||||
foreach (var node in script.GetNodeAtPosition(characterPosition))
|
||||
foreach (var node in script.GetNodeAtPosition(linePosition, characterPosition))
|
||||
{
|
||||
if (node is IBoundNodeScopeOwner scopeOwner && scopeOwner.Scope != null)
|
||||
{
|
||||
@@ -19,14 +19,14 @@ namespace Upsilon.Utilities
|
||||
return script.Scope;
|
||||
}
|
||||
|
||||
public static BoundNode GetBottomNodeAtPosition(this BoundNode node, int characterPosition)
|
||||
public static BoundNode GetBottomNodeAtPosition(this BoundNode node, int linePosition, int characterPosition)
|
||||
{
|
||||
return node.GetNodeAtPosition(characterPosition).First();
|
||||
return node.GetNodeAtPosition(linePosition, characterPosition).First();
|
||||
}
|
||||
|
||||
public static BoundStatement GetBottomStatementAtPosition(this BoundNode node, int characterPosition)
|
||||
|
||||
public static BoundStatement GetBottomStatementAtPosition(this BoundNode node, int linePosition, int characterPosition)
|
||||
{
|
||||
return (BoundStatement) node.GetNodeAtPosition(characterPosition).First(x => x is BoundStatement);
|
||||
return (BoundStatement) node.GetNodeAtPosition(linePosition, characterPosition).First(x => x is BoundStatement);
|
||||
}
|
||||
|
||||
public static Dictionary<string, VariableSymbol> GetBoundScopeVisibleVariables(this BoundScope scope)
|
||||
|
||||
Reference in New Issue
Block a user