State of editor support

I’m using vscode with the Crystal extension and it is problematic:

  • Hovering on a symbol usually doesn’t show useful info.
  • Command clicking symbols only jumps to their definitions a fraction of the time.
  • Completion suggestions for dotted methods are often just 5 general items (is_a? nil? etc.) with no type specific members.
  • Typing comments can be difficult due to the suggestion box constantly popping up with keywords like def, if and else as I’m trying to write sentences, not code.
  • I don’t see any messages in the “Output” tab or in a “Crystal” sidebar to help diagnose issues (Nim language had this).

Questions:

  • Am I on the right extension?
  • For people with similar set-ups, is this normal?
  • Does anyone have “good code intelligence for Crystal” working?
    • If so, please share your editor, extension and op sys.
    • Any special set-up steps?

I haven’t dug into troubleshooting just yet, other than explicitly turning on settings. I can move my concerns over to the github project for the extension, but first I wanted to get a sense of whether I’m in the right neighborhood and what other people experience.

My set up:

  • Editor: Visual Studio Code (current version from 2 days ago)
  • Extension: Crystal Language 0.9.6 by The Crystal Programming Language
  • Crystal 1.14.0 (2024-10-09); LLVM: 19.1.1; aarch64-apple-darwin24.0.0
  • macOS 15

I think the gist of it is you’re not going to get as good editor integration as other languages like Kotlin, or PHP, etc. At the moment your best bet is GitHub - elbywan/crystalline: A Language Server Protocol implementation for Crystal. 🔮. However I don’t use it or vscode so can’t really help with the specifics.

I know @nobodywasishere is pretty familiar with it and working on their own LSP implementation so maybe they have some stuff to share.

This may not directly answer the question, but since many people are reading this thread, I wanted to share some information that may be useful. If you are a student, teacher, or open source contributor, you may be able to get free access to GitHub Copilot by subscribing to GitHub Education.

It is one of the most powerful code completion tools available for VSCode and works reasonably with Crystal, but it does not support features such as finding symbol definitions.

I was previously a graduate student and had free access to Copilot through GitHub Education. I continue to use Copilot for free now as an open source maintainer (not sure what the criteria for that are).

If you’re using a remote server, you can still use GitHub Copilot via SSH with the desktop version of VSCode. Just ensure AI tools are permitted in your situation.