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.

Running untitled files prompts to save them but run command doesn't use new name

See original GitHub issue

Issue Type: Bug

Behaviour

Expected vs. Actual

When you create a new file, don’t save it and click on the run button, you’re prompted to save the file. I’d expect that once the file is saved, the new file would be run. Instead, the command is generated with the “untitled name” (if that’s even a thing), and not the new file name.

Steps to reproduce:

  1. Create a new file through File > New file
  2. Select language as Python
  3. Write something, e.g. print("hi")
  4. Don’t save the file!!!
  5. Click on the run button
  6. See the prompt to save the file
  7. Save the file
  8. Watch the file disappear for some weird reason, and the run command be sent with the “untitled name”

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.8.10
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Venv
  • Value of the python.languageServer setting: Pylance
User Settings


defaultLS: {"defaultLSType":"Pylance"}

downloadLanguageServer: true

envFile: "<placeholder>"

venvPath: "<placeholder>"

venvFolders: "<placeholder>"

condaPath: "<placeholder>"

pipenvPath: "<placeholder>"

poetryPath: "<placeholder>"

languageServer: "Pylance"

linting
• enabled: true
• cwd: "<placeholder>"
• Flake8Args: "<placeholder>"
• flake8Enabled: false
• flake8Path: "<placeholder>"
• lintOnSave: true
• banditArgs: "<placeholder>"
• banditEnabled: false
• banditPath: "<placeholder>"
• mypyArgs: "<placeholder>"
• mypyEnabled: false
• mypyPath: "<placeholder>"
• pycodestyleArgs: "<placeholder>"
• pycodestyleEnabled: false
• pycodestylePath: "<placeholder>"
• prospectorArgs: "<placeholder>"
• prospectorEnabled: false
• prospectorPath: "<placeholder>"
• pydocstyleArgs: "<placeholder>"
• pydocstyleEnabled: false
• pydocstylePath: "<placeholder>"
• pylamaArgs: "<placeholder>"
• pylamaEnabled: false
• pylamaPath: "<placeholder>"
• pylintArgs: "<placeholder>"
• pylintPath: "<placeholder>"

sortImports
• args: "<placeholder>"
• path: "<placeholder>"

formatting
• autopep8Args: "<placeholder>"
• autopep8Path: "<placeholder>"
• provider: "autopep8"
• blackArgs: "<placeholder>"
• blackPath: "<placeholder>"
• yapfArgs: "<placeholder>"
• yapfPath: "<placeholder>"

testing
• cwd: "<placeholder>"
• debugPort: 3000
• nosetestArgs: "<placeholder>"
• nosetestsEnabled: undefined
• nosetestPath: "<placeholder>"
• promptToConfigure: true
• pytestArgs: "<placeholder>"
• pytestEnabled: true
• pytestPath: "<placeholder>"
• unittestArgs: "<placeholder>"
• unittestEnabled: false
• autoTestDiscoverOnSaveEnabled: true

terminal
• activateEnvironment: true
• executeInFileDir: "<placeholder>"
• launchArgs: "<placeholder>"

experiments
• enabled: true
• optInto: []
• optOutFrom: []

insidersChannel: "daily"

tensorBoard
• logDirectory: "<placeholder>"

Extension version: 2022.0.1753204050-dev VS Code version: Code - Insiders 1.64.0-insider (3dda6ea7acb66ea8693032fe9631ccac629da770, 2022-01-27T05:15:00.564Z) OS version: Windows_NT x64 10.0.22000 Restricted Mode: No

System Info
Item Value
CPUs Intel® Core™ i7-1065G7 CPU @ 1.30GHz (8 x 1498)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.60GB (2.08GB free)
Process Argv –crash-reporter-id 664528d7-58ad-4032-9a86-c163f8ada97b
Screen Reader no
VM 0%
A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256197
pythonvspyl392:30422396
pythontb:30258533
pythonptprofiler:30281269
vsdfh931:30280409
vshan820:30294714
pythondataviewer:30285072
vscod805cf:30301675
pythonvspyt200:30323110
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
pythonvs932:30404738
wslgetstarted:30421357
vscop804cf:30404767
vs360:30404995
vsclayoutctrt:30405800
azactmsal:30409287
pythonvspyt640:30426300
vsbas813:30426126
vscscmwlcmt:30428973

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:16 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
karrtikrcommented, Feb 23, 2022

Alright I see it, will let you know if I need any more info.

0reactions
karrtikrcommented, Dec 19, 2022

I’m unable to reproduce the issue in the latest version of the extension and do not see any prompts, so closing this. Let me know if others still see it and we’ll be happy to reopen.

Read more comments on GitHub >

github_iconTop Results From Across the Web

sublime - save all open/loaded files that have names?
I'd like a command to save all, but not the untitled ones. There is a save all option in the menu, but it...
Read more >
Basic File Commands | Douglas Rumbaugh
All commands on a command line have a similar basic structure. They begin with the name of a command, followed by a space-separated...
Read more >
Save and revert changes | PyCharm Documentation - JetBrains
Press Ctrl+S or select File | Save All from the main menu. Trigger actions when saving changes. In PyCharm, you ...
Read more >
How to Recover Any Unsaved or Overwritten Microsoft Excel ...
There are a few ways you can recover unsaved Excel files. ... of your most recent changes, but it's a lot better than...
Read more >
How to troubleshoot errors when you save Excel workbooks
You must locate and remove the add-in or the file to eliminate the problem. After you determine which add-in or file caused the...
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