chore: Simplify extension#24
Closed
attitude wants to merge 2 commits into
Closed
Conversation
Owner
Author
|
Superseded by #25 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
providers.ts: ExtracteddelegateLocationProvider()helper shared byPHPXDefinitionProvider,PHPXTypeDefinitionProvider, andPHPXImplementationProvider— eliminated ~60 lines of triplicated boilerplate. SimplifiedmapLocationLinkToSourceusing a singleremapUrivariable instead of three mutable lets. Removed deadPHPXWorkspaceSymbolProviderclass (exported but never registered inextension.ts).compiler.ts: MovedstderrOverflowdeclaration above its handler (was declared one line after use). AddedstderrOverflowto theclosehandler's overflow branch (previously onlytruncatedwas checked, leaving stderr-overflow kills to fall into thecode !== 0path and attemptJSON.parseon a truncated buffer). Removed deadcompilationErrorsmap andgetCompilationError()method (the map was written but never read externally). Fixederr.message || err.stackorder incompileAndWritecatch — stack is now used for logging, message for the user-facing error.diagnostics.ts: RemovedshouldForwardDiagnostic()stub (always returnedtrue) and its no-op.filter()call site.positionMapper.ts: Removed/gflag from module-levelPHP_WORD_PATTERNconstant — the flag implies mutablelastIndexstate, but all use sites correctly create fresh instances vianew RegExp(PHP_WORD_PATTERN.source, 'g'); the constant is used only as a source holder. Fixed double-statSyncon cache miss: now doesstatSyncfirst, thenreadFileSync(one syscall saved per cold-cache file access).languageClient.ts: Removed redundant?? undefinedfrom optional-chain expression.extension.ts: Deduplicated the three identical vendorWatcher event handlers into a sharedclearCompilerCachecallback.Test plan
npm run compile— no errors).phpxfiles.phpxfiles🤖 Generated with Claude Code