Skip to content

Provide workspace configs for text editors #2785

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

Open
FranjoMindek opened this issue May 21, 2025 · 9 comments
Open

Provide workspace configs for text editors #2785

FranjoMindek opened this issue May 21, 2025 · 9 comments
Labels

Comments

@FranjoMindek
Copy link
Contributor

FranjoMindek commented May 21, 2025

Currently, it takes a bit of configuration to get all tooling around wasp working.
Especially around Haskell whose tooling is less supported by text editors.

We should provide config files for often used text edits which would solve above problems.
e.g. .vscode for VSC

Even better if they could include recommendations for all extensions needed to work with wasp normally.
e.g. .vscode\extensions.json for VSC

This would solve issues around:

  1. Which formatters to use (e.g. ormolu for Haskell, which is not default)
  2. Setting up formatters (e.g. pointing to wasp's local ormolu binary)
  3. Setting up right Haskell environment (e.g. use GHCup)
  4. Wasp packages
    • e.g. wasp extension for VSC has wasp.server.executable which allows it to grab AppSpec from local development version of binary, which is necessary to test any AppSpec changes with wasp extension for VSC

TODO: any more issues solved by this?
TODO: which text editors to support? should each be it's own issue with this being an parent issue?

@cprecioso
Copy link
Member

Related to #2736 (we can also add prettier formatting)

@cprecioso
Copy link
Member

Formatters and environment are different problems though. I can't see us running GHCup inside a VS Code configuration right? (If it's even possible?)

@FranjoMindek
Copy link
Contributor Author

FranjoMindek commented May 21, 2025

More about pointing haskell to right binaries, since user might have multiple versions installed, and might not have our version in path as default.

e.g. .vscode

{
  "haskell.manageHLS": "GHCup",
  "haskell.toolchain": {
    "hls": "1.8.0.0"
  },
}

Users can always override these settings, if needed.

@cprecioso
Copy link
Member

Users can always override these settings, if needed.

No, they can't though. If I modify my User preferences, the workspace ones will take precedence. If I modify the Workspace preferences, this will show up as a modified file in git.

@FranjoMindek
Copy link
Contributor Author

That's what I meant, this configuration files should follow how we specify to set up the environment in our waspc readme.
Any deviation from that and you should not expect it to be set up for you.

If they are deviating I don't see it a problem that they have it as an modified file in git.

@cprecioso
Copy link
Member

cprecioso commented May 21, 2025

If they are deviating I don't see it a problem that they have it as an modified file in git.

I don't agree 😅 I think each environment's setup (especially if only related to a single IDE) is a local workstation concern and not one that should be stored in the repo (moreover if it's going to override my User preferences).

For reference I have my haskell setup through mise and not through GHCup. Git would keep bothering me to stash the config file or whatever.

@FranjoMindek
Copy link
Contributor Author

FranjoMindek commented May 22, 2025

That is a good point. How about limiting the scope to what is actually done on workspace level, rather than tampering with global configuration?
e.g. we always store ormolu binary we want to use in repo, so having that might be worthwhile?

Copy link
Member

cprecioso commented May 22, 2025

My preference would be to not add any settings for the environment at all (e.g. ormolu), and just add those related to workflow (e.g. auto-formatting). If we can define the versions without setting paths for them, I'm also up for it.

@Martinsos
Copy link
Member

I haven't read everything, I would just be careful that we don't spend too much time here on somethign that at the end won't work for everybody.

On one hand, having clear instructions in README on what to install is maybe the best -> they can follow that easily and all is good.

It will depend on the specifics of the implementation here, I am just saying, I wouldn't push this too far -> if we can get something very practical very easily, great, if not, manual instructions are probably good enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants