Skip to content

Commit 919157f

Browse files
authored
Merge pull request #40 from SuyogSoti/master
Make it so that the output will be a link to the line of the file of the todo instead of just text
2 parents 479c571 + d46edfd commit 919157f

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/types/TodoType.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,18 @@ export class TodoType {
2626
}
2727

2828
getDisplayString(): string {
29-
let path = `${this.getFile().getName()}:${this.getLineNumber()}`;
29+
let url = this.getFile().getFile().uri.toString();
30+
// to take it to the properline
31+
let middle = "#";
32+
// what if the file is not saved?
33+
if (url.split(":")[0].toString() == "untitled") {
34+
middle = "; Line Number: ";
35+
}
36+
let path = url + middle + this.getLineNumber();
3037
return `From ${path}\n----------------------------------\n${this.getContent()}`;
3138
}
3239

3340
toString(): string {
34-
return this.getFile().toString() + "\n" + this.getContent.toString();
41+
return this.getFile() + "\n" + this.getContent;
3542
}
36-
}
43+
}

0 commit comments

Comments
 (0)