Visual Studio 2005/2012 : 첫 번째 중괄호를 같은 줄에 유지하는 방법?
내 CSS / C # 함수를 다음과 같이 얻으려고합니다.
body {
color:#222;
}
이 대신에 :
body
{
color:#222;
}
코드를 자동 형식화하면
씨#
- 에서 도구 메뉴를 클릭 옵션
- 모든 매개 변수 표시 (왼쪽 하단의 확인란)를 클릭 합니다 ( VS 2010의 모든 설정 표시 )
- 텍스트 에디터
- 씨#
- 서식
- 새로운 줄
괄호가있는 줄 바꿈을 원할 때 확인하십시오.
CSS :
거의 동일하지만 더 적은 옵션
- 에서 도구 메뉴를 클릭 옵션
- 모든 매개 변수 표시 (왼쪽 하단의 확인란)를 클릭 합니다 ( VS 2010의 모든 설정 표시 )
- 텍스트 에디터
- CSS
- 체재
원하는 형식을 선택하는 것보다 (두 번째 라디오 버튼)
Visual Studio 2015의 경우 :
도구 → 옵션
사이드 바에서 텍스트 편집기 → C # → 형식 → 줄 바꿈으로 이동하십시오.
"중괄호의 새 줄 옵션" 섹션에서 모든 확인란의 선택을 취소하십시오.
Tools -> Options -> Text Editor -> C# -> Formatting -> New Lines -> New Line Options for braces -> Uncheck all boxes.
The official MS guidelines (at the time in 2008) tells you to have the curly brace on the same line as the method/property/class and many other things which are not enforced in Visual Studio.
You can change all these auto-text settings under:
Tools -> Options -> Text Editor -> [The language you want to change]
UPDATE: This was based on the book "Framework Design Guidelines" written by some of the core-people from the .NET-team. If you look at the source-code for the likes of ASP.NET MVC, this is no longer accurate.
Go to Tools -> Options -> Text Editor -> CSS -> Formatting
. Click "Semi-expanded," which matches the style you defined.
For CSS you'll need the 'Semi Expanded' option.
There is a specific formatting setting in VS 2008/2010 to keep the open brace on the same line:
Click Tools->Options
Select 'CSS' within 'Text Editor' tree node
Select 'Formatting' under 'CSS' node
Click 'Semi-expanded' radio button
You will see a preview what the various radio buttons avail will do to the formatting
If you're looking for this option within Visual Studio 2014, then it's under advanced and is now a 'Brace positions' drop down box:
'program tip' 카테고리의 다른 글
패치를 적용 할 때 충돌을 해결할 수있는 방법이 있습니까? (0) | 2020.07.30 |
---|---|
상수 포인터 대 상수에 대한 포인터 (0) | 2020.07.30 |
선택적 변수 인쇄 (0) | 2020.07.30 |
Amazon 인터뷰 질문 : OO 주차장 설계 (0) | 2020.07.30 |
교리 2의 대리 란 무엇입니까? (0) | 2020.07.30 |