initial commit
This commit is contained in:
Родитель
0b3f84b37e
Коммит
60117b5276
|
@ -32,5 +32,12 @@ module.exports = {
|
|||
"prettier/prettier": ["error"],
|
||||
"security/detect-non-literal-fs-filename": "off",
|
||||
"security/detect-object-injection": "off",
|
||||
"sort-imports": [
|
||||
"error",
|
||||
{
|
||||
allowSeparatedGroups: true,
|
||||
ignoreCase: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"recommendations": [
|
||||
"esbenp.prettier-vscode"
|
||||
"dbaeumer.vscode-eslint",
|
||||
"esbenp.prettier-vscode",
|
||||
],
|
||||
"unwantedRecommendations": []
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
/* tslint:disable:no-console */
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import { FormatSettings, IndentationLiteral, NewlineLiteral, TFormatError, tryFormat } from ".";
|
||||
|
||||
const text: string = `1 as number`;
|
||||
|
@ -13,6 +13,7 @@ const settings: FormatSettings = {
|
|||
};
|
||||
|
||||
const triedFormat: PQP.Result<string, TFormatError> = tryFormat(settings, text);
|
||||
/* tslint:disable:no-console */
|
||||
if (PQP.ResultUtils.isOk(triedFormat)) {
|
||||
console.log("Your input was formatted as the following:");
|
||||
console.log(triedFormat.value);
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import {
|
||||
CommentCollectionMap,
|
||||
IsMultilineMap,
|
||||
|
@ -9,7 +10,6 @@ import {
|
|||
tryTraverseComment,
|
||||
tryTraverseSerializeParameter,
|
||||
} from "./passes";
|
||||
import { tryTraverseIsMultiline } from "./passes/isMultiline/isMultiline";
|
||||
import {
|
||||
IndentationLiteral,
|
||||
NewlineLiteral,
|
||||
|
@ -17,6 +17,7 @@ import {
|
|||
SerializeSettings,
|
||||
trySerialize,
|
||||
} from "./serialize";
|
||||
import { tryTraverseIsMultiline } from "./passes/isMultiline/isMultiline";
|
||||
|
||||
export type TriedFormat = PQP.Result<string, TFormatError>;
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import { CommentCollection, CommentCollectionMap, CommentState } from "./commonTypes";
|
||||
|
||||
// TODO pass in leafIds instead for a big speed boost.
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import { IsMultilineMap } from "../commonTypes";
|
||||
|
||||
export function expectGetIsMultiline(isMultilineMap: IsMultilineMap, node: PQP.Language.Ast.TNode): boolean {
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
import { FormatTraceConstant } from "../../trace";
|
||||
|
||||
import { CommentCollectionMap, IsMultilineMap } from "../commonTypes";
|
||||
import { FormatTraceConstant } from "../../trace";
|
||||
import { tryTraverseIsMultilineFirstPass } from "./isMultilineFirstPass";
|
||||
import { tryTraverseIsMultilineSecondPass } from "./isMultilineSecondPass";
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
import { FormatTraceConstant } from "../../trace";
|
||||
|
||||
import {
|
||||
CommentCollection,
|
||||
CommentCollectionMap,
|
||||
|
@ -11,6 +11,7 @@ import {
|
|||
LinearLengthMap,
|
||||
} from "../commonTypes";
|
||||
import { expectGetIsMultiline, setIsMultiline } from "./common";
|
||||
import { FormatTraceConstant } from "../../trace";
|
||||
import { getLinearLength } from "./linearLength";
|
||||
|
||||
export function tryTraverseIsMultilineFirstPass(
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
import { FormatTraceConstant } from "../../trace";
|
||||
import { IsMultilineMap, IsMultilineSecondPassState } from "../commonTypes";
|
||||
|
||||
import { expectGetIsMultiline, setIsMultiline } from "./common";
|
||||
import { IsMultilineMap, IsMultilineSecondPassState } from "../commonTypes";
|
||||
import { FormatTraceConstant } from "../../trace";
|
||||
|
||||
export function tryTraverseIsMultilineSecondPass(
|
||||
locale: string,
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
import { FormatTraceConstant } from "../../trace";
|
||||
|
||||
import { LinearLengthMap, LinearLengthState } from "../commonTypes";
|
||||
import { FormatTraceConstant } from "../../trace";
|
||||
|
||||
// Lazy evaluation of a potentially large PQP.Language.AST.
|
||||
// Returns the length of text if the node was formatted on a single line.
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import { IndentationChange, SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
import { expectGetIsMultiline } from "../isMultiline/common";
|
||||
import { isSectionMemeberSimilarScope, propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
import { expectGetIsMultiline } from "../isMultiline/common";
|
||||
|
||||
export function visitArrayWrapper(state: SerializeParameterState, node: PQP.Language.Ast.TArrayWrapper): void {
|
||||
const parent: PQP.Language.Ast.TNode = PQP.Parser.NodeIdMapUtils.assertUnboxParentAst(
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import {
|
||||
CommentCollection,
|
||||
SerializeCommentParameter,
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import { propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
import { SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
import { expectGetIsMultiline } from "../isMultiline/common";
|
||||
import { propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
|
||||
export function visitErrorHandlingExpression(
|
||||
state: SerializeParameterState,
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import { propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
import { SerializeParameter, SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
import { expectGetIsMultiline } from "../isMultiline/common";
|
||||
import { propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
|
||||
// TPairedConstant override
|
||||
export function visitErrorRaisingExpression(
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import { maybePropagateWriteKind, propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
import { SerializeParameter, SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
import { expectGetIsMultiline } from "../isMultiline/common";
|
||||
import { maybePropagateWriteKind, propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
|
||||
// TPairedConstant override
|
||||
export function visitFieldSpecification(
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import { SerializeParameter, SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
import { expectGetIsMultiline } from "../isMultiline/common";
|
||||
import { setWorkspace } from "./visitNodeUtils";
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
import { SerializeParameter, SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
|
||||
import { getWorkspace, propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
import { SerializeParameter, SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
|
||||
export function visitFieldTypeSpecification(
|
||||
state: SerializeParameterState,
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import { propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
import { SerializeParameter, SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
import { expectGetIsMultiline } from "../isMultiline/common";
|
||||
import { propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
|
||||
export function visitFunctionExpression(
|
||||
state: SerializeParameterState,
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
import { SerializeParameter, SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
|
||||
import { propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
import { SerializeParameter, SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
|
||||
export function visitFunctionType(state: SerializeParameterState, node: PQP.Language.Ast.FunctionType): void {
|
||||
propagateWriteKind(state, node, node.functionConstant);
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import { DefaultSerializeParameter, SerializeParameterState } from "../commonTypes";
|
||||
import { maybePropagateWriteKind, propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import { propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
import { SerializeParameter, SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
import { expectGetIsMultiline } from "../isMultiline/common";
|
||||
import { propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
|
||||
export function visitIfExpression(state: SerializeParameterState, node: PQP.Language.Ast.IfExpression): void {
|
||||
propagateWriteKind(state, node, node.ifConstant);
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import { IsMultilineMap, SerializeParameter, SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
import { expectGetIsMultiline } from "../isMultiline/common";
|
||||
import { setWorkspace } from "./visitNodeUtils";
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import { getWorkspace, maybeSetIndentationChange } from "./visitNodeUtils";
|
||||
import { SerializeParameter, SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
import { visitComments } from "./visitComments";
|
||||
import { getWorkspace, maybeSetIndentationChange } from "./visitNodeUtils";
|
||||
|
||||
export function visitLeaf(
|
||||
state: SerializeParameterState,
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
import { SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
|
||||
import { propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
import { SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
|
||||
export function visitLetExpression(state: SerializeParameterState, node: PQP.Language.Ast.LetExpression): void {
|
||||
propagateWriteKind(state, node, node.letConstant);
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import { SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
import { expectGetIsMultiline } from "../isMultiline/common";
|
||||
import { setWorkspace } from "./visitNodeUtils";
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import { propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
import { SerializeParameter, SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
import { expectGetIsMultiline } from "../isMultiline/common";
|
||||
import { propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
|
||||
export function visitMetadataExpression(
|
||||
state: SerializeParameterState,
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
import { SerializeParameter, SerializeParameterState } from "../commonTypes";
|
||||
import { getWorkspace, propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
|
||||
import { getWorkspace, propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
import { SerializeParameter, SerializeParameterState } from "../commonTypes";
|
||||
import { FormatTraceConstant } from "../../trace";
|
||||
import { visitArrayWrapper } from "./visitArrayWrapper";
|
||||
import { visitErrorHandlingExpression } from "./visitErrorHandlingExpression";
|
||||
import { visitErrorRaisingExpression } from "./visitErrorRaisingExpression";
|
||||
|
@ -33,7 +34,6 @@ import { visitTParameter } from "./visitTParameter";
|
|||
import { visitTWrapped } from "./visitTWrapped";
|
||||
import { visitTypePrimaryType } from "./visitTypePrimaryType";
|
||||
import { visitUnaryExpression } from "./visitUnaryExpression";
|
||||
import { FormatTraceConstant } from "../../trace";
|
||||
|
||||
export function visitNode(state: SerializeParameterState, node: PQP.Language.Ast.TNode): void {
|
||||
const trace: PQP.Trace.Trace = state.traceManager.entry(FormatTraceConstant.SerializeParameter, visitNode.name, {
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import {
|
||||
DefaultSerializeParameter,
|
||||
IndentationChange,
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import { SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
import { expectGetIsMultiline } from "../isMultiline/common";
|
||||
import { setWorkspace } from "./visitNodeUtils";
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
import { SerializeParameter, SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
|
||||
import { getWorkspace, propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
import { SerializeParameter, SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
|
||||
export function visitRangeExpression(state: SerializeParameterState, node: PQP.Language.Ast.RangeExpression): void {
|
||||
const workspace: SerializeParameter = getWorkspace(state, node);
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import { IsMultilineMap, SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
import { expectGetIsMultiline } from "../isMultiline/common";
|
||||
import { setWorkspace } from "./visitNodeUtils";
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import { IsMultilineMap, SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
import { expectGetIsMultiline } from "../isMultiline/common";
|
||||
import { propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
import { expectGetIsMultiline } from "../isMultiline/common";
|
||||
|
||||
export function visitSectionMember(state: SerializeParameterState, node: PQP.Language.Ast.SectionMember): void {
|
||||
const isMultilineMap: IsMultilineMap = state.isMultilineMap;
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import { propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
import { SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
import { expectGetIsMultiline } from "../isMultiline/common";
|
||||
import { propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
|
||||
export function visitTBinOpExpression(state: SerializeParameterState, node: PQP.Language.Ast.TBinOpExpression): void {
|
||||
propagateWriteKind(state, node, node.left);
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
import { SerializeParameter, SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
|
||||
import { getWorkspace, propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
import { SerializeParameter, SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
|
||||
export function visitTCsv(state: SerializeParameterState, node: PQP.Language.Ast.TCsv): void {
|
||||
const workspace: SerializeParameter = getWorkspace(state, node);
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import { IsMultilineMap, SerializeParameter, SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
import { expectGetIsMultiline } from "../isMultiline/common";
|
||||
import { propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
import { expectGetIsMultiline } from "../isMultiline/common";
|
||||
|
||||
export function visitTKeyValuePair(state: SerializeParameterState, node: PQP.Language.Ast.TKeyValuePair): void {
|
||||
const isMultilineMap: IsMultilineMap = state.isMultilineMap;
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import { propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
import { SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
import { expectGetIsMultiline } from "../isMultiline/common";
|
||||
import { propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
|
||||
export function visitTPairedConstant(state: SerializeParameterState, node: PQP.Language.Ast.TPairedConstant): void {
|
||||
propagateWriteKind(state, node, node.constant);
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import { SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
import { setWorkspace } from "./visitNodeUtils";
|
||||
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import { getWorkspace, propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
import { SerializeParameter, SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
import { expectGetIsMultiline } from "../isMultiline/common";
|
||||
import { getWorkspace, propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
|
||||
export function visitTWrapped(state: SerializeParameterState, node: PQP.Language.Ast.TWrapped): void {
|
||||
const isMultiline: boolean = expectGetIsMultiline(state.isMultilineMap, node);
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import { propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
import { SerializeParameter, SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
import { expectGetIsMultiline } from "../isMultiline/common";
|
||||
import { propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
|
||||
export function visitTableType(state: SerializeParameterState, node: PQP.Language.Ast.TableType): void {
|
||||
propagateWriteKind(state, node, node.tableConstant);
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import { propagateWriteKind, setWorkspace, skipPrimaryTypeIndentation } from "./visitNodeUtils";
|
||||
import { SerializeParameter, SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
import { expectGetIsMultiline } from "../isMultiline/common";
|
||||
import { propagateWriteKind, setWorkspace, skipPrimaryTypeIndentation } from "./visitNodeUtils";
|
||||
|
||||
export function visitTypePrimaryType(state: SerializeParameterState, node: PQP.Language.Ast.TypePrimaryType): void {
|
||||
propagateWriteKind(state, node, node.constant);
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
import { SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
|
||||
import { propagateWriteKind, setWorkspace } from "./visitNodeUtils";
|
||||
import { SerializeParameterState, SerializeWriteKind } from "../commonTypes";
|
||||
|
||||
export function visitUnaryExpression(state: SerializeParameterState, node: PQP.Language.Ast.UnaryExpression): void {
|
||||
propagateWriteKind(state, node, node.operators);
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// Licensed under the MIT license.
|
||||
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
|
||||
import {
|
||||
CommentCollectionMap,
|
||||
IndentationChange,
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
import "mocha";
|
||||
import * as PQP from "@microsoft/powerquery-parser";
|
||||
import { expect } from "chai";
|
||||
import "mocha";
|
||||
|
||||
import { FormatSettings, IndentationLiteral, NewlineLiteral, TriedFormat, tryFormat } from "..";
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче