crystal-lang-tools / vscode-crystal-lang

Yet another VSCode extension for Crystal Programming Language
https://marketplace.visualstudio.com/items?itemName=crystal-lang-tools.crystal-lang
MIT License
275 stars 57 forks source link

do autocompletes to DivisionByZero on ENTER #187

Closed wJoenn closed 5 months ago

wJoenn commented 5 months ago

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

https://github.com/crystal-lang-tools/vscode-crystal-lang/assets/75388869/37c1c958-ef7e-48de-b139-146eab60b29c

Desktop (please complete the following information):

wJoenn commented 5 months ago

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

nobodywasishere commented 5 months ago

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.

wJoenn commented 5 months ago

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 🙌

wJoenn commented 5 months ago

It seems I no longer have the issue after installing Crystalline, as explained in https://github.com/crystal-lang-tools/vscode-crystal-lang/issues/185#issuecomment-1951422567 👍

nobodywasishere commented 5 months ago

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).

wJoenn commented 5 months ago

@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 commented 5 months ago

@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).

wJoenn commented 5 months ago

Yeah I've given a try to ameba. I've opened a couple PRs there too 😅

Thanks for fixing this so quickly Margret 🙌