prettier-plugin-apex
Advanced tools
Comparing version 1.0.0-rc.5 to 1.0.0-rc.6
## Unreleased | ||
# 1.0.0-rc.6 | ||
- Fix incorrect format for decimals/doubles ([issue](https://github.com/dangmai/prettier-plugin-apex/issues/88)). | ||
- Add support for Number Expression in SOQL Geolocation Literal ([issue](https://github.com/dangmai/prettier-plugin-apex/issues/90)). | ||
- Fix duplicated trailing empty lines for multiple expressions on the same line ([issue](https://github.com/dangmai/prettier-plugin-apex/issues/91)). | ||
- Fix expressions in Name Value Parameters not being indented ([issue](https://github.com/dangmai/prettier-plugin-apex/issues/93)). | ||
- Fix SOQL queries in binaryish expressions having extraneous indentations ([issue](https://github.com/dangmai/prettier-plugin-apex/issues/96)). | ||
- Fix SOQL query number being printed as different types (`big-decimal` to `int`) in certain situations. | ||
# 1.0.0-rc.5 | ||
@@ -4,0 +13,0 @@ |
{ | ||
"name": "prettier-plugin-apex", | ||
"version": "1.0.0-rc.5", | ||
"version": "1.0.0-rc.6", | ||
"description": "Salesforce Apex plugin for Prettier", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -170,3 +170,3 @@ # Prettier Apex [![Build Status](https://travis-ci.org/dangmai/prettier-plugin-apex.svg)](https://travis-ci.org/dangmai/prettier-plugin-apex) [![npm](https://img.shields.io/npm/v/prettier-plugin-apex.svg)](https://www.npmjs.com/package/prettier-plugin-apex) ![NPM](https://img.shields.io/npm/l/prettier-plugin-apex.svg) [![codecov](https://codecov.io/gh/dangmai/prettier-plugin-apex/branch/master/graph/badge.svg)](https://codecov.io/gh/dangmai/prettier-plugin-apex) [![Join the chat at https://gitter.im/prettier-plugin-apex/community](https://badges.gitter.im/prettier-plugin-apex/community.svg)](https://gitter.im/prettier-plugin-apex/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
# Or if installed locally | ||
node /path/to/libary/bin/start-apex-server.js | ||
node /path/to/library/bin/start-apex-server.js | ||
@@ -179,3 +179,3 @@ # In a separate console | ||
# Or if installed locally | ||
node /path/to/libary/bin/stop-apex-server.js | ||
node /path/to/library/bin/stop-apex-server.js | ||
``` |
@@ -205,2 +205,4 @@ const constants = { | ||
GEOLOCATION_LITERAL: "apex.jorje.data.soql.Geolocation$GeolocationLiteral", | ||
NUMBER_LITERAL: "apex.jorje.data.soql.NumberClause$NumberLiteral", | ||
NUMBER_EXPRESSION: "apex.jorje.data.soql.NumberClause$NumberExpr", | ||
QUERY_LITERAL_EXPRESSION: "apex.jorje.data.soql.QueryExpr$LiteralExpr", | ||
@@ -207,0 +209,0 @@ QUERY_LITERAL: "apex.jorje.data.soql.QueryLiteral", |
@@ -334,4 +334,27 @@ /* eslint no-param-reassign: 0 no-underscore-dangle: 0 */ | ||
if (typeof node[key] === "object") { | ||
if (Array.isArray(node) && parseInt(key, 10) === node.length - 1) { | ||
node[key].isLastNodeInArray = true; // So that we don't apply trailing empty line after this node | ||
if (Array.isArray(node)) { | ||
const keyInt = parseInt(key, 10); | ||
if (keyInt === node.length - 1) { | ||
node[key].isLastNodeInArray = true; // So that we don't apply trailing empty line after this node | ||
} else { | ||
// Here we flag a node if its next sibling is on the same line. | ||
// The reasoning is that for a block of code like this: | ||
// ``` | ||
// Integer a = 1; Integer c = 2; Integer c = 3; | ||
// | ||
// Integer d = 4; | ||
// ``` | ||
// We don't want a trailing empty line after `Integer a = 1;` | ||
// so we need to mark it as a special node. | ||
const currentChildNode = node[keyInt]; | ||
const nextChildNode = node[keyInt + 1]; | ||
if ( | ||
nextChildNode && | ||
nextChildNode.loc && | ||
currentChildNode.loc && | ||
nextChildNode.loc.startLine === currentChildNode.loc.endLine | ||
) { | ||
node[keyInt].isNextStatementOnSameLine = true; | ||
} | ||
} | ||
} | ||
@@ -351,3 +374,4 @@ generateExtraMetadata( | ||
allowTrailingEmptyLine && | ||
!node.isLastNodeInArray | ||
!node.isLastNodeInArray && | ||
!node.isNextStatementOnSameLine | ||
) { | ||
@@ -354,0 +378,0 @@ const nextLine = nodeLoc.endLine + 1; |
@@ -82,2 +82,3 @@ /* eslint no-param-reassign: 0 */ | ||
"numberOfDottedExpressions", | ||
"isNextStatementOnSameLine", | ||
]; | ||
@@ -84,0 +85,0 @@ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16124107
4203