grain icon indicating copy to clipboard operation
grain copied to clipboard

feat(lsp): Allow goto definition on `include` statements

Open spotandjake opened this issue 1 year ago • 3 comments

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.

spotandjake avatar Feb 15 '24 00:02 spotandjake

Is there not a valid location for the included module available from the environment?

ospencer avatar Feb 21 '24 17:02 ospencer

Is there not a valid location for the included module available from the environment?

I looked for one but couldn't find it.

spotandjake avatar Feb 21 '24 17:02 spotandjake

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.

ospencer avatar Jul 28 '24 20:07 ospencer