Skip to content

Commit

Permalink
based
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasArvidsson committed Jan 21, 2025
1 parent bf34f5e commit d058d43
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/common/src/types/Position.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export class Position {
* Return a concise string representation of the position. 1-based.
* @returns concise representation
**/
public conciseOneBase(): string {
public conciseOneBased(): string {
return `${this.line + 1}:${this.character + 1}`;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/common/src/types/Range.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ export class Range {
* Return a concise string representation of the range. 1-based.
* @returns concise representation
**/
public conciseOneBase(): string {
return `${this.start.conciseOneBase()}-${this.end.conciseOneBase()}`;
public conciseOneBased(): string {
return `${this.start.conciseOneBased()}-${this.end.conciseOneBased()}`;
}

public toString(): string {
Expand Down
4 changes: 2 additions & 2 deletions packages/common/src/types/Selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ export class Selection extends Range {
* Return a concise string representation of the selection. 1-based.
* @returns concise representation
**/
public conciseOneBase(): string {
return `${this.start.conciseOneBase()}->${this.end.conciseOneBase()}`;
public conciseOneBased(): string {
return `${this.start.conciseOneBased()}->${this.end.conciseOneBased()}`;
}

public toString(): string {
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/types/position.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ suite("Position", () => {

test("concise", () => {
assert.equal(new Position(1, 2).concise(), "1:2");
assert.equal(new Position(1, 2).conciseOneBase(), "2:3");
assert.equal(new Position(1, 2).conciseOneBased(), "2:3");
});
});
2 changes: 1 addition & 1 deletion packages/common/src/types/range.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,6 @@ suite("Range", () => {

test("concise", () => {
assert.equal(new Range(1, 2, 3, 4).concise(), "1:2-3:4");
assert.equal(new Range(1, 2, 3, 4).conciseOneBase(), "2:3-4:5");
assert.equal(new Range(1, 2, 3, 4).conciseOneBased(), "2:3-4:5");
});
});
2 changes: 1 addition & 1 deletion packages/common/src/types/selection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ suite("Selection", () => {

test("concise", () => {
assert.equal(new Selection(1, 2, 3, 4).concise(), "1:2->3:4");
assert.equal(new Selection(1, 2, 3, 4).conciseOneBase(), "2:3->4:5");
assert.equal(new Selection(1, 2, 3, 4).conciseOneBased(), "2:3->4:5");
});
});

0 comments on commit d058d43

Please sign in to comment.