mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 18:51:59 +00:00
make sourcegraph.Location fields readonly (#1696)
This commit is contained in:
parent
feca5739ba
commit
c62b279499
@ -304,12 +304,12 @@ declare module 'sourcegraph' {
|
||||
/**
|
||||
* The resource identifier of this location.
|
||||
*/
|
||||
uri: URI
|
||||
readonly uri: URI
|
||||
|
||||
/**
|
||||
* The document range of this location.
|
||||
*/
|
||||
range?: Range
|
||||
readonly range?: Range
|
||||
|
||||
/**
|
||||
* Creates a new location object.
|
||||
|
||||
@ -14,12 +14,9 @@ export class Location implements sourcegraph.Location {
|
||||
return Range.isRange((thing as Location).range) && URI.isURI((thing as Location).uri)
|
||||
}
|
||||
|
||||
public uri: sourcegraph.URI
|
||||
public range?: sourcegraph.Range
|
||||
|
||||
constructor(uri: sourcegraph.URI, rangeOrPosition?: sourcegraph.Range | sourcegraph.Position) {
|
||||
this.uri = uri
|
||||
public readonly range?: sourcegraph.Range
|
||||
|
||||
constructor(public readonly uri: sourcegraph.URI, rangeOrPosition?: sourcegraph.Range | sourcegraph.Position) {
|
||||
if (!rangeOrPosition) {
|
||||
// that's OK
|
||||
} else if (rangeOrPosition instanceof Range) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user