(pos: IPosition)
| 291 | } |
| 292 | |
| 293 | getNodeAtPosition(pos: IPosition) { |
| 294 | const model = this.model(); |
| 295 | |
| 296 | if (!(model && this.tree.valid())) { |
| 297 | return undefined; |
| 298 | } |
| 299 | |
| 300 | const text = this.text(); |
| 301 | |
| 302 | // Get the offset of the current cursor in the entire document. |
| 303 | let offset = model.getOffsetAt(pos); |
| 304 | if (text[offset] === "\n" && text[offset - 1] === ",") { |
| 305 | offset--; |
| 306 | } |
| 307 | |
| 308 | return this.tree.findNodeAtOffset(offset); |
| 309 | } |
| 310 | |
| 311 | // Register a drag event handler to support dragging files to the editor. |
| 312 | listenOnDropFile() { |
no test coverage detected