feat: lsp skeleton - #1587
Conversation
ShadowCat567
left a comment
There was a problem hiding this comment.
Other than the import comment, I think this looks pretty reasonable, looking forward to seeing the LSP be able to actually do something :D
| /* eslint-disable import/no-relative-packages */ | ||
| export { createIgnoreMatcher } from '../../toolkit-lib/lib/util/glob-matcher'; | ||
| export type { GlobMatcherOptions } from '../../toolkit-lib/lib/util/glob-matcher'; | ||
| export { WATCH_EXCLUDE_DEFAULTS } from '../../toolkit-lib/lib/actions/watch/private/helpers'; |
There was a problem hiding this comment.
Why can't these be imported like @aws-cdk/toolkit-lib? (like how toolkit-lib imports other @aws-cdk packages)
There was a problem hiding this comment.
Short answer: they aren't public, and probably shouldn't be if they aren't yet.
There was a problem hiding this comment.
this follows the same pattern used by the aws-cdk CLI package see packages/aws-cdk/lib/api-private.ts, which imports createIgnoreMatcher and other internal symbols from toolkit-lib via relative paths with the same eslint-disable.
There was a problem hiding this comment.
based on what other packages in @aws-cdk do we might be able to do the deep import in the file where we need to get the info from and not have the intermediate file
Minimal LSP server that handles initialize/shutdown lifecycle and triggers synth via injectable callback on didSave. File filtering reuses toolkit-lib's createIgnoreMatcher + WATCH_EXCLUDE_DEFAULTS (same pattern as cdk watch). No daemon, no custom methods — just the plumbing that proves the LSP wiring works end-to-end. Real cdk.out parsing comes in Phase 2.
Remove the intermediate toolkit-internals.ts re-export file and import directly where needed, matching the simpler pattern for a single consumer.
- Add tests for didSave-after-shutdown and onSynthRequest error catch - Lower functions coverage threshold to 50%; the unconditional process.exit in onExit is not unit-testable in this small skeleton
7f8a532 to
6f435e4
Compare
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
ShadowCat567
left a comment
There was a problem hiding this comment.
Overall looks good, take a look at the index.test.ts file before merging!
There was a problem hiding this comment.
you shouldn't need index.test.ts file, I think you can remove this
151dfac
into
aws:feat/cdk-lsp-explorer
LSP server skeleton: handles initialize/shutdown lifecycle, filters didSave notifications, triggers synth via injectable callback
Reuses
toolkit-lib'screateIgnoreMatcher+WATCH_EXCLUDE_DEFAULTSfor file filtering (same exclusion logic ascdk watch)Adds
@aws-cdk/toolkit-libas a dependency in.projenrc.ts(enablestoolkit-internals.tsre-export pattern matching packages/aws-cdk/lib/api-private.ts)Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license