2017-10-16 3 views
0

Atom-typescript는 코드 서식을 지정할 때 탭 공간을 2에서 4로 변경합니다.atom-typescript에서 탭 공간을 변경합니다.

나는 formatting.js 파일을 변경하고 2로 설정하지만 여전히 내가 같은 문제 ..에 직면하고있어

가 어떻게 원자 타이프의 탭 공간을 변경할 수 있습니다

?

아래 여기 @baruch에 의해 제안 formatting.js

"use strict"; 
Object.defineProperty(exports, "__esModule", { value: true }); 
/** 
* Maintainance: 
* When a new option is added add it to: 
* - the FormatCodeOptions interface 
* - the defaultFormatCodeOptions function 
* - the makeFormatCodeOptions function 
*/ 
const os_1 = require("os"); 
function defaultFormatCodeOptions() { 
    return { 
     baseIndentSize: 2, 
     indentSize: 2, 
     tabSize: 2, 
     newLineCharacter: os_1.EOL, 
     convertTabsToSpaces: true, 
     indentStyle: "Smart", 
     insertSpaceAfterCommaDelimiter: true, 
     insertSpaceAfterSemicolonInForStatements: true, 
     insertSpaceBeforeAndAfterBinaryOperators: true, 
     insertSpaceAfterKeywordsInControlFlowStatements: true, 
     insertSpaceAfterFunctionKeywordForAnonymousFunctions: false, 
     insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false, 
     insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: false, 
     insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false, 
     insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: false, 
     placeOpenBraceOnNewLineForFunctions: false, 
     placeOpenBraceOnNewLineForControlBlocks: false, 
    }; 
} 
exports.defaultFormatCodeOptions = defaultFormatCodeOptions; 
//# sourceMappingURL=formatting.js.map 
+0

편집기 설정을 확인 했습니까? – Baruch

+0

예, 편집기 탭 길이는 2로 설정됩니다. Atom -> preferences -> editor -> Tab Length – prranay

+0

atom-typescript를 사용하여 코드를 형식화하면 탭 간격이 2에서 4로 변경됩니다. – prranay

답변

0

의 내용입니다 참조입니다 : github.com/TypeStrong/atom-typescript/issues/1236

내가 게시하도록하겠습니다 나를 위해 일한 것.

atom-typescript 2에 들여 쓰기를 변경하려면 :
  1. 프로젝트 디렉토리로 이동합니다.
  2. 열기 또는 생성 tsconfig.json.
  3. 이것은 나를 위해 일한 다음 코드

    "formatCodeOptions": { 
        "baseIndentSize": 0, 
        "indentSize": 2, 
        "tabSize": 2, 
        "newLineCharacter": "\n", 
        "convertTabsToSpaces": true, 
        "indentStyle": "Smart", 
        "insertSpaceAfterCommaDelimiter": true, 
        "insertSpaceAfterSemicolonInForStatements": false, 
        "insertSpaceBeforeAndAfterBinaryOperators": true, 
        "insertSpaceAfterConstructor": false, 
        "insertSpaceAfterKeywordsInControlFlowStatements": true, 
        "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, 
        "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, 
        "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, 
        "insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false, 
        "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, 
        "insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false, 
        "insertSpaceBeforeFunctionParenthesis": false, 
        "placeOpenBraceOnNewLineForFunctions": false, 
        "placeOpenBraceOnNewLineForControlBlocks": false 
    } 
    

을 추가!

관련 문제