Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Feature Request] Option for keeping the opening braces on the same line as corresponing definition / expression

Aperta
#4,298 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
csharp

Direzione di ricerca

Start by reading issue #1088, which the report says may cover related formatting options, then trace how ILSpy formats decompiled C# and how View → Options exposes settings. The request is to add an option that places opening braces on the same line across decompiled code; done means the setting is available and the shown examples follow it. The issue names no files or tests, so locating the formatter and relevant tests will take project familiarity.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Enhancement

Is your feature request related to a problem? Please describe.
I am always frustrated with the current standard C# (and C++ at that matter) formatting style where the opening brace is put on the next line, rather than kept on the same line like formatting style of most other programming languages (do I even need to name examples?). These next line opening braces are just eating up valuable vertical space, since most monitors today have ratio of 16:9 or more and are put horizontally.
And, IMHO, putting these braces on a next line doesn't help code readability, as it actively harms it by wasting precious screen space and, in my experience, doesn't help identify the beginning block as it is already enough for me to search for a keyword or a type on the same vertical line (and in most code editors show the vertical lines that span the white space from start of the block to its end) in order to identify what code is in what blocks.

Describe the solution you'd like
I would like to have an option in the View -> Options -> Display (or in Decompiler section) to get rid of all instances of next line opening braces in all circumstances.

I want the decompiled code to look like this (example from System.Private.CoreLib System.AppDomain):

	public static AppDomain CurrentDomain {
		get {
			if (s_domain == null) {
				Interlocked.CompareExchange(ref s_domain, new AppDomain(), null);
			}
			return s_domain;
		}
	}

instead of current:

	public static AppDomain CurrentDomain
	{
		get
		{
			if (s_domain == null)
			{
				Interlocked.CompareExchange(ref s_domain, new AppDomain(), null);
			}
			return s_domain;
		}
	}

This issue may be subsumed into https://github.com/icsharpcode/ILSpy/issues/1088, but this, I think, may be implemented regardless of this feature

Lingua principale
C#
Stelle
26.8k
Fork
3.8k
Merge medio
1g 4h
PR unite (30g)
69

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di icsharpcode/ILSpy

Tutte le issue di icsharpcode/ILSpy

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.