Skip to content
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

Add support for Apex #2604

Closed
lukethacoder opened this issue Oct 24, 2020 · 1 comment · Fixed by #2622
Closed

Add support for Apex #2604

lukethacoder opened this issue Oct 24, 2020 · 1 comment · Fixed by #2622

Comments

@lukethacoder
Copy link

Language
Apex is a strongly typed, object-oriented programming language that allows developers to execute flow and transaction control statements on Salesforce servers in conjunction with calls to the API. Using syntax that looks like Java and acts like database stored procedures, Apex enables developers to add business logic to most system events, including button clicks, related record updates, and Visualforce pages.

Check out the official docs

Is it worth adding what would essentially be an alias of the java language as an entirely new language definition. Noticed you can alias a language (but still displays as the actual language you're aliasing when using the 'display language' addon), but can you go the other way.

image

Could run this, but seems overkill to add an entire new language definition if its practically the same as the java definition.

// prism-apex.js
;(function (Prism) {
  Prism.languages.apex = Prism.languages.java
})(Prism)
@RunDevelopment
Copy link
Member

Prism's Java language definition is specifically made for Java code. Some of the highlighting is even dependent on Java's naming conventions which aren't enforced in Apex. While an alias may work as a temporary workaround, it's not enough for Prism.

seems overkill to add an entirely new language definition if it's practically the same as the java definition.

I took a look at the doc and the languages seem very different to me. One of the more obvious differences is SOQL and SOSL queries but there are many more besides that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants