Skip to content

Commit ad1bb44

Browse files
committed
Line assistant method move to cwtool-vscode
1 parent 706ad90 commit ad1bb44

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/Main/PosHelper.fs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
open CWTools.Utilities.Position
44

5+
module Line =
6+
// Visual Studio uses line counts starting at 0, F# uses them starting at 1
7+
let fromZ (line: Line0) = int line + 1
8+
9+
let toZ (line: int) : Line0 =
10+
LanguagePrimitives.Int32WithMeasure(line - 1)
11+
512
module PosHelper =
6-
let fromZ (line: Line0) idx = mkPos (Line.fromZ line) idx
7-
let toZ (p: pos) = (Line.toZ p.Line, p.Column)
13+
let fromZ (line: Line0) idx = mkPos (Line.fromZ line) idx
14+
let toZ (p: pos) = (Line.toZ p.Line, p.Column)

0 commit comments

Comments
 (0)