Skip to content

Commit 635ce06

Browse files
robertsk50DonJayamanne
authored andcommitted
Updated the syntax in configurationSnippets so that pythonVSCode variables are not improperly substituted. For example, $${{config:python.pythonPath}} turned into $python.pythonPath} which is missing the "{config:". This commit removes the tabstops in the configurationSnippets. (#980)
Also, created configurationSnippet for Pyramid apps.
1 parent 370d5be commit 635ce06

2 files changed

Lines changed: 66 additions & 41 deletions

File tree

package.json

Lines changed: 63 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -301,11 +301,11 @@
301301
"type": "python",
302302
"request": "launch",
303303
"stopOnEntry": true,
304-
"pythonPath": "$${{config:python.pythonPath}}",
305-
"program": "$${{file}}",
306-
"cwd": "$${{workspaceRoot}}",
304+
"pythonPath": "^\"\\${config:python.pythonPath}\"",
305+
"program": "^\"\\${file}\"",
306+
"cwd": "^\"\\${workspaceRoot}\"",
307307
"env": {},
308-
"envFile": "$${{workspaceRoot}}/.env",
308+
"envFile": "^\"\\${workspaceRoot}/.env\"",
309309
"debugOptions": [
310310
"WaitOnAbnormalExit",
311311
"WaitOnNormalExit",
@@ -322,18 +322,18 @@
322322
"request": "launch",
323323
"stopOnEntry": true,
324324
"osx": {
325-
"pythonPath": "$${{env:SPARK_HOME}}/bin/spark-submit"
325+
"pythonPath": "^\"\\${env:SPARK_HOME}/bin/spark-submit\""
326326
},
327327
"windows": {
328-
"pythonPath": "$${{env:SPARK_HOME}}/bin/spark-submit.cmd"
328+
"pythonPath": "^\"\\${env:SPARK_HOME}/bin/spark-submit.cmd\""
329329
},
330330
"linux": {
331-
"pythonPath": "$${{env:SPARK_HOME}}/bin/spark-submit"
331+
"pythonPath": "^\"\\${env:SPARK_HOME}/bin/spark-submit\""
332332
},
333-
"program": "$${{file}}",
334-
"cwd": "$${{workspaceRoot}}",
333+
"program": "^\"\\${file}\"",
334+
"cwd": "^\"\\${workspaceRoot}\"",
335335
"env": {},
336-
"envFile": "$${{workspaceRoot}}/.env",
336+
"envFile": "^\"\\${workspaceRoot}/.env\"",
337337
"debugOptions": [
338338
"WaitOnAbnormalExit",
339339
"WaitOnNormalExit",
@@ -349,11 +349,11 @@
349349
"type": "python",
350350
"request": "launch",
351351
"stopOnEntry": true,
352-
"pythonPath": "$${{config:python.pythonPath}}",
352+
"pythonPath": "^\"\\${config:python.pythonPath}\"",
353353
"module": "module.name",
354-
"cwd": "$${{workspaceRoot}}",
354+
"cwd": "^\"\\${workspaceRoot}\"",
355355
"env": {},
356-
"envFile": "$${{workspaceRoot}}/.env",
356+
"envFile": "^\"\\${workspaceRoot}/.env\"",
357357
"debugOptions": [
358358
"WaitOnAbnormalExit",
359359
"WaitOnNormalExit",
@@ -369,12 +369,12 @@
369369
"type": "python",
370370
"request": "launch",
371371
"stopOnEntry": true,
372-
"pythonPath": "$${{config:python.pythonPath}}",
373-
"program": "$${{file}}",
372+
"pythonPath": "^\"\\${config:python.pythonPath}\"",
373+
"program": "^\"\\${file}\"",
374374
"cwd": "",
375375
"console": "integratedTerminal",
376376
"env": {},
377-
"envFile": "$${{workspaceRoot}}/.env",
377+
"envFile": "^\"\\${workspaceRoot}/.env\"",
378378
"debugOptions": [
379379
"WaitOnAbnormalExit",
380380
"WaitOnNormalExit"
@@ -389,12 +389,12 @@
389389
"type": "python",
390390
"request": "launch",
391391
"stopOnEntry": true,
392-
"pythonPath": "$${{config:python.pythonPath}}",
393-
"program": "${{file}}",
392+
"pythonPath": "^\"\\${config:python.pythonPath}\"",
393+
"program": "^\"\\${file}\"",
394394
"cwd": "",
395395
"console": "externalTerminal",
396396
"env": {},
397-
"envFile": "$${{workspaceRoot}}/.env",
397+
"envFile": "^\"\\${workspaceRoot}/.env\"",
398398
"debugOptions": [
399399
"WaitOnAbnormalExit",
400400
"WaitOnNormalExit"
@@ -409,15 +409,15 @@
409409
"type": "python",
410410
"request": "launch",
411411
"stopOnEntry": true,
412-
"pythonPath": "$${{config:python.pythonPath}}",
413-
"program": "$${{workspaceRoot}/manage.py",
414-
"cwd": "$${{workspaceRoot}}",
412+
"pythonPath": "^\"\\${config:python.pythonPath}\"",
413+
"program": "^\"\\${workspaceRoot}/manage.py\"",
414+
"cwd": "^\"\\${workspaceRoot}\"",
415415
"args": [
416416
"runserver",
417417
"--noreload"
418418
],
419419
"env": {},
420-
"envFile": "$${{workspaceRoot}}/.env",
420+
"envFile": "^\"\\${workspaceRoot}/.env\"",
421421
"debugOptions": [
422422
"WaitOnAbnormalExit",
423423
"WaitOnNormalExit",
@@ -434,18 +434,18 @@
434434
"type": "python",
435435
"request": "launch",
436436
"stopOnEntry": false,
437-
"pythonPath": "$${{config:python.pythonPath}}",
437+
"pythonPath": "^\"\\${config:python.pythonPath}\"",
438438
"program": "fully qualified path fo 'flask' executable. Generally located along with python interpreter",
439-
"cwd": "$${{workspaceRoot}}",
439+
"cwd": "^\"\\${workspaceRoot}\"",
440440
"env": {
441-
"FLASK_APP": "$${{workspaceRoot}}/quickstart/app.py"
441+
"FLASK_APP": "^\"\\${workspaceRoot}/quickstart/app.py\""
442442
},
443443
"args": [
444444
"run",
445445
"--no-debugger",
446446
"--no-reload"
447447
],
448-
"envFile": "$${{workspaceRoot}}/.env",
448+
"envFile": "^\"\\${workspaceRoot}/.env\"",
449449
"debugOptions": [
450450
"WaitOnAbnormalExit",
451451
"WaitOnNormalExit",
@@ -461,19 +461,42 @@
461461
"type": "python",
462462
"request": "launch",
463463
"stopOnEntry": false,
464-
"pythonPath": "$${{config:python.pythonPath}}",
465-
"program": "$${{workspaceRoot}}/run.py",
466-
"cwd": "$${{workspaceRoot}}",
464+
"pythonPath": "^\"\\${config:python.pythonPath}\"",
465+
"program": "^\"\\${workspaceRoot}/run.py\"",
466+
"cwd": "^\"\\${workspaceRoot}\"",
467467
"args": [],
468468
"env": {},
469-
"envFile": "$${{workspaceRoot}}/.env",
469+
"envFile": "^\"\\${workspaceRoot}/.env\"",
470470
"debugOptions": [
471471
"WaitOnAbnormalExit",
472472
"WaitOnNormalExit",
473473
"RedirectOutput"
474474
]
475475
}
476476
},
477+
{
478+
"label": "%python.snippet.launch.pyramid.label%",
479+
"description": "%python.snippet.launch.pyramid.description%",
480+
"body": {
481+
"name": "Pyramid",
482+
"type": "python",
483+
"request": "launch",
484+
"stopOnEntry": true,
485+
"pythonPath": "^\"\\${config:python.pythonPath}\"",
486+
"cwd": "^\"\\${workspaceRoot}\"",
487+
"env": {},
488+
"envFile": "^\"\\${workspaceRoot}/.env\"",
489+
"args": [
490+
"^\"\\${workspaceRoot}/development.ini\""
491+
],
492+
"debugOptions": [
493+
"WaitOnAbnormalExit",
494+
"WaitOnNormalExit",
495+
"RedirectOutput",
496+
"Pyramid"
497+
]
498+
}
499+
},
477500
{
478501
"label": "%python.snippet.launch.watson.label%",
479502
"description": "%python.snippet.launch.watson.description%",
@@ -482,16 +505,16 @@
482505
"type": "python",
483506
"request": "launch",
484507
"stopOnEntry": true,
485-
"pythonPath": "$${{config:python.pythonPath}}",
486-
"program": "$${{workspaceRoot}}/console.py",
487-
"cwd": "$${{workspaceRoot}}",
508+
"pythonPath": "^\"\\${config:python.pythonPath}\"",
509+
"program": "^\"\\${workspaceRoot}/console.py\"",
510+
"cwd": "^\"\\${workspaceRoot}\"",
488511
"args": [
489512
"dev",
490513
"runserver",
491514
"--noreload=True"
492515
],
493516
"env": {},
494-
"envFile": "$${{workspaceRoot}}/.env",
517+
"envFile": "^\"\\${workspaceRoot}/.env\"",
495518
"debugOptions": [
496519
"WaitOnAbnormalExit",
497520
"WaitOnNormalExit",
@@ -507,9 +530,9 @@
507530
"type": "python",
508531
"request": "launch",
509532
"stopOnEntry": true,
510-
"pythonPath": "$${{config:python.pythonPath}}",
533+
"pythonPath": "^\"\\${config:python.pythonPath}\"",
511534
"program": "~/.virtualenvs/scrapy/bin/scrapy",
512-
"cwd": "$${{workspaceRoot}}",
535+
"cwd": "^\"\\${workspaceRoot}\"",
513536
"args": [
514537
"crawl",
515538
"specs",
@@ -518,7 +541,7 @@
518541
],
519542
"console": "integratedTerminal",
520543
"env": {},
521-
"envFile": "$${{workspaceRoot}}/.env",
544+
"envFile": "^\"\\${workspaceRoot}/.env\"",
522545
"debugOptions": [
523546
"WaitOnAbnormalExit",
524547
"WaitOnNormalExit"
@@ -532,8 +555,8 @@
532555
"name": "Attach (Remote Debug)",
533556
"type": "python",
534557
"request": "attach",
535-
"localRoot": "$${{workspaceRoot}}",
536-
"remoteRoot": "$${{workspaceRoot}}",
558+
"localRoot": "^\"\\${workspaceRoot}\"",
559+
"remoteRoot": "^\"\\${workspaceRoot}\"",
537560
"port": 3000,
538561
"secret": "my_secret",
539562
"host": "localhost"

package.nls.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
"python.snippet.launch.externalTerminal.description": "Debug a Python program with External Terminal/Console",
1212
"python.snippet.launch.django.label": "Django Application",
1313
"python.snippet.launch.django.description": "Debug a Django Application",
14-
"python.snippet.launch.flask.label": "Django Application",
14+
"python.snippet.launch.flask.label": "Flask Application",
1515
"python.snippet.launch.flask.description": "Debug a Flask Application",
1616
"python.snippet.launch.flaskOld.label": "Flask (old) Application",
1717
"python.snippet.launch.flaskOld.description": "Debug an older styled Flask Application",
18+
"python.snippet.launch.pyramid.label": "Pyramid Application",
19+
"python.snippet.launch.pyramid.description": "Debug a Pyramid Application",
1820
"python.snippet.launch.watson.label": "Watson Application",
1921
"python.snippet.launch.watson.description": "Debug a Watson Application",
2022
"python.snippet.launch.attach.label": "Attach Python Debugger",

0 commit comments

Comments
 (0)