question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

setting runStartupCommands as array

See original GitHub issue

Minor suggestion for improvement: python.dataScience.runStartupCommands must currently be a string. If you use it to run more than one or two commands, the string gets quite long, requiring a lot of horizontal scrolling, making it hard to read and even harder to modify.

How about also allowing that setting to be an array? If an array is detected, simply convert it to string internally:

if (Array.isArray(runStartupCommands)) runStartupCommands = runStartupCommands.join(`\n`)

Then you could have

"python.dataScience.runStartupCommands": [
  "%load_ext autoreload",
  "%autoreload 2",
  "import sys",
  "sys.path.append('${workspaceFolder}')",
  "sys.path.append('${workspaceFolder}/src')",
],

instead of

"python.dataScience.runStartupCommands": "%load_ext autoreload\n%autoreload 2\nimport sys\nsys.path.append('${workspaceFolder}')\nsys.path.append('${workspaceFolder}/src')",

Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer, @joyceerhl

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
rchiodocommented, Jul 9, 2020

I don’t believe it supports an or condition. You’ll have to just change it to array. However the code has to handle old settings so the actual code should be ‘string | string[]’

0reactions
janoshcommented, Jul 10, 2020

@joyceerhl I did install node@12 before trying npm ci but still ran into this error:

gyp: Call to 'node -e "require('nan')"' returned exit status 0 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
Read more comments on GitHub >

github_iconTop Results From Across the Web

python.dataScience is "Unknown Configuration Setting" in VS ...
dataScience.runStartupCommands", as it shows "Unknown Configuration Setting", now we don't use it to set Jupyter's "Intellisense" in VSCode.
Read more >
Switching Data Analytics Activities From Jupyter to Vscode
runStartupCommands setting ). We can use this capability to load the autoreload extension that enables the functionality described above.
Read more >
[Solved]-Run startup commands in spark-shell-scala
The workaround is to use :load :load /Users/steve/.scalarc. spark-shell does not support some command line parameters nor does it support :power mode ....
Read more >
Settings Reference for Python - Visual Studio Code
Python settings reference. The Python Extension for Visual Studio Code is highly configurable. This page describes the key settings you can work with....
Read more >
Using the Dockerfile ENTRYPOINT and CMD Instructions
... to run startup commands in Docker containers in this tutorial! ... always be written in exec form due to its “array like”...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found