import { Range } from './range'; import { URI } from './uri'; /** * Represents a location inside a resource, such as a line * inside a text file. */ export interface Location { /** * The resource identifier of this location. */ uri: URI; /** * The document range of this locations. */ range: Range; /** * The data associated to this location. */ data: T; } export abstract class Location { static create(uri: URI, range: Range, data: T): Location { return { uri, range, data }; } static forObjectWithRange( uri: URI, obj: T ): Location { return Location.create(uri, obj.range, obj); } }