Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

prettier-plugin-apex

Package Overview
Dependencies
Maintainers
2
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prettier-plugin-apex - npm Package Compare versions

Comparing version 1.0.0-beta.1 to 1.0.0-beta.2

3

CHANGELOG.md
## Unreleased
## 1.0.0-beta.2
- Fix long static method calls producing undeployable code ([issue](https://github.com/dangmai/prettier-plugin-apex/issues/69)).
## 1.0.0-beta.1

@@ -4,0 +7,0 @@ - Add support for Anonymous Code block with `--apex-anonymous` option.

2

package.json
{
"name": "prettier-plugin-apex",
"version": "1.0.0-beta.1",
"version": "1.0.0-beta.2",
"description": "Salesforce Apex plugin for Prettier",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -291,41 +291,2 @@ /* eslint no-param-reassign: 0 no-underscore-dangle: 0 */

/**
* jorje sometimes gives us different ASTs depending on the white spaces
* between keywords (#38), which makes it very difficult to know how many
* nested expressions there are in a method call or a variable expression.
* This method is used to calculate that number.
* After this method is called on a node that contains a `dottedExpr`,
* that node will contain a `numberOfDottedExpressions` property.
* @param node the current node being visited.
*/
function generateDottedExpressionMetadata(node) {
Object.keys(node).forEach(key => {
if (typeof node[key] === "object") {
node[key] = generateDottedExpressionMetadata(node[key]);
}
if (key === "dottedExpr") {
node.numberOfDottedExpressions = 1;
if (node.names) {
node.numberOfDottedExpressions = node.names.length;
}
if (node.dottedExpr && node.dottedExpr.value) {
if (node.dottedExpr.value.numberOfDottedExpressions) {
node.numberOfDottedExpressions +=
node.dottedExpr.value.numberOfDottedExpressions;
} else if (
node.dottedExpr.value["@class"] === apexTypes.ARRAY_EXPRESSION &&
node.dottedExpr.value.expr.numberOfDottedExpressions
) {
node.numberOfDottedExpressions +=
node.dottedExpr.value.expr.numberOfDottedExpressions;
} else {
node.numberOfDottedExpressions += 1;
}
}
}
});
return node;
}
// For each node, the jorje compiler gives us its line and its index within

@@ -434,3 +395,2 @@ // that line; however we use this method to resolve that line index to a global

ast = resolveLineIndexes(ast, lineIndexes);
ast = generateDottedExpressionMetadata(ast);

@@ -437,0 +397,0 @@ generateExtraMetadata(ast, getEmptyLineLocations(sourceCode), true);

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc