| 145 | return new Position(line, ch); |
| 146 | } |
| 147 | public getText(range?: Range | undefined): string { |
| 148 | if (!range) { |
| 149 | return this._contents; |
| 150 | } else { |
| 151 | const startOffset = this.convertToOffset(range.start); |
| 152 | const endOffset = this.convertToOffset(range.end); |
| 153 | return this._contents.substr(startOffset, endOffset - startOffset); |
| 154 | } |
| 155 | } |
| 156 | public getWordRangeAtPosition(position: Position, regexp?: RegExp | undefined): Range | undefined { |
| 157 | if (!regexp) { |
| 158 | // use default when custom-regexp isn't provided |