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

Fix a formatting error in the "missing argument" error #10325

Merged
merged 1 commit into from Jan 29, 2021
Merged

Fix a formatting error in the "missing argument" error #10325

merged 1 commit into from Jan 29, 2021

Conversation

BlobCodes
Copy link
Contributor

Closes #10324

Before:
Screenshot_20210128_115538

After:
Screenshot_20210128_123519

@kostya
Copy link
Contributor

kostya commented Jan 28, 2021

offtopic, what is this shell in screenshots?

@BlobCodes
Copy link
Contributor Author

@kostya
Terminal-Emulator: Konsole (with Fluent Design Qt Theme for Kvantum)
Shell: zsh (with romkatv/powerlevel10k theme)

@docelic
Copy link
Contributor

docelic commented Jan 28, 2021

But this general style of prompts is otherwise known as "airline":

https://unix.stackexchange.com/questions/154012/terminal-colors-for-vim-airline-and-tmux-tmuxline

Comment on lines 191 to +192
io << message
io << '\n'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
io << message
io << '\n'
io.puts message

Comment on lines 304 to +305
str << single_message
str << '\n'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
str << single_message
str << '\n'
str.puts single_message

@bcardiff bcardiff added this to the 0.36.1 milestone Jan 28, 2021
@bcardiff bcardiff added the kind:regression Something that used to correctly work but no longer works label Jan 28, 2021
@BlobCodes
Copy link
Contributor Author

@Sija I don't know if it's a good idea to use io.puts instead of io << '\n', because in src/compiler/crystal/semantic/call_error.cr, mostly the second style is used and I want to keep it consistent.

Examples:
l.593:

            str << "Did you mean '#{similar_name}'?"
            str << '\n'

l.323:

        str << ")\n"

The word "puts" however is not even included in this document.
Any thoughts on which style to use?

@asterite
Copy link
Member

Both are equivalent so it's the same. I wouldn't worry about such things.

@Sija
Copy link
Contributor

Sija commented Jan 29, 2021

@BlobCodes puts is 'simpler' since it adds the trailing newline for you, but as @asterite mentioned both do the same thing.

@bcardiff bcardiff merged commit dc0a32f into crystal-lang:master Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug kind:regression Something that used to correctly work but no longer works topic:compiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"missing argument" error misformatted
7 participants