Replies: 3 comments
-
I'm happy to try and get this added but upon deeper review it appears the current If possible to get that disabled I'm happy to work on teaching the Javascript side how to handle managing the type files but I suspect that would be a significant change and probably need a lot of discussion. I'm sure there would be lots of edge cases in the existing code that would need to be accounted for. |
Beta Was this translation helpful? Give feedback.
-
@aheber Thank you so much for sharing your ideas with us. Our team is working on enhancing the language server and look out for upcoming releases to try out the new updates. |
Beta Was this translation helpful? Give feedback.
-
I think #4684 bug is related and we have a WI for the same. |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
Using
Go to Definition
in an LWC on an Apex AuraEnabled method takes me to Type Declaration files (d.ts
) generated by the Apex Lang Server, not to the Apex class that actually owns the code.Describe the solution you'd like
When generating the
d.ts
file I'd like it to generated.ts.map
files next to thed.ts
files. This would allow Go To Reference to take us to the Apex Class instead of the declaration file.Describe alternatives you've considered
You could probably customize the LWC language server but I don't have a lot of experience with that.
I expect there might be considerations if the Apex is owned by the org and not hosted locally. I'm not sure if VSCode currently generated Type files for that Apex anyway.
Additional context
I have a script that can read the Apex files and generate both the
d.ts
as well as thed.ts.map
files. Happy to share this if it would be helpful. It is in no way production ready but it outlines the steps and values needed.The script is built on top of a library for parsing Apex but I'm sure it would be easy enough using the Jorje compiler. I did it using the WASM version of the code so it could be more portable, I was able to process the ~1100 apex files in our main codebase in about 3 seconds, including parsing and writing both type files.
https://github.com/aheber/tree-sitter-sfapex
Beta Was this translation helpful? Give feedback.
All reactions