Skip to content

Complete payload of @module attribute #879

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

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

zth
Copy link
Collaborator

@zth zth commented Jan 2, 2024

Adds basic completion for the string payload of the @module() attribute. A (pretty weird) example:
image

This is a basic version that will complete for:

  • Package names in dependencies + devDependencies of package.json, if it can find it
  • Local .js and .mjs files next to the source ReScript file

Ideas building on this:

  • Resolve relative paths (completing ../ gives that folder contents, etc)
  • Resolve .d.ts files relative to packages. Completing next/ could give next/link, etc

One could maybe even go further and resolve @scope in combination with @module, and the external assignment, like:

@module("next/link") external make: ... = "<com>"

And via that look up what exports there actually are in the next/link package.

One can dream at least. This is a first small step.

@zth zth requested a review from cristianoc January 2, 2024 21:30
@zth zth merged commit 2d1742a into master Jan 3, 2024
@zth zth deleted the complete-module-attribute-payload branch January 3, 2024 17:20
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.

2 participants