Skip to content

Add Salesforce symbol indexing#9

Merged
Zelys-DFKH merged 1 commit into
DFKHelper:mainfrom
krzysztofwojt:feat/salesforce-symbol-index
Jul 9, 2026
Merged

Add Salesforce symbol indexing#9
Zelys-DFKH merged 1 commit into
DFKHelper:mainfrom
krzysztofwojt:feat/salesforce-symbol-index

Conversation

@krzysztofwojt

Copy link
Copy Markdown
Contributor

Summary:

  • Add Apex and Salesforce metadata language support.
  • Extract symbols for Apex declarations and common Salesforce metadata entities.
  • Cover detection and extraction with synthetic parser tests.

Verification:

  • npm test -- tests/parser_types.test.ts tests/salesforce_languages.test.ts
  • npm run typecheck
  • eslint changed files
  • npm run build
  • git diff --check

Comment thread src/parser.ts Outdated
if (language === 'proto') return extractProto(content, filePath).symbols
if (language === 'powershell') return extractPowershell(content, filePath).symbols
if (language === 'apex') return extractApex(content, filePath).symbols
if (language === 'salesforce_metadata') {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this one not a one-liner, like the rest?

Comment thread tests/parser_types.test.ts Outdated
go: 'a.go',
c: 'a.c',
cpp: 'a.cpp',
ruby: 'a.rb',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this added here? Are those changes related to Salesforce?

@krzysztofwojt krzysztofwojt force-pushed the feat/salesforce-symbol-index branch from 708becf to 956b72e Compare July 9, 2026 17:36
@Zelys-DFKH

Copy link
Copy Markdown
Collaborator

Thanks for this, Krzysztof. Apex and Salesforce metadata were a real gap here, and the implementation shows it: apex.ts and salesforce_metadata.ts reuse the same helpers the other regex adapters use, the wiring is right, and the test fixtures are real Apex and metadata XML, not toy strings.

On your question about tests/parser_types.test.ts: that file had an exhaustiveness test meant to fail compilation if a Language variant had no test case. Turns out it never actually worked. tsconfig.json only includes src/**/*, so tests/ is never type-checked, and vitest doesn't type-check either. That test was already missing 15 languages with zero CI failures. Your change didn't break anything real. I'll fix or drop that guard myself in a follow-up.

Also saw you already fixed the one-liner style issue in parser.ts yourself. Reads clean now.

One small non-blocking nit: in apex.ts, typeNames.has(name) checks every type name in the file, not just the enclosing class, so a method could get mistagged as a constructor if it shares a name with an unrelated class elsewhere. Fine to leave for later.

Ready to merge from here. Thanks for the careful work, and for flagging what you weren't sure about instead of guessing.

@krzysztofwojt krzysztofwojt force-pushed the feat/salesforce-symbol-index branch from 956b72e to 66d3484 Compare July 9, 2026 20:06
@Zelys-DFKH Zelys-DFKH added the enhancement New feature or request label Jul 9, 2026
@Zelys-DFKH Zelys-DFKH marked this pull request as ready for review July 9, 2026 20:24
@Zelys-DFKH Zelys-DFKH merged commit ae2f35b into DFKHelper:main Jul 9, 2026
2 checks passed
@krzysztofwojt

krzysztofwojt commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Hi @Zelys-DFKH, sorry, this PR was in draft staus, I was actively working on it, and those questions were directed to my Codex :D Code from this PR has some holes, especially for profiles, where whole profiles are getting indexed, which makes no sense. In a moment I'll open a full pull request with a fix for that and tests fully performed ;)

EDIT: no, my bad, I pushed profile-related changes to this PR, so we're fine with that. However, I opened another pull request anyway, with extension of handled salesforce metadata, inluding LWC components.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants