{"id":16451722,"url":"https://github.com/tpolecat/sourcepos","last_synced_at":"2025-03-21T05:30:37.925Z","repository":{"id":37636424,"uuid":"326806941","full_name":"tpolecat/SourcePos","owner":"tpolecat","description":"Micro-library that provides source file name and line number.","archived":false,"fork":false,"pushed_at":"2022-11-21T19:32:12.000Z","size":27,"stargazers_count":33,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-20T15:58:13.710Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tpolecat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-04T21:03:10.000Z","updated_at":"2024-12-11T12:06:21.000Z","dependencies_parsed_at":"2023-01-21T12:01:38.310Z","dependency_job_id":null,"html_url":"https://github.com/tpolecat/SourcePos","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpolecat%2FSourcePos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpolecat%2FSourcePos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpolecat%2FSourcePos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpolecat%2FSourcePos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tpolecat","download_url":"https://codeload.github.com/tpolecat/SourcePos/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244745641,"owners_count":20503043,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T10:10:08.307Z","updated_at":"2025-03-21T05:30:37.490Z","avatar_url":"https://github.com/tpolecat.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SourcePos\n\nThis is a Scala micro-library that provides:\n\n- a `SourcePos` class that specifies a source file and line number, and\n- an implicit macro that forges a `SourcePos` at the call site if none is available.\n\nSourcePos is compiled for Scala **2.12**, **2.13**, and **3.0** (see release notes for exact versions).\n\n\n```scala\nlibraryDependencies += \"org.tpolecat\" %% \"sourcepos\" % \u003cversion\u003e\n```\n\n#### Example\n\nIf you want to know where a method call originated, demand an implicit `SourcePos`. It has fields for both `file` and `line`, and a `toString` that prints them as `\u003cfile\u003e:\u003cline\u003e`, which most editors will hyperlink for you.\n\n```scala\nimport org.tpolecat.sourcepos._\n\nobject Example {\n\n  def method(n: Int)(implicit sp: SourcePos): String =\n    s\"You called me with $n from $sp\"\n\n  def main(args: Array[String]): Unit =\n    println(method(42))\n\n}\n```\n\nRunning this program on my computer yields:\n\n```\nYou called me with 42 from /Users/rnorris/Scala/SourcePos/src/test/scala/Example.scala:9\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpolecat%2Fsourcepos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftpolecat%2Fsourcepos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpolecat%2Fsourcepos/lists"}