Skip to content
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

Formatter runs forever #20

Open
baelter opened this issue Jan 28, 2021 · 6 comments
Open

Formatter runs forever #20

baelter opened this issue Jan 28, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@baelter
Copy link

baelter commented Jan 28, 2021

When I enable this in vscode with format on save enabled the formatter runs forever with 100% cpu. Formatting is working fine without the language server, so could you add an option to disable it in the language server?

code --version
1.52.1
ea3859d4ba2f3e577a159bc91e3074c5d85c0523
x64

macos 11.1

crystalline 0.2
@elbywan elbywan added the bug Something isn't working label Jan 28, 2021
@elbywan
Copy link
Owner

elbywan commented Jan 28, 2021

Hi @baelter,

Formatting is working fine without the language server, so could you add an option to disable it in the language server

The easiest way would be to add a config. option but it would need to be handled by the editor plugin I think.
I could also add a specific cli flag to turn it off but I would rather fix the issue if possible 😉.

When I enable this in vscode with format on save enabled the formatter runs forever with 100% cpu.

I have a hard time reproducing this issue on my computer. Out of curiosity, does crystal tool format output an error or take a long time to run? If possible, could you also look at the crystalline logs and check if there is something unusual there? (cmd+shift+P > type "logs" and pick "Developer: Show Logs…" > select any source > choose "Crystal Language" in the logs dropdown)

@elbywan
Copy link
Owner

elbywan commented Jan 28, 2021

I just released 📦 v0.2.1 that might fix the issue, could you try upgrading your crystalline version?

@baelter
Copy link
Author

baelter commented Jan 28, 2021

Sweet, will do. Just have to reproduce and check those logs first!

@baelter
Copy link
Author

baelter commented Feb 2, 2021

Getting some error output which does not make sense:

[Warn  - 8:51:11 AM] In src/client/client.cr:317:43

 317 | close_connection(frame, 504_u16, "CHANNEL_ERROR - Channel #{frame.channel} not open")
                                         ^
Error: unexpected token: CHANNEL_ERROR
[Warn  - 8:51:49 AM] In src/client/client.cr:316:74

 316 | @log.error { "Channel #{frame.channel} not open when handling #{frame.class.name}" }
                                                                        ^
Error: unexpected token: }

There are no issues with the code.

crystal tool format src/client/client.cr does not error.

Same with v0.2.1.

Not sure if it's related to the hanging formatting, that seems kinda random.

@baelter
Copy link
Author

baelter commented Feb 2, 2021

Screenshot 2021-02-02 at 09 11 12

This can take up to a minute. No output in the logs. Running latest version now.

@elbywan
Copy link
Owner

elbywan commented Feb 4, 2021

This can take up to a minute. No output in the logs. Running latest version now.

This is weird, saving should only call the built-in crystal formatter (same as crystal tool format).

Unfortunately a bug in the Crystal compiler prevents me from compiling and running crystalline since the last release (0.36.1). I'm waiting for the Crystal team to fix this before I'll be able to investigate more. (see crystal-lang/crystal#10359)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants