MCPcopy Create free account
hub / github.com/nodejs/node / getFormatCodeSettingsForWriting

Function getFormatCodeSettingsForWriting

test/fixtures/snapshot/typescript.js:129532–129537  ·  view source on GitHub ↗

* Get format code settings for a code writing context (e.g. when formatting text changes or completions code).

(_a, sourceFile)

Source from the content-addressed store, hash-verified

129530 * Get format code settings for a code writing context (e.g. when formatting text changes or completions code).
129531 */
129532 function getFormatCodeSettingsForWriting(_a, sourceFile) {
129533 var options = _a.options;
129534 var shouldAutoDetectSemicolonPreference = !options.semicolons || options.semicolons === ts.SemicolonPreference.Ignore;
129535 var shouldRemoveSemicolons = options.semicolons === ts.SemicolonPreference.Remove || shouldAutoDetectSemicolonPreference && !probablyUsesSemicolons(sourceFile);
129536 return __assign(__assign({}, options), { semicolons: shouldRemoveSemicolons ? ts.SemicolonPreference.Remove : ts.SemicolonPreference.Ignore });
129537 }
129538 ts.getFormatCodeSettingsForWriting = getFormatCodeSettingsForWriting;
129539 function jsxModeNeedsExplicitImport(jsx) {
129540 return jsx === 2 /* JsxEmit.React */ || jsx === 3 /* JsxEmit.ReactNative */;

Callers

nothing calls this directly

Calls 1

probablyUsesSemicolonsFunction · 0.85

Tested by

no test coverage detected