Repository navigation
Expand file tree
/
Copy pathpackage.json
More file actions
239 lines (239 loc) · 7.82 KB
/
Copy pathpackage.json
File metadata and controls
239 lines (239 loc) · 7.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
{
"name": "python-image-preview",
"displayName": "Python Image Preview",
"description": "Preview arrays, tensors and figures while debugging: NumPy, Pillow, OpenCV, Matplotlib, Seaborn, Plotly, pandas, TensorFlow, PyTorch, JAX, CuPy, SimpleITK, nibabel, Bokeh, Altair",
"version": "1.1.0",
"publisher": "076923",
"license": "SEE LICENSE IN LICENSE.md",
"engines": {
"vscode": "^1.90.0"
},
"extensionKind": [
"workspace"
],
"icon": "images/brand/icon.png",
"galleryBanner": {
"color": "#1a2038",
"theme": "dark"
},
"categories": [
"Debuggers",
"Data Science",
"Machine Learning",
"Visualization"
],
"keywords": [
"python",
"image",
"numpy",
"pillow",
"opencv",
"matplotlib",
"pyplot",
"figure",
"seaborn",
"plotly",
"imageio",
"scikit-image",
"skimage",
"tensorflow",
"pytorch",
"jax",
"cupy",
"pandas",
"simpleitk",
"nibabel",
"bokeh",
"altair",
"preview",
"debug",
"debugpy"
],
"repository": {
"type": "git",
"url": "https://github.com/076923/python-image-preview"
},
"bugs": {
"url": "https://github.com/076923/python-image-preview/issues"
},
"qna": "https://github.com/076923/python-image-preview/issues",
"activationEvents": [
"onDebugResolve:python",
"onDebugResolve:debugpy"
],
"main": "./dist/extension.js",
"contributes": {
"commands": [
{
"command": "pythonImagePreview.preview",
"title": "Preview Image at Cursor",
"category": "Python Image Preview",
"enablement": "inDebugMode && editorLangId == python"
},
{
"command": "pythonImagePreview.previewVariable",
"title": "Preview Image",
"category": "Python Image Preview",
"enablement": "inDebugMode"
},
{
"command": "pythonImagePreview.render",
"title": "Render Preview",
"category": "Python Image Preview"
},
{
"command": "pythonImagePreview.openSettings",
"title": "Open Settings",
"category": "Python Image Preview"
},
{
"command": "pythonImagePreview.clearCache",
"title": "Clear Preview Cache",
"category": "Python Image Preview"
}
],
"menus": {
"editor/context": [
{
"command": "pythonImagePreview.preview",
"when": "inDebugMode && editorLangId == python",
"group": "navigation@50"
}
],
"debug/variables/context": [
{
"command": "pythonImagePreview.previewVariable",
"when": "debugType =~ /^(python|debugpy)$/",
"group": "navigation@50"
}
],
"commandPalette": [
{
"command": "pythonImagePreview.previewVariable",
"when": "false"
},
{
"command": "pythonImagePreview.render",
"when": "false"
}
]
},
"configuration": {
"title": "Python Image Preview",
"properties": {
"pythonImagePreview.keepHistory": {
"order": 2,
"type": "boolean",
"default": false,
"markdownDescription": "Write every preview to a new file (`name-HHMMSS-mmm.png`) so each one opens in its own tab and earlier previews stay open for comparison. When off, a variable always reuses the same file."
},
"pythonImagePreview.cacheDirectory": {
"order": 1,
"type": "string",
"default": "",
"markdownDescription": "Directory where preview images are written. Leave empty to use a folder under the OS temp directory. Supports `${workspaceFolder}`, `${workspaceFolderBasename}`, `${fileDirname}`, `${fileBasenameNoExtension}`, `${userHome}`, `${tmpdir}` and `${env:NAME}`. The debugged Python process must be able to write here."
},
"pythonImagePreview.clearOnSessionEnd": {
"order": 3,
"type": "boolean",
"default": true,
"description": "Delete preview images when the debug session ends."
},
"pythonImagePreview.openBeside": {
"order": 4,
"type": "boolean",
"default": true,
"description": "Open the preview in a column beside the editor instead of the active column."
},
"pythonImagePreview.hoverPreview": {
"order": 6,
"type": "boolean",
"default": true,
"markdownDescription": "Show a thumbnail and the shape/dtype of an image-like variable when hovering it while the debugger is paused. VS Code shows the debugger's own hover first; hold `Alt` (`Option` on macOS) while hovering to see this one. The thumbnail is rendered in the debugged process the first time a variable is hovered at a given stop."
},
"pythonImagePreview.hoverThumbnailWidth": {
"order": 7,
"type": "number",
"default": 320,
"minimum": 64,
"maximum": 800,
"description": "Maximum width in pixels of the thumbnail shown in the hover. The image is scaled down to fit both limits, keeping its aspect ratio."
},
"pythonImagePreview.hoverThumbnailHeight": {
"order": 8,
"type": "number",
"default": 120,
"minimum": 48,
"maximum": 600,
"description": "Maximum height in pixels of the thumbnail shown in the hover. Keep it small enough for the hover to show without scrolling; when hovering a variable name with Alt, other extensions' hovers (e.g. Pylance) share the same popup."
},
"pythonImagePreview.inlineThumbnails": {
"order": 9,
"type": "boolean",
"default": true,
"markdownDescription": "While paused, show a small thumbnail right before each visible mention of an image-like local variable. Hover the thumbnail for a larger preview and the renderer links. Thumbnails are rendered in the debugged process once per stop and variable."
},
"pythonImagePreview.inlineThumbnailHeight": {
"order": 10,
"type": "number",
"default": 0,
"minimum": 0,
"maximum": 48,
"markdownDescription": "Height in pixels of the inline thumbnail. `0` follows the editor line height (from `#editor.lineHeight#` or `#editor.fontSize#`). Larger values make neighbouring lines overlap."
},
"pythonImagePreview.inlineThumbnailLimit": {
"order": 11,
"type": "number",
"default": 40,
"minimum": 1,
"maximum": 500,
"description": "Maximum number of variables rendered as inline thumbnails per stop, nearest to the paused line first. Lower it if stepping feels slow in functions with many large images."
},
"pythonImagePreview.inlineValues": {
"order": 12,
"type": "string",
"enum": ["images", "all", "off"],
"default": "off",
"markdownEnumDescriptions": [
"Show `img: (480, 640, 3) uint8` for image-like local variables only. Other variables show no inline value.",
"Image-like variables show their shape and dtype; every other variable shows its value as VS Code normally does.",
"Leave inline values entirely to VS Code."
],
"markdownDescription": "What to show at the end of lines while paused (requires `#debug.inlineValues#` to be `auto` or `on`)."
},
"pythonImagePreview.grayscaleColormap": {
"order": 5,
"type": "string",
"default": "gray",
"markdownDescription": "Matplotlib colormap applied when a 2-D (single-channel) array is rendered with the Matplotlib renderer, e.g. `gray`, `viridis`, `magma`. Color arrays are not affected."
}
}
}
},
"scripts": {
"vscode:prepublish": "npm run package",
"compile": "npm run check-types && npm run lint && node esbuild.mjs",
"watch": "npm-run-all -p watch:*",
"watch:esbuild": "node esbuild.mjs --watch",
"watch:tsc": "tsc --noEmit --watch -p ./",
"package": "npm run check-types && npm run lint && node esbuild.mjs --production",
"check-types": "tsc --noEmit -p ./",
"lint": "eslint src",
"pretest": "tsc -p ./ && npm run lint",
"test": "vscode-test",
"vsix": "vsce package --out vsix/"
},
"devDependencies": {
"@types/mocha": "^10.0.10",
"@types/node": "^20.19.0",
"@types/vscode": "^1.90.0",
"@vscode/test-cli": "^0.0.15",
"@vscode/test-electron": "^3.1.0",
"@vscode/vsce": "^3.6.0",
"esbuild": "^0.28.0",
"eslint": "^9.39.0",
"npm-run-all": "^4.1.5",
"typescript": "^5.9.0",
"typescript-eslint": "^8.72.0"
}
}