Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(jsonc-parser): do not trim empty lines by JSONC formatter #60

Merged
merged 4 commits into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
# Change Log
​# Change Log

​## 1.3.20
​​​​​​
### Fixed​

- JSON formatter does not remove ​​​​​​​​​​​​empty lines​​
​​​
### Updated​

- `jsonc-parser` library upgraded from ​v2 to v3

## 1.3.19

### Fixed

- `vm2` library security patch
- `vm2` library security patch

## 1.3.18

Expand Down Expand Up @@ -74,8 +84,8 @@

## 1.3.7

### Updated

### Updated
- Using Update instead of Publish on Web Hooks​​
- Fixed Top Level string RPC calls in JSONCs
- Fixed Export Command
Expand Down
2 changes: 1 addition & 1 deletion extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ async function activate(context) {
vscode.languages.registerDocumentFormattingEditProvider({ language: 'imljson', scheme: 'file' }, {
provideDocumentFormattingEdits(document) {
let text = document.getText()
let edits = jsoncParser.format(text, undefined, { insertSpaces: 4 })
let edits = jsoncParser.format(text, undefined, { insertSpaces: true, tabSize: 4, keepLines: true })
return edits.map(edit => {
let start = document.positionAt(edit.offset)
let end = document.positionAt(edit.offset + edit.length)
Expand Down
24 changes: 17 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "apps-sdk",
"displayName": "Make Apps SDK",
"description": "Make Apps SDK plugin for Visual Studio Code",
"version": "1.3.19",
"version": "1.3.20",
"icon": "resources/make.png",
"repository": {
"type": "git",
Expand Down Expand Up @@ -759,7 +759,7 @@
"compressing": "^1.5.1",
"image-downloader": "^3.6.0",
"jimp": "^0.10.3",
"jsonc-parser": "^2.3.0",
"jsonc-parser": "^3.2.0",
"lodash.camelcase": "^4.3.0",
"lodash.kebabcase": "^4.1.1",
"lodash.pick": "^4.4.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Core.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ module.exports = {
},

formatJsonc: function (text) {
let edits = jsoncParser.format(text, undefined, { insertSpaces: 4 })
let edits = jsoncParser.format(text, undefined, { insertSpaces: true, tabSize: 4, keepLines: true })
let formatted = jsoncParser.applyEdits(text, edits)
return formatted
},
Expand Down
2 changes: 1 addition & 1 deletion src/Meta.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
version: '1.3.19'
version: '1.3.20'
};