Recommended tooling for PureScript applications in 2019

Since this thread is about opinionated recommendations, which editor / IDE would you recommend for PureScript development?

I’m a long time Sublime Text user, but I have found the ST plugin quite lacking. There is no auto-import, the import auto-complete is close to useless, the error reporting hover window comes out once every full moon and sometimes it gets stuck completely and I have to pkill -f purs.ide.server. I might as well keep it only for the syntax highlighting and just use some other aiding tool, such as the aforementioned pscid.

I’m conversant with Python, so I might pick up the ST plugin in the future and work on it, but for now I’m still learning PureScript, so I’d like to at least know what the state of the art is.

As of 2020, which IDE has the best integration, meaning the best auto-complete, auto-import, error reporting, type information, pop-up documentation, jump to definition, and such features?

I’ve had good experiences with vscode (using PS and purty plugins). All of these features work:

  • auto-complete
  • auto-import
  • error reporting
  • type information
  • pop-up documentation
  • jump to definition
  • format-on-save

The only annoyances are:

  • Need to Restart/Reconnect the IDE server after adding new functions in one file that are used in another file.
  • None of the vim plugns in vscode are feature-complete. Workaround is to just briefly open a separate vim instance for more involved edits.

Has anyone used vim successfully for PS with the above feature set?

I mostly see VSCode or Emacs users. I use VSCode myself and it works smoothly.

As far as Vim goes I use a pretty limited feature set so I haven’t run into trouble.

1 Like

I had this issue when I was using emacs as well. Have you tried enabling the option psc-ide-editor-mode (which may be named some what differently in vscode). I believe that fixed the issue of needing to restart the server for me

I’ll give that a shot. Currently disabled by default for me. Wondering why that is.

Using VScode and liking it! Make sure you install the plugin and launch the project from its folder

1 Like

I switched to VSCode and it’s really good. Thank you!

I’m using coc.nvim with purescript-language-server and I’m really pleased with it. Has all of the listed features and if I need to rebuild the project after installing a new dependency for example, I then just issues :CocRestart to refresh, but I think in theory it should pick up the new dependencies automatically.

2 Likes

Hi, is this plugin the purty plugin you mentioned?

That’s the one. I’ll add the link to that post.

If I am to do an FFI I like to include a jsconfig.json to get half decent type safety in JavaScript with JSDocs:

{
    "compilerOptions": {
        "checkJs": true,
        "strict": true,
        "target": "ES2017",
        "noImplicitAny": true,
        "noUnusedLocals": true,
        "noUnusedParameters": true,
        "moduleResolution": "node",
        "lib": ["es2020"]
    }
}