Table of Contents

Class TextLocation

Namespace
RDCore.SDK.Assistant
Assembly
RDCore.SDK.Protocol.dll

A range of a document of the workspace, as the tools of an assistant say it.

public sealed record TextLocation : IEquatable<TextLocation>
Inheritance
TextLocation
Implements
Inherited Members

Constructors

TextLocation(string, TextRange)

A range of a document of the workspace, as the tools of an assistant say it.

public TextLocation(string Path, TextRange Range)

Parameters

Path string

The document's path relative to the workspace root, with / between folders (src/Module1.bas); absolute for a document outside the root.

Range TextRange

The range, 1-based.

Properties

Path

The document's path relative to the workspace root, with / between folders (src/Module1.bas); absolute for a document outside the root.

public string Path { get; init; }

Property Value

string

Range

The range, 1-based.

public TextRange Range { get; init; }

Property Value

TextRange

Methods

Of(string, Uri, SourceRange)

The location of a range of a document, its path said from the workspace root (PathOf(string, Uri)).

public static TextLocation Of(string workspaceRoot, Uri document, SourceRange range)

Parameters

workspaceRoot string

The workspace root: a folder.

document Uri

The document: a file: URI.

range SourceRange

The range, 0-based.

Returns

TextLocation

The location.

PathOf(string, Uri)

The path of a document as a tool says it: relative to the workspace root, with / between folders; the absolute path of a document outside the root.

public static string PathOf(string workspaceRoot, Uri document)

Parameters

workspaceRoot string

The workspace root: a folder.

document Uri

The document: a file: URI.

Returns

string

The path.

ToString()

The location as a listing writes it: src/Module1.bas:12:5.

public override string ToString()

Returns

string

The path and the start of the range.

UriOf(string, string)

The document a tool's argument names: a path relative to the workspace root (with / or the platform's separator between folders), or absolute.

public static Uri UriOf(string workspaceRoot, string path)

Parameters

workspaceRoot string

The workspace root: a folder.

path string

The path the argument gives.

Returns

Uri

The document's file: URI.

Exceptions

ArgumentException

path is empty, or is not a path.