grain
grain copied to clipboard
feat(lsp): Allow goto definition on `include` statements
This pr allows for you to use go to definition on Include statements.
Work for: #1624
Note:
As we did not reference the source module from the include statement before this change required adding that attr, The best way I could find to do it was when we got the module name. An alternative approach would have been to pass the sod.pinc_path.txt on in include_module but this would lead to inconsistencies with the include format.
Is there not a valid location for the included module available from the environment?
Is there not a valid location for the included module available from the environment?
I looked for one but couldn't find it.
I spent some time looking into this and I don't see an easy path forward right now. The method you're using right now to get the source is a bit fragile because it's looking at where the object file is rather than where the source is. We may want to just add a field to the objects that points to the source so we can read it from there.