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-alpha.5 to 1.0.0-alpha.6

0

bin/start-apex-server.js

@@ -0,0 +0,0 @@ #!/usr/bin/env node

@@ -0,0 +0,0 @@ #!/usr/bin/env node

11

CHANGELOG.md

@@ -0,2 +1,13 @@

## 1.0.0-alpha.6
- Fix formatting for trailing comments at the end of block statements ([issue](https://github.com/dangmai/prettier-plugin-apex/issues/12)).
- Fix issue in which comments right before semi colon are not printed ([issue](https://github.com/dangmai/prettier-plugin-apex/issues/11)).
- Assert that all comments have been printed out in the formatted code.
- Fix long expressions not breaking into multi lines ([issue](https://github.com/dangmai/prettier-plugin-apex/issues/16)).
## 1.0.0-alpha.5
- Fix `apex-ast-serializer` executables not having their execute bits set on *nix ([issue](https://github.com/dangmai/prettier-plugin-apex/issues/10)).
## 1.0.0-alpha.4
- Support `WITH SECURITY_ENFORCED` in SOQL ([issue](https://github.com/dangmai/prettier-plugin-apex/issues/9)).

@@ -3,0 +14,0 @@ - Fix `npm scripts` pointing to old files.

@@ -0,0 +0,0 @@ Copyright (c) 2018 Dang Mai

16

package.json
{
"name": "prettier-plugin-apex",
"version": "1.0.0-alpha.5",
"version": "1.0.0-alpha.6",
"description": "Salesforce Apex plugin for Prettier",

@@ -33,9 +33,9 @@ "main": "src/index.js",

"devDependencies": {
"eslint": "^5.9.0",
"eslint": "^5.15.1",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-config-prettier": "^3.3.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-prettier": "^3.0.0",
"jest": "^23.6.0",
"prettier": "^1.15.0"
"eslint-config-prettier": "^4.1.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-prettier": "^3.0.1",
"jest": "^24.1.0",
"prettier": "^1.16.4"
},

@@ -49,4 +49,4 @@ "peerDependencies": {

"wait-on": "^3.2.0",
"yargs": "^12.0.5"
"yargs": "^13.2.1"
}
}

@@ -0,0 +0,0 @@ # Prettier Apex [![Build Status](https://travis-ci.org/dangmai/prettier-plugin-apex.svg)](https://travis-ci.org/dangmai/prettier-plugin-apex)

@@ -7,3 +7,3 @@ /* eslint no-param-reassign: 0, no-plusplus: 0, no-else-return: 0, consistent-return: 0 */

const { concat, hardline } = prettier.doc.builders;
const { concat, lineSuffix, hardline } = prettier.doc.builders;
const { skipWhitespace } = prettier.util;

@@ -214,5 +214,14 @@ const childNodesCacheKey = require("private").makeUniqueKey();

} else if (pn) {
// No contest: we have a trailing comment.
breakTies(tiesToBreak, sourceCode);
addTrailingComment(pn, comment);
if (en && en["@class"] === apexNames.BLOCK_STATEMENT && !fn) {
// Special case: this is a trailing comment in a block statement
breakTies(tiesToBreak, sourceCode);
// Our algorithm for attaching comment generally attaches the comment
// to the last node, however we want to attach this comment to the last
// statement node instead.
addTrailingComment(en.stmnts[en.stmnts.length - 1], comment);
} else {
// No contest: we have a trailing comment.
breakTies(tiesToBreak, sourceCode);
addTrailingComment(pn, comment);
}
} else if (fn) {

@@ -234,2 +243,3 @@ // No contest: we have a leading comment.

comments.forEach(comment => {
comment.printed = false;
// These node references were useful for breaking ties, but we

@@ -269,2 +279,3 @@ // don't need them anymore, and they create cycles in the AST that

}
comment.printed = true;
return concat(parts);

@@ -286,6 +297,3 @@ }

if (leadingSpace.length > 0 && numberOfNewLines === 0) {
// If the leading space contains no newlines, then we add at most 1 space
parts.push(" ");
} else if (numberOfNewLines > 0) {
if (numberOfNewLines > 0) {
// If the leading space contains newlines, then add at most 2 new lines

@@ -295,4 +303,21 @@ const numberOfNewLinesToInsert = Math.min(numberOfNewLines, 2);

}
parts.push(print(commentPath));
if (comment["@class"] === apexNames.INLINE_COMMENT) {
// When we print trailing inline comments, we have to make sure that nothing
// else is printed after it (e.g. a semicolon), so we'll use lineSuffix
// from prettier to buffer the output
if (leadingSpace.length > 0 && numberOfNewLines === 0) {
parts.push(lineSuffix(concat([" ", print(commentPath)])));
} else {
parts.push(lineSuffix(print(commentPath)));
}
} else {
// Handling block comment, which does not need lineSuffix
if (leadingSpace.length > 0 && numberOfNewLines === 0) {
// If the leading space contains no newlines, then we add at most 1 space
parts.push(" ");
}
parts.push(print(commentPath));
}
comment.printed = true;
return concat(parts);

@@ -347,2 +372,12 @@ }

trailingParts.push(printTrailingComment(commentPath, options, print));
} else if (!leading && !trailing) {
// Dangling comments
// Note: in this statement `Integer a = 1 /* Comment */;`
// the comment is considered dangling, since jorje considers the literal
// number 1 node to end after the comment
trailingParts.push(printTrailingComment(commentPath, options, print));
} else {
throw new Error(
"Comment is not printed because we cannot determine its property. Please submit a bug report with your code sample",
);
}

@@ -349,0 +384,0 @@ }, "apexComments");

@@ -0,0 +0,0 @@ #!/usr/bin/env node

@@ -0,0 +0,0 @@ const parse = require("./parser");

@@ -0,0 +0,0 @@ const { argv } = require("yargs");

@@ -0,0 +0,0 @@ const { spawn } = require("child_process");

@@ -0,0 +0,0 @@ /* eslint no-param-reassign:0 */

@@ -0,0 +0,0 @@ const values = {

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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