{"action":"created","issue":{"url":"https://api.github.com/repos/emacs-ess/ESS/issues/553","repository_url":"https://api.github.com/repos/emacs-ess/ESS","labels_url":"https://api.github.com/repos/emacs-ess/ESS/issues/553/labels{/name}","comments_url":"https://api.github.com/repos/emacs-ess/ESS/issues/553/comments","events_url":"https://api.github.com/repos/emacs-ess/ESS/issues/553/events","html_url":"https://github.com/emacs-ess/ESS/issues/553","id":326441998,"number":553,"title":"srcref jumping with dangling srcfiles","user":{"login":"lionel-","id":4465050,"avatar_url":"https://avatars2.githubusercontent.com/u/4465050?v=4","gravatar_id":"","url":"https://api.github.com/users/lionel-","html_url":"https://github.com/lionel-","followers_url":"https://api.github.com/users/lionel-/followers","following_url":"https://api.github.com/users/lionel-/following{/other_user}","gists_url":"https://api.github.com/users/lionel-/gists{/gist_id}","starred_url":"https://api.github.com/users/lionel-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lionel-/subscriptions","organizations_url":"https://api.github.com/users/lionel-/orgs","repos_url":"https://api.github.com/users/lionel-/repos","events_url":"https://api.github.com/users/lionel-/events{/privacy}","received_events_url":"https://api.github.com/users/lionel-/received_events","type":"User","site_admin":false},"labels":[{"id":870569610,"url":"https://api.github.com/repos/emacs-ess/ESS/labels/symbols:refs","name":"symbols:refs","color":"bc9eed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-25T09:11:34Z","updated_at":"2018-05-29T09:06:51Z","closed_at":null,"author_association":"MEMBER","body":"When a package is installed from a transient location (as would be the case when installing from CRAN or github), the source files recorded in the srcrefs no longer exist and this prevents xref jumping.\r\n\r\nAs it turns out, the srcrefs contain a full copy of their original file:\r\n\r\n```r\r\nsrcref <- attr(fn, \"srcref\")\r\nsrcfile <- attr(srcref, \"srcfile\")\r\nsrcfile$lines\r\n```\r\n\r\nWe could first check if `srcfile$filename` points to an actual file. If not the case, we'd walk over all functions in the namespace to collect all `srcfile` environments and then regenerate a copy of the source in a temporary location. Further jumps would redirect there.\r\n\r\nWhat do you think @vspinu @atheriel ?"},"comment":{"url":"https://api.github.com/repos/emacs-ess/ESS/issues/comments/392706452","html_url":"https://github.com/emacs-ess/ESS/issues/553#issuecomment-392706452","issue_url":"https://api.github.com/repos/emacs-ess/ESS/issues/553","id":392706452,"user":{"login":"vspinu","id":1363467,"avatar_url":"https://avatars3.githubusercontent.com/u/1363467?v=4","gravatar_id":"","url":"https://api.github.com/users/vspinu","html_url":"https://github.com/vspinu","followers_url":"https://api.github.com/users/vspinu/followers","following_url":"https://api.github.com/users/vspinu/following{/other_user}","gists_url":"https://api.github.com/users/vspinu/gists{/gist_id}","starred_url":"https://api.github.com/users/vspinu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vspinu/subscriptions","organizations_url":"https://api.github.com/users/vspinu/orgs","repos_url":"https://api.github.com/users/vspinu/repos","events_url":"https://api.github.com/users/vspinu/events{/privacy}","received_events_url":"https://api.github.com/users/vspinu/received_events","type":"User","site_admin":false},"created_at":"2018-05-29T09:06:51Z","updated_at":"2018-05-29T09:06:51Z","author_association":"MEMBER","body":"Regenerate full namespace is an overkill (plus, sources of some functions can change and keeping a cache asks for trouble). \r\n\r\nSecond step should be (and is already there) to look into `ess-r-package-library-paths` for the package with the same name, if not found a temporary copy of the source should be created through dump-to-file functionality (not yet implemented; was my task but I am slacking :/)."}}
{"actor":{"display_login":"vspinu"}}