extensions icon indicating copy to clipboard operation
extensions copied to clipboard

Add Salesforce Apex extension

Open brianevanmiller opened this issue 1 year ago • 7 comments

Provides syntax highlighting for the Salesforce "Apex" language

brianevanmiller avatar Sep 23 '24 12:09 brianevanmiller

We require contributors to sign our Contributor License Agreement, and we don't have @brianevanmiller on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

cla-bot[bot] avatar Sep 23 '24 12:09 cla-bot[bot]

@cla-bot check

brianevanmiller avatar Sep 23 '24 12:09 brianevanmiller

The cla-bot has been summoned, and re-checked this pull request!

cla-bot[bot] avatar Sep 23 '24 12:09 cla-bot[bot]

@maxdeviant - I fixed the ID mismatch

brianevanmiller avatar Sep 23 '24 17:09 brianevanmiller

It looks like there is an issue with the Tree-sitter grammar:

Error: failed to compile extension

Caused by:
    0: failed to compile grammar 'apex'
    1: failed to compile apex parser with clang: clang: error: no such file or directory: '/home/runner/work/extensions/extensions/extensions/apex/grammars/apex/src/parser.c'
       

    at genericNodeError (node:internal/errors:984:15)
    at wrappedFn (node:internal/errors:538:14)
    at ChildProcess.exithandler (node:child_process:422:12)
    at ChildProcess.emit (node:events:519:28)
    at maybeClose (node:internal/child_process:1105:16)
    at ChildProcess._handle.onexit (node:internal/child_process:[30](https://github.com/zed-industries/extensions/actions/runs/11219620923/job/31185983310?pr=1449#step:11:31)5:5) {
  code: 1,
  killed: false,
  signal: null,
  cmd: './zed-extension --scratch-dir ./scratch --source-dir extensions/apex --output-dir output'
}

It looks like the Apex Tree-sitter grammar keeps the grammar in a subdirectory: https://github.com/aheber/tree-sitter-sfapex/tree/943a3eb7f55733929ccafe06841087c3004cb4e0/apex

So you'll to specify that in the path under your grammar config in your extension.toml:

[grammars.apex]
repository = "https://github.com/aheber/tree-sitter-sfapex"
commit = "c99ad4b16d112fea91745e3f1b769754239fdaba"
path = "apex"

maxdeviant avatar Oct 07 '24 16:10 maxdeviant

Thank you @maxdeviant, I added the path in this commit 👍🏻

brianevanmiller avatar Oct 08 '24 12:10 brianevanmiller

Looks like there's a problem in one of the Tree-sitter queries:

[2024-10-08T16:17:21Z INFO  zed_extension] loaded grammar apex
Error: Query error at 13:4. Invalid node type list_initializer

maxdeviant avatar Oct 08 '24 16:10 maxdeviant

I'm going to go ahead and close because there hasn't been any activity in a while. Happy to review a subsequent PR if you pick this up again in the future. Thanks.

notpeter avatar Nov 28 '24 03:11 notpeter