Comments (4)
This has bugged me a bit to and I have done a fast fix that looks like this:
(defun edts-find-callers (module function arity)
"Jump to any all functions calling `module':`function'/`arity' in the
current buffer's project."
(edts-log-info "Finding callers of %s:%s/%s" module function arity)
(let* ((callers (edts-get-who-calls module function arity))
(caller-items (mapcar #'edts-function-popup-item callers)))
(edts-do-find-callers caller-items)
(edts-find-first-apperence-in-fun module function)))
(defun edts-find-first-apperence-in-fun (module function)
(let ((cur-module (ferl-get-module))
(mark (copy-marker (point-marker)))
(re (if (string-equal module cur-module)
function
(concat module ":" function))))
(if (re-search-forward re nil t)
(progn
(beginning-of-line)
(ring-insert-at-beginning (edts-window-history-ring) mark))
(null (goto-char mark)))))
I'm far from a lisp expert so there is probably a better a more accurate way to do it but it's a start.
- edts-find-first-apperence-in-fun is a new function
- edts-find-callers is modified to call edts-find-first-apperence-in-fun
It just searches for the first appearance of module:function after the point of the calling function head. Regexp needs to better so not comments etc are chosen.
from edts.
Actually having looked at it, it's pretty straight forward to get this information straight out of xref. I just need to update the api a little. I'll try to get to it since I'm currently rewiring all of the xref code anyway.
from edts.
Sometimes things are really easy. The fix is in master now.
from edts.
Nice! I started to look at the server code but since I have never used xref before I hit a wall with that, but it felt like that was to place to really change and not my fast hack.
Keep up the good work, I use edts every day for work and it just keeps getting better
from edts.
Related Issues (20)
- eproject: invalid-read-syntax HOT 3
- Does the OTP release of the EDTS node and the project node need to be the same? HOT 5
- Merging with OTP? HOT 4
- Starting node fails HOT 7
- How to run EDTS when the R19 patches haven't been merged HOT 1
- error on beam file without outdir in compile options not compiled in ebin directory HOT 1
- Command to compile current module in edts-shell HOT 8
- Windows: Could not start main server HOT 2
- project node constantly being reinitialized for each newly opened file HOT 4
- rebar3 mode for filename_to_outdir HOT 1
- EDTS Erlang files are not compiled as part of package installation HOT 4
- How to start edts with many user in 1 machine? HOT 1
- Symbol's value as variable is void: erlang-operators-regexp HOT 3
- EDTS sub package meck fails to compile on OTP 21 HOT 3
- EDTS stopped working when upgrading to OTP21 HOT 2
- edts-20200209.1523 work fail HOT 2
- When compiling MELPA package: can't find include file "otp_workarounds.hrl" HOT 1
- edts-rpc-port hardcoded to 4587
- edts-plugin-disabled-plugins default value and type mismatch HOT 2
- {error,"Release \"edts\" uses non existing application mochiweb"} HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from edts.