-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reference resolution in errors #88
Comments
Although I like the principle of pervasive reference resolution, I doubt whether reference resolution from eclipse views will be worth this implementation effort. Double-clicking the message in the Problems View should already resolve to the message location, and from there it should be easy to navigate to definitions of involved variables/functions etc. |
That is not as easy as it might seem. I should also note that in this workflow, the error is actually a debug message (using I can see how this specific use case is probably not too common. I am done working on generics, so right now even I am don't have this use case. However, when you do have many errors with stacktraces it becomes very hard to work with. |
I think it would be better if spoofax tried to integrate better with code navigation services IDE's provide, rather than doing such an overhaul in the Statix language. I'll talk about this with Daniel sometime. |
Short description
Allow CTRL + click on a function or variable name in errors to go to the declaration of that name or variable
Problem description.
Current process to debug an error: look at error in the eclipse Problems View, (optionally copy to text file for easier reading), decide which of the functions / variables to look into, manually navigate to the position in the source code (either by knowing where it is or searching for the function name).
Describe the solution you'd like
Reference resolution from function names / variables in errors in
stxresult
files and the Eclipse error view to their declaration instxtest
orstx
files, such that I can CTRL+click (Command+click on Mac) on a name to go to the declaration immediately.If a variable or function is generated by Statix, it should refer to the constraint or function that generated it.
Note that there are four locations where I would like this reference resolution:
stxresult
files (perhaps possible after Navigation in Test Results #85, although depending on the implementation it will require cross-language reference resolution)Either one of 2, 3 or 4 would be enough to go to definition for errors in programs.
Describe alternatives you've considered
As is noted in the solution, getting this to work for programs will likely be a lot of work. An alternative solution for 3 is to implement a custom Problems View where we can parse and analyze the errors. This seems like one of the more feasible options, along with option 4. If we are implementing a custom error view anyway, it may be possible to include the full stacktrace and terms in errors, but to collapse them if they become too big, with the option of clicking to unfold it.
Note
Right now I don't feel like this is that useful, especially given how much work it will be to implement this. However, I felt the same about reference resolution in scope graphs, and that turned out to be extremely convenient.
The text was updated successfully, but these errors were encountered: