Skip to content
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

feat(language-server): Add types for types in LSP API #1078

Merged
merged 7 commits into from
Feb 20, 2024

Conversation

DieMyst
Copy link
Member

@DieMyst DieMyst commented Feb 15, 2024

Description

Add JS representation of types in compiler

Checklist

  • Corresponding issue has been created and linked in PR title.
  • Proposed changes are covered by tests.
  • Documentation has been updated to reflect the changes (if applicable).
  • I have self-reviewed my code and ensured its quality.
  • I have added/updated necessary comments to aid understanding.

Reviewer Checklist

  • Tests have been reviewed and are sufficient to validate the changes.
  • Documentation has been reviewed and is up to date.
  • Any questions or concerns have been addressed.

@DieMyst DieMyst added the e2e Run e2e workflow label Feb 15, 2024
Copy link

linear bot commented Feb 15, 2024

@DieMyst DieMyst marked this pull request as ready for review February 15, 2024 10:55
import scala.scalajs.js.JSConverters.*
import scalajs.js

sealed trait TypeJs extends js.Object {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not model them as enum?
Also I don't quite understand: don't you need to annotate class fields with @JSExport? Otherwise they should not be visible in js, should they?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enum don't work with js.Object as far as I know.
Also, @JSExport makes scala class accessible from JS. extends js.Object makes these objects AS JS objects. So, I think we will rewrite definitions on js.Object too, to avoid redundant proxy conversions

@DieMyst DieMyst enabled auto-merge (squash) February 20, 2024 10:59
"examples": "jest",
"pubsub": "node -r ts-node/register src/pubsub.ts",
"exec": "npm run compile-aqua && npm run prettify-compiled && node -r ts-node/register src/index.ts",
"run": "node -r ts-node/register src/index.ts",
"compile-aqua": "node --loader ts-node/esm ./src/compile.ts",
"compile-aqua:air": "aqua -i ./aqua/ -o ./compiled-air -a",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"compile-aqua:air": "aqua -i ./aqua/ -o ./compiled-air -a",

@DieMyst DieMyst merged commit 3cd31c5 into main Feb 20, 2024
10 checks passed
@DieMyst DieMyst deleted the LNG-331-prettify-types branch February 20, 2024 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e Run e2e workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants