Closed rsoesemann closed 6 years ago
@up2go-rsoesemann feel free to do so on this ticket.
I'm a little hesitant on adopting the Apex Language Service for the time being:
I'm not discarding it, I think we should follow it and try to get insight on Salesforce's plans / roadmap on both the Language Server and Jorje, to look for the best alternative.
I agree that there might be many drawbacks and I don't think the Service at a whole might be the right thing for us. But as part of the GitHub repo there might be Jorje parser versions which will be updated more frequently and provide better ASTs than we currently have. Back then when I contributed the Apex module I talked to Salesforce about real support for tooling providers and this is there first step into that future.
I just see this "issue" as an epic story card on our PMD kanban board as a reminder for me to keep an eye on it.
@up2go-rsoesemann great! I assigned you the issue so you can keep an eye on it. Looking forward for updates!
I'm not sure I'm techy enough about PMD to understand what you talk about in detail but if you discuss to use an online service for a component which is a must-have to run PMD locally I highly discourage this. Regarding privacy and copyright reasons and their respective laws it is a bad idea to submit code or information about code to unknown servers in some foreign countries.
This has been an issue in the past already where some developers of a quite commonly used IDE extension had the fabulous idea to submit code to external servers for auto completion without any information or warning.
@up2go-rsoesemann @jsotuyod Hello guys, I would like to clarify some notes about Apex Language Server (the correct name is Server and not Service). First of all it's not an online service, but you will need to run it locally. Actually it's an implementation of Language Server Protocol for Apex (see. https://github.com/forcedotcom/salesforcedx-vscode/wiki/Apex-Language-Server) I believe Salesforce will not update old Jorje parser any more as they switched to a new one. In the near future (next summer) Salesforce is planning to introduce "switch" statement to Apex and I'm not sure if old parser will be able to parse files with new constructions, so I think it's needed to move to a new parser.
Also starting from this October all tools related to Salesforce DX (including this new parser) might be considered as stable (https://developer.salesforce.com/blogs/2017/10/salesforce-dx-is-now-generally-available.html).
P.s. I'm not Salesforce employee
Thanks @steals for clarification. I contact people at Salesforce and already got a few updates here https://twitter.com/RobertSoesemann/status/935883326803664896
As pointed out by Salesforce to @adangel here https://github.com/forcedotcom/idecore/issues/233#issuecomment-341830207 there is also an upgraded Jorje here https://github.com/forcedotcom/salesforcedx-vscode/tree/develop/packages/salesforcedx-vscode-apex/out
@jsotuyod maybe we can just replace the old version we have?
What @steals has said is correct.
Yes, I can see for PMD, it would be hard to just use the Apex LSP as-is since you already have your own protocol and expectations. So, you can continue to use what you had done before. As before, it won't be an officially supported approach, but we would not deliberately break you.
That being said, moving forward, all our tooling efforts will be focused on conforming to the Language Server protocol moving forward (http://langserver.org/).
If you want more information about the language server (specific to Salesforce), you can take a look at my presentation at https://www.salesforce.com/video/1765282/
Thanks @vazexqi for this final clarification. We know know that the LSP is not the right thing for PMD but there is an inofficially updated Jorje we can use.
@jsotuyod I close this one and opened a new issue to replace the old with the new Uber jar at https://github.com/pmd/pmd/issues/766
@vazexqi @up2go-rsoesemann thanks for the input! We will keep looking at that jorje location for future updates.
With their Eclipse IDE Salesforce just beta-released Apex Language Server https://developer.salesforce.com/docs/atlas.en-us.sfdx_ide2.meta/sfdx_ide2/sfdx_ide2_build_app_apex_language_server_protocol.htm to better support tools that need to understand Apex.
This could replace our clunky Jorje parser we currently use. In their Github repos their already is a new Jorje jar https://github.com/forcedotcom/salesforcedx-vscode/tree/develop/packages/salesforcedx-vscode-apex/out
I already contacted Salesforce to learn more. Could you leave this issue open so I can post updates and initiate further discussion?