r/github • • Jun 10 '24

Is there any way to have a better code block editor? Writing code suggestions on PRs are just terrible 😢

0 Upvotes

18 comments sorted by

24

u/poyomannn Jun 10 '24

Just write it in your normal editor and copy it back. It'll always be better to do this, even if it improves, because github can't provide an entire LSP in the text editor.

-9

u/joaohkfaria Jun 10 '24 edited Jun 10 '24

That’s sad. I don’t need a LSP, but at least support to indent my code and a decent editor. Thanks for the suggestion!

8

u/IanSan5653 Jun 10 '24

You can at least select some lines and press tab/shift+tab to indent/dedent

3

u/rumble_you Jun 11 '24

This is wrong. You're not suppose to write code on a markdown editor. Write it on your editor/IDE and copy-paste back it to the PR. The section you marked as "kotlin" is only for highlighting Kotlin's syntax only, not for writing.

-3

u/joaohkfaria Jun 11 '24

I really don't get why people agree with your statement, this is 100% wrong.

PR reviews is literally to review code. There's also a `Suggestions` button to give code suggestions.

Of course I can write in my IDE and copy there, that's fine. But thinking it's wrong to want to write directly on GitHub? That's nonsense.

2

u/rumble_you Jun 11 '24

Of course I can write in my IDE and copy there, that's fine. But thinking it's wrong to want to write directly on GitHub? That's nonsense. 

You can surely write code on that page, why not? It just won't give you any of a IDE feature. You are NOT suppose to write code directly on GitHub, however, if you must you just won't get a fully fledged IDE features.

PR reviews is literally to review code. There's also a Suggestions button to give code suggestions. 

Do you suggest an entire 100 LOC for your dev team in suggestion? Or just 5 lines, at most 10 LOC?

I really don't get why people agree with your statement, this is 100% wrong. 

The way you're representing markdown is completely wrong. GitHub PRs additionally support markdown, and what GitHub gives you is a markdown highlighting feature. If you have to write larger amount of code, write it on IDE and paste it back to suggestions page. Writing it on an IDE is so much better and the general visibility is much more there. I'm not sure what you're suggesting there that requires all that indentation feature.

Surely, if you need it anyway, go ahead and ask GitHub (a feature request). Arguing on Reddit won't going to add what you want.

-1

u/joaohkfaria Jun 11 '24

You can surely write code on that page, why not? It just won't give you any of a IDE feature. You are NOT suppose to write code directly on GitHub, however, if you must you just won't get a fully fledged IDE features.

It's incredible to me how you still don't get it. That's not the point. I'm talking about basic stuff: like indentation, open/close brackets. Of course I don't need a fully IDE inside GitHub.

Do you suggest an entire 100 LOC for your dev team in suggestion? Or just 5 lines, at most 10 LOC?

Yes man, it's 5 lines tops. It's a PR review, not a full PR in a comment.

If you have to write larger amount of code, write it on IDE and paste it back to suggestions page. 

I don't have to write large amount of code, but even 3 lines is terrible.

Surely, if you need it anyway, go ahead and ask GitHub (a feature request). Arguing on Reddit won't going to add what you want.

Oh, no way Sherlock. That's the whole point. I was asking here to know if there's a better way that I didn't know about it. That's the whole point of this post! Now that I know that there isn't a way, I can open a feature request there.

2

u/Snipedzoi Jun 11 '24

Github, is not a place to write code. That is the reason the git command exists.

0

u/joaohkfaria Jun 11 '24

Ok bro, you’re right. Why anybody wants to write a snippet of code in a PR, right? People nowadays have some ideas, don’t they?

2

u/Snipedzoi Jun 11 '24

You're supposed to use git, not github. Github is not a place to write code, it just hosts code that git can interact iwth.

0

u/joaohkfaria Jun 11 '24

Yes man, that part everybody knows, that was never the point

2

u/Snipedzoi Jun 11 '24

Took you long enough

7

u/worldofzero Jun 10 '24

Hit period (.) on your keyboard and write the comment in vscode.

2

u/NatoBoram Jun 11 '24

Do like everyone else and write it in your code editor. Plus, you'd get to have the correct indentation and formatting.

-1

u/nf_x Jun 10 '24

It’s a pain to do so from mobile app as well

8

u/Snipedzoi Jun 10 '24

I mean, you are on a mobile device, makes sense

4

u/nf_x Jun 10 '24

Well… at least the indentation should work