crystal-lang-tools/vscode-crystal-lang

do autocompletes to DivisionByZero on ENTER

Closed this issue ยท 8 comments

Describe the bug
When pressing ENTER after opening a block with do, do gets completed to DivisionByZero automatically.
I have to CTRL + Z and repress ENTER for the new line to work as intended

To Reproduce
Open a block with do and press ENTER

Expected behavior
Pressing ENTER after do should not autocomplete into anything else and actually break a line

Piece of Code

arr = []
arr.each do

Screenshots

cr.cr.-.fullstack-challenges-crystal.WSL_.Ubuntu.-.Visual.Studio.Code.2024-02-18.12-20-57.mp4

Desktop (please complete the following information):

  • OS: Windows 10 with WSL:Ubuntu 22
  • Crystal version: v1.11.2
  • This plugin version: v0.9.1

I hope you guys are not thinking I'm spamming issues ๐Ÿ™ .
I really wanna give Crystal a chance and share my experience with it to others but for that to happen the tooling has to be on par with another language's so I figured I might as well report everything I stumble upon

I appreciate you reporting these bugs! It helps to know what problems people are running into.

Unfortunately with Crystal, the tooling isn't 100% there yet, and honestly I'm a little jealous of Ruby haha. It's one of the largest pain points of the language as it is and a reason a lot of people stop using it. I'm doing my best to help mitigate that but it's hard.

Crystal looks like everything I was looking for from a language so far so I'll do my best to improve mine and everyone's experience using it. I'm only able to write a few issues atm but if I still enjoy it in a few months' time I'll make sure to contribute to the ecosystem too.

Until then, I very much appreciate your efforts to improve it ๐Ÿ™Œ

It seems I no longer have the issue after installing Crystalline, as explained in #185 (comment) ๐Ÿ‘

Thank you! I appreciate you taking the time to report issues you're having.

This is still an issue w/ the defaults so I'll leave this issue open for now - not everyone uses the extension with Crystalline (I don't personally).

@nobodywasishere I don't understand, you mean to say that the LSP is not required to run the extension ? ๐Ÿค”
I thought this extension was made to enable the LSP on VSCode

@nobodywasishere I don't understand, you mean to say that the LSP is not required to run the extension ? ๐Ÿค” I thought this extension was made to enable the LSP on VSCode

@wJoenn

This extension is partially to be able to use an LSP with Crystal, but this extension also provides other functionality, including some duplicate functionality to that normally provided by the LSP (syntax highlighting, go to definition, type information).

This extension also provides stuff like the spec integration (so you can view/run specs directly from vscode instead of cli, disabled by default). Personally, while I think the LSP is good, I find it can be slow and memory intensive (and for larger projects I turn off a lot of the features provided by this extension as well due to compile times / memory usage). All the features mentioned in the README are those that are available both with and without an LSP, assuming your project is setup correctly.

I'd recommend also checking out ameba, which also has a vscode extension that can be useful (similar to Rubocop).

Yeah I've given a try to ameba.
I've opened a couple PRs there too ๐Ÿ˜…

Thanks for fixing this so quickly Margret ๐Ÿ™Œ