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 to 1.1.0

18

CHANGELOG.md

@@ -0,7 +1,25 @@

# 1.1.0
## Dependency Changes
- Prettier >= 1.19 is now required to be used with this plugin,
in order to support new option type `string`.
## CLI Changes
- Add option `apexStandaloneHost`, default to `localhost`.
## Formatting Changes
- Fix last comment in Annotations being put in wrong location ([issue](https://github.com/dangmai/prettier-plugin-apex/issues/142)).
- Fix Name Value Parameters using more newlines than necessary ([issue](https://github.com/dangmai/prettier-plugin-apex/issues/136)).
# 1.0.0
## API Changes
- Remove `--apex-anonymous` option, use `apex-anonymous` parser instead ([issue](https://github.com/dangmai/prettier-plugin-apex/issues/106)).
## Formatting Changes
- By default, add curly bracket spacing for maps, lists and sets ([issue](https://github.com/dangmai/prettier-plugin-apex/issues/99)).

@@ -8,0 +26,0 @@ - Fix extraneous linebreaks being added after `this` variable expression ([issue](https://github.com/dangmai/prettier-plugin-apex/issues/98)).

6

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

@@ -41,6 +41,6 @@ "main": "src/index.js",

"jest": "^24.1.0",
"prettier": "^1.17.0"
"prettier": "^1.19.0"
},
"peerDependencies": {
"prettier": "^1.17.0"
"prettier": "^1.19.0"
},

@@ -47,0 +47,0 @@ "dependencies": {

@@ -118,12 +118,13 @@ # 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)

| Name | Default | Description |
| ------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `printWidth` | `80` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)) |
| `tabWidth` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)) |
| `useTabs` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tabs)) |
| `requirePragma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#require-pragma)) |
| `insertPragma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#insert-pragma)) |
| `apexInsertFinalNewline` | `true` | Whether a newline is added as the last thing in the output |
| `apexStandaloneParser` | `none` | If set to `built-in`, Prettier uses the built in standalone parser for better performance. See [Performance Tip](#performance-tips3rd-party-integration).<br>If set to `none`, Prettier invokes the CLI parser for every file. |
| `apexStandalonePort` | `2117` | The port that the standalone Apex parser listens on.<br>Only applicable if `apexStandaloneParser` is `built-in`. |
| Name | Default | Description |
| ------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `printWidth` | `80` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#print-width)) |
| `tabWidth` | `2` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tab-width)) |
| `useTabs` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#tabs)) |
| `requirePragma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#require-pragma)) |
| `insertPragma` | `false` | Same as in Prettier ([see prettier docs](https://prettier.io/docs/en/options.html#insert-pragma)) |
| `apexInsertFinalNewline` | `true` | Whether a newline is added as the last thing in the output |
| `apexStandaloneParser` | `none` | If set to `built-in`, Prettier uses the built in standalone parser for better performance. See [Performance Tip](#performance-tips3rd-party-integration).<br>If set to `none`, Prettier invokes the CLI parser for every file. |
| `apexStandalonePort` | `2117` | The port that the standalone Apex parser listens on.<br>Only applicable if `apexStandaloneParser` is `built-in`. |
| `apexStandaloneHost` | `localhost` | The host that the standalone Apex parser listens on.<br>Only applicable if `apexStandaloneParser` is `built-in`. |

@@ -130,0 +131,0 @@ ## Editor integration

@@ -93,2 +93,9 @@ const {

},
apexStandaloneHost: {
type: "string",
category: "Global",
default: "localhost",
description:
"The standalone server host to connect to. Only applicable if apexStandaloneParser is true. Default to localhost.",
},
apexStandalonePort: {

@@ -95,0 +102,0 @@ type: "int",

@@ -42,3 +42,3 @@ /* eslint no-param-reassign: 0 no-underscore-dangle: 0 */

function parseTextWithHttp(text, serverPort, anonymous) {
function parseTextWithHttp(text, serverHost, serverPort, anonymous) {
const httpClientLocation = path.join(__dirname, "http-client.js");

@@ -48,3 +48,3 @@ const args = [

"-a",
"localhost",
serverHost,
"-f",

@@ -161,2 +161,13 @@ "json",

function handleAnnotation(location, sourceCode, commentNodes, node) {
// This is an annotation without parameters, so we can use the identity
// location
if (!node.parameters || node.parameters.length === 0) {
return location;
}
// If not, we need to use the position of the closing parenthesis after the
// parameters
return handleNodeEndedWithCharacter(")")(location, sourceCode, commentNodes);
}
// We need to generate the location for a node differently based on the node

@@ -234,2 +245,3 @@ // type. This object holds a String => Function mapping in order to do that.

] = handleNodeEndedWithCharacter(")");
locationGenerationHandler[apexTypes.ANNOTATION] = handleAnnotation;
locationGenerationHandler[

@@ -476,2 +488,3 @@ apexTypes.METHOD_DECLARATION

sourceCode,
options.apexStandaloneHost,
options.apexStandalonePort,

@@ -478,0 +491,0 @@ options.parser === "apex-anonymous",

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