Position.hx 648 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package foo.display;
  2. /**
  3. Position in a text document expressed as 1-based line and character offset.
  4. **/
  5. typedef Position = {
  6. /**
  7. Line position in a document (1-based).
  8. **/
  9. var line:Int;
  10. /**
  11. Character offset on a line in a document (1-based).
  12. **/
  13. var character:Int;
  14. }
  15. /**
  16. A range in a text document expressed as (1-based) start and end positions.
  17. **/
  18. typedef Range = {
  19. /**
  20. The range's start position
  21. **/
  22. var start:Position;
  23. /**
  24. The range's end position
  25. **/
  26. var end:Position;
  27. }
  28. /**
  29. Represents a location inside a resource, such as a line inside a text file.
  30. **/
  31. typedef Location = {
  32. var file:FsPath;
  33. var range:Range;
  34. }