Skip to content

Commit 6375132

Browse files
committed
feat: add debug code with json stringify for react
1 parent 5cc1327 commit 6375132

File tree

5 files changed

+26
-1
lines changed

5 files changed

+26
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Fixed for any bug fixes.
99
Security to invite users to upgrade in case of vulnerabilities.
1010
-->
1111

12+
## 1.5.0 - 2024/
13+
1214
## 1.4.2 - 2023/04/17
1315

1416
### Fixed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ Below is a list of all available snippets and the triggers of each one. The `░
113113
| `cgw→` | group wrapper | <code>console.group(░label)<br/>█<br/>console.groupEnd(░label)</code> |
114114
| `clr→` | [clear](https://developer.mozilla.org/en-US/docs/Web/API/Console/clear) | `console.clear()█` |
115115

116+
### React
117+
118+
| Trigger | Description | Result JSX/TSX |
119+
| ------: | ------------------------------- | ----------------------------------------------------------- |
120+
| `csd→` | console code with destructuring | `<pre><code>JSON.stringify({░name}, null, 2)</code></pre>█` |
121+
116122
### Styles
117123

118124
| Trigger | Description | Result CSS |

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "debug-snippets",
33
"description": "VS Code Debug snippets for JS, TS and CSS",
4-
"version": "1.4.2",
4+
"version": "1.5.0",
55
"displayName": "Debug Snippets",
66
"publisher": "deinsoftware",
77
"icon": "images/light-icon.png",
@@ -47,10 +47,18 @@
4747
"language": "jsx-attr",
4848
"path": "./snippets/code.json"
4949
},
50+
{
51+
"language": "jsx-attr",
52+
"path": "./snippets/react.json"
53+
},
5054
{
5155
"language": "javascriptreact",
5256
"path": "./snippets/code.json"
5357
},
58+
{
59+
"language": "javascriptreact",
60+
"path": "./snippets/react.json"
61+
},
5462
{
5563
"language": "typescript",
5664
"path": "./snippets/code.json"

snippets/react.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"consoleCodeDestructuring": {
3+
"prefix": "ccd",
4+
"body": "<pre><code>JSON.stringify({${1:name}}, null, 2)</code></pre>$0",
5+
"description": "Console Code with Destructuring"
6+
}
7+
}

test/snippets.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { it, expect, describe } from 'vitest'
22

33
const codeSnippets = require("../snippets/code.json")
4+
const reactSnippets = require("../snippets/react.json")
45
const stylesSnippets = require("../snippets/styles.json")
56

67
const snippets = {
78
...codeSnippets,
9+
...reactSnippets,
810
...stylesSnippets,
911
}
1012

0 commit comments

Comments
 (0)