-
Notifications
You must be signed in to change notification settings - Fork 1
W-20813627: Introduce precompiled standard apex library artifact to apex-ls #192
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
Conversation
Replaces the ZIP + on-demand parsing startup flow with a pre-serialized Protocol Buffers binary cache for faster language server startup. Changes: - Add proto schema for Standard Apex Library types (apex-stdlib.proto) - Add build-time scripts to generate protobuf TypeScript types and cache - Add cache serializer/deserializer for converting between SymbolTable and protobuf - Add StandardLibraryCacheLoader with automatic ZIP fallback - Update ResourceLoader to use protobuf cache when available - Add .pb file loaders to all esbuild configs for proper bundling - Add comprehensive test suite for cache loading and equivalence - Add performance benchmarks for comparing cache vs ZIP loading The protobuf cache provides ~10-20x faster startup by eliminating ANTLR parsing. Falls back to ZIP-based loading if cache is unavailable or corrupted.
Replaces the ZIP + on-demand parsing startup flow with a pre-serialized Protocol Buffers binary cache for faster language server startup. Changes: - Add proto schema for Standard Apex Library types (apex-stdlib.proto) - Add build-time scripts to generate protobuf TypeScript types and cache - Add cache serializer/deserializer for converting between SymbolTable and protobuf - Add StandardLibraryCacheLoader with automatic ZIP fallback - Update ResourceLoader to use protobuf cache when available - Add .pb file loaders to all esbuild configs for proper bundling - Add comprehensive test suite for cache loading and equivalence - Add performance benchmarks for comparing cache vs ZIP loading The protobuf cache provides ~10-20x faster startup by eliminating ANTLR parsing. Falls back to ZIP-based loading if cache is unavailable or corrupted.
chore(apex-parser-ast): auto-generate protobuf cache as part of compile Restructure Wireit tasks to automatically generate protobuf stdlib cache after TypeScript compilation. This ensures protobuf cache files are available for tests and runtime without manual intervention. - Rename compile task to compile:tsc (actual TypeScript compilation) - Create compile wrapper task that depends on both compile:tsc and generate:stdlib-cache - Update generate:stdlib-cache to depend on compile:tsc instead of compile
…output producers (#195) * build: refine bundle dependencies to depend directly on output producers - Change bundle dependencies from precompile/compile to compile:tsc/generate:stdlib-cache - Remove out/resources/** from bundle files array (tracked via precompile dependency) This ensures bundle depends directly on the scripts that produce its required outputs, improving wireit's dependency tracking and cache invalidation. build: fix wireit cache invalidation for protobuf artifacts - Remove out/resources/** from precompile output declaration - Remove output declaration from compile script (outputs tracked via dependencies) - Add out/resources/** and out/index.d.ts to bundle files array for esbuild resolution - Keep resources/apex-stdlib-v*.pb.gz in bundle files array as required input This ensures wireit properly tracks outputs through dependency chains while still allowing esbuild to resolve required files at build time. * refactor: move embedded ZIP loading into ResourceLoader Move ZIP buffer loading logic from LCSAdapter into ResourceLoader's initialize() method. ResourceLoader now handles both protobuf cache and ZIP buffer loading internally, making it more self-contained. - ResourceLoader.initialize() now automatically loads embedded ZIP - Added loadEmbeddedZipBuffer() and logLoadingStatistics() methods - LCSAdapter no longer needs to manually call setZipBuffer() - Updated tests to reflect new internal loading behavior
|
I guess it's not that important, but while testing locally I ran into an issue running |
|
Seems like the compile step could use some bullet proofing to use string quote protected filepaths in case of naming including whitespaces like you mentioned. Please write up a bug for that and we can address it soon to harden the compilation process. |
WI for the above mentioned: W-21045435 |
Summary
Test plan
npm run compileinapex-parser-astforceZipFallback: true)npm testinapex-parser-astnpm run test:bench(if available).pb.gzfiles via dataurl loaderChanges Overview
apex-stdlib.protodefining message types forStandardLibrary,TypeSymbol,MethodSymbol,VariableSymbol, etc.stdlib-serializer.tsconverts SymbolTable → protobuf binarystdlib-deserializer.tsconverts protobuf binary → SymbolTablestdlib-cache-loader.tshandles runtime loading with automatic ZIP fallbackgenerate-stdlib-cache.mjspre-processes ~5,500 standard library classes at build timeforceZipFallbackoption.pband.pb.gzloaders across all packages for proper bundling@W-20813627@