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

Investigate VSCode/Cursor handling of malformed code (client typo, incomplete test) #1413

Open
sxlijin opened this issue Feb 4, 2025 · 1 comment

Comments

@sxlijin
Copy link
Collaborator

sxlijin commented Feb 4, 2025

While writing BAML code, it's very easy to end up with malformed code:

  • rename a client definition, but function references to that client don't get updated, so code doesn't compile
  • start writing a test, make a syntax mistake because you're still learning to write tests
  • add properties to a test, press [tab] for cursor auto-complete, it messes up a string and now your code doesn't compile

Whenever we compile malformed code, in the vscode extension right now, it basically implodes on you: you have to fix all the compilation errors to get the playground reusable. For new users, this is really painful, frustrating, and scary; as prashanth puts it, "the playground is a place of comfort" but getting kicked around compilation errors with non-obvious error messages is, by comparison, getting shoved into an iron maiden.

Consequences of malformed code right now:

  • playground becomes useless, even for well-formed functions
  • "Open Playground" buttons go away
  • pop-up "show details" that goes nowhere

We have some amount of handling for this - e.g. WasmProject will load the most recently compiling version of your baml_src - but it appears to not be triggering, or if it is, it's not saving the user from this happening.

We should start working on fixing this.

@prrao87
Copy link
Contributor

prrao87 commented Feb 4, 2025

Thanks for prioritizing this! This will definitely help onboard a lot more folks coming from other tooling ecosystems and languages. After all, BAML is something new that people have to learn.

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

No branches or pull requests

2 participants