Add .d.tycl declaration files for external library type definitions#2
Merged
Conversation
Introduce a mechanism similar to TypeScript's .d.ts files, allowing users to declare types for external libraries not written in TyCL. Declaration files are automatically discovered from tycl-declarations/ directories (project-local) and ~/.config/tycl/declarations/ (global).
check-file was missing the find-and-load-declarations call, so .d.tycl type declarations were not available during standalone type checking (e.g. tycl check, check-all).
- Use canonical package name (common-lisp) instead of nickname (cl) in declaration file to match type checker's package resolution - Remove CL functions with &rest/&optional/&key parameters that cause false positive argument count errors - Add type annotations to math.tycl arithmetic results to resolve :number -> num (integer) downcast warnings
Add find-and-load-declarations call to handle-initialize so that .d.tycl type declarations are available for diagnostics in the editor.
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.
Add
.d.tycldeclaration files for typing external libraries not written in TyCL, similar to TypeScript's.d.tsfiles.tycl-declarations/directory convention for project-local declarations and~/.config/tycl/declarations/for user-global declarations, withautomatic discovery and loading
check-file), and LSP server initialization flowssample/tycl-declarations/demonstrating type error detection for external function calls</>symbol restriction) in README