Skip to content

RuleScript v1.7.0

Choose a tag to compare

@github-actions github-actions released this 03 Jul 17:12
· 32 commits to main since this release
a40b405

RuleScript v1.7.0

RuleScript v1.7.0 focuses on Navigation API metadata for editor integrations. It adds Core APIs for Go To Definition and Find References without changing parser architecture, semantic analysis behavior, runtime execution, or Rule Script syntax.

Navigation API

Use RuleScriptLanguageService to query one-based source positions:

using RuleScript.Core;

var definition = RuleScriptLanguageService.GetDefinition(source, line: 4, column: 1);
var references = RuleScriptLanguageService.FindReferences(source, line: 4, column: 1);

When navigation needs host function metadata or project import resolution from a configured engine, pass the engine explicitly:

var engine = new RuleScriptEngine
{
    WorkingDirectory = @"C:\rules"
};

var definition = RuleScriptLanguageService.GetDefinition(engine, source, line: 3, column: 1);
var references = RuleScriptLanguageService.FindReferences(engine, source, line: 3, column: 1);

Go To Definition

GetDefinition returns RuleScriptDefinitionInfo? with symbol name, kind, source range, selection range, documentation, external status, parameter metadata, and return type.

For editor adapters that prefer direct coordinates, RuleScriptDefinitionInfo also exposes convenience properties derived from SelectionRange first and then Range:

  • File
  • Line
  • Column
  • EndLine
  • EndColumn

Supported symbols:

  • Local functions.
  • Imported exported functions.
  • Built-in and registered host functions.
  • Function parameters.
  • Local variables.
  • Global variables.

Host functions are external metadata. They expose documentation, parameter information, and return type, but they do not have a source range.

Find References

FindReferences returns IReadOnlyList<RuleScriptReferenceInfo> with declaration and usage metadata. Each reference exposes Range plus direct File, Line, Column, EndLine, and EndColumn convenience properties.

Supported symbols:

  • Functions, including declaration and calls.
  • Imported functions, including current-file uses and import-module references.
  • Host functions, including an external declaration marker and all calls in the current source.
  • Function parameters.
  • Local variables.
  • Global variables.

Compatibility and Scope

  • No new Rule Script keyword or executable syntax is introduced.
  • Runtime execution and Execute behavior are unchanged.
  • Parser, binder, type checker, and module architecture remain intact.
  • RuleScript.Core provides source metadata only. Monaco, Ctrl+Click behavior, peek windows, highlight rendering, and other UI concerns remain outside Core.

Validation

  • Debug build: 0 warnings and 0 errors.
  • Test suite: 587 passed, 0 failed, 0 skipped.