Skip to content

Commit aa7daeb

Browse files
committed
Add types to docstrings
1 parent 3b43432 commit aa7daeb

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

lib_src/misc/cells.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ import { getLine } from "./blocks.js"
66

77
import { Point, TextEditor } from "atom"
88

9+
/**
10+
* @param {TextEditor} editor
11+
* @returns {[Point, Point]}
12+
*/
913
export function getRange(editor: TextEditor): [Point, Point] {
1014
// Cell range is:
1115
// Start of line below top delimiter (and/or start of top row of file) to
@@ -48,6 +52,9 @@ export function getRange(editor: TextEditor): [Point, Point] {
4852
return [start, end]
4953
}
5054

55+
/**
56+
* @param {TextEditor} editor
57+
*/
5158
export function get(editor: TextEditor) {
5259
if (editor.getGrammar().scopeName.indexOf("source.julia") > -1) {
5360
return jlGet(editor)
@@ -56,6 +63,9 @@ export function get(editor: TextEditor) {
5663
}
5764
}
5865

66+
/**
67+
* @param {TextEditor} editor
68+
*/
5969
function jlGet(editor: TextEditor) {
6070
const range = getRange(editor)
6171
let text = editor.getTextInBufferRange(range)
@@ -72,6 +82,9 @@ function jlGet(editor: TextEditor) {
7282
return [res]
7383
}
7484

85+
/**
86+
* @param {TextEditor | null | undefined} editor
87+
*/
7588
export function moveNext(editor: TextEditor | null | undefined) {
7689
if (!editor) {
7790
editor = atom.workspace.getActiveTextEditor()
@@ -88,6 +101,9 @@ export function moveNext(editor: TextEditor | null | undefined) {
88101
}
89102
}
90103

104+
/**
105+
* @param {TextEditor} editor
106+
*/
91107
function jlMoveNext(editor: TextEditor) {
92108
const range = getRange(editor)
93109
const sel = editor.getSelections()[0]
@@ -98,6 +114,9 @@ function jlMoveNext(editor: TextEditor) {
98114
])
99115
}
100116

117+
/**
118+
* @param {TextEditor | undefined | null} editor
119+
*/
101120
export function movePrev(editor: TextEditor | undefined | null) {
102121
if (!editor) {
103122
editor = atom.workspace.getActiveTextEditor()
@@ -113,6 +132,9 @@ export function movePrev(editor: TextEditor | undefined | null) {
113132
}
114133
}
115134

135+
/**
136+
* @param {TextEditor} editor
137+
*/
116138
function jlMovePrev(editor: TextEditor) {
117139
const range = getRange(editor)
118140
const prevRow = range[0].row - 2 // 2 = 1 to get to delimiter line + 1 more to go past it

0 commit comments

Comments
 (0)