Skip to content

refactor: replace apex-ls with lightweight SFDX class finder#691

Open
jjocoulter wants to merge 23 commits into
certinia:mainfrom
jjocoulter:bug/go-to-with-inner-class-params
Open

refactor: replace apex-ls with lightweight SFDX class finder#691
jjocoulter wants to merge 23 commits into
certinia:mainfrom
jjocoulter:bug/go-to-with-inner-class-params

Conversation

@jjocoulter

@jjocoulter jjocoulter commented Nov 25, 2025

Copy link
Copy Markdown
Contributor

📝 PR Overview

Main (#703) now ships the core "go to definition" fix for Apex symbols — inner-class resolution, constructor support, and character-precise positioning on @apexdevtools/apex-parser 5.x. This branch has been merged up to main, and its scope is now narrowed to the improvements main does not have:

  • ♻️ Removes the @apexdevtools/apex-ls dependency, replacing it with a lightweight in-repo class finder (SfdxProjectReader + SfdxProject + VSWorkspaceManager) that reads sfdx-project.json and indexes **/*.cls.
  • 🔎 Class-level QuickPick when multiple .cls files match a symbol (main only disambiguates per workspace).
  • Namespace-aware routing and project/class-path caching across invocations.
  • 🐛 Broader parameter matching in getMethodLine: strips namespace./System. qualifiers (main strips only the outer class), so go-to resolves methods with fully-qualified logged params like MyClass.doWork(System.List<Account>).

🧩 Type of change (check all applicable)

  • 🐛 Bug fix - something not working as expected
  • ✨ New feature – adds new functionality
  • ♻️ Refactor - internal changes with no user impact
  • ⚡ Performance Improvement
  • 📝 Documentation - README or documentation site changes
  • 🔧 Chore - dev tooling, CI, config
  • 💥 Breaking change

🔗 Related Issues

resolves #834

✅ Tests added?

  • 👍 yes
  • 🙅 no, not needed
  • 🙋 no, I need help

📚 Docs updated?

  • 🔖 README.md
  • 🔖 CHANGELOG.md
  • 📖 help site
  • 🙅 not needed

Anything else we need to know? [optional]

The original inner-class go-to fix that motivated this PR was independently delivered on main via #703, so that work has been dropped here to avoid duplication; only the apex-ls removal, finder, and qualified-parameter matching remain.

@lukecotter lukecotter changed the title feat: improve go-to definition refactor: replace apex-ls with lightweight SFDX class finder Jul 7, 2026
lcottercertinia and others added 3 commits July 7, 2026 18:03
- add SfdxProjectReader/SfdxProject/VSWorkspaceManager to index sfdx-project.json classes, dropping the @apexdevtools/apex-ls dependency for faster go-to in large projects
- strip namespace/System qualifiers on both sides of getMethodLine so methods with fully-qualified logged param types resolve
- expose Context.workspaceManager (replacing workspaces) and route OpenFileInPackage through the new finder
- add RelativePattern/findFiles/asRelativePath to the vscode test mock and drop the dead src/__mocks__/vscode.ts
…ching

- add OpenFileInPackage suite (was 0% covered): symbol parse → find → open flow, not-found and non-exact-match error paths, and line/character positioning
- add ApexSymbolLocator cases for System./namespace-qualified and source-side-qualified params, plus the no-parentheses early return
- extend the vscode test mock with Selection/ViewColumn (needed to exercise showFile) and a null-namespace VSWorkspace grouping case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ feat: replace apex-ls with lightweight SFDX class finder

3 participants