Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save file before starting debug session #525

Merged
merged 1 commit into from
Mar 22, 2021

Conversation

tgodzik
Copy link
Contributor

@tgodzik tgodzik commented Mar 21, 2021

Fixes #524

@tgodzik tgodzik requested review from gabro and ckipp01 March 21, 2021 17:28
@tgodzik
Copy link
Contributor Author

tgodzik commented Mar 21, 2021

@ckipp01 how is this handled in the vim DAP extension?

ServerCommands.DebugAdapterStart,
...parameters
return commands
.executeCommand("workbench.action.files.save")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should do this unconditionally, or prompt the user and offer to save.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it seems that vscode does it automatically anyways when the debug session is run, which means that even with prompting the user the end result will be the same.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 alright then

@ckipp01
Copy link
Member

ckipp01 commented Mar 22, 2021

@ckipp01 how is this handled in the vim DAP extension?

I actually haven't checked before this, but it seems that if you have unsaved changes in the buffer, it just runs with the last known state. However, that may be quite tricky to change there. Mainly because nvim-metals isn't in charge of the actual running at all, just the setup. It basically hands over a couple functions as configuration to nvim-dap and then the user triggers the entire thing via nvim-dap, not nvim-metals. So I'll need to actually poke around nvim-dap a bit to see if maybe that could be handled there.

@tgodzik
Copy link
Contributor Author

tgodzik commented Mar 22, 2021

@ckipp01 how is this handled in the vim DAP extension?

I actually haven't checked before this, but it seems that if you have unsaved changes in the buffer, it just runs with the last known state. However, that may be quite tricky to change there. Mainly because nvim-metals isn't in charge of the actual running at all, just the setup. It basically hands over a couple functions as configuration to nvim-dap and then the user triggers the entire thing via nvim-dap, not nvim-metals. So I'll need to actually poke around nvim-dap a bit to see if maybe that could be handled there.

I think this is perfectly fine. The main issue would be if it automatically saved the buffers like VS Code, but otherwise if it's totally in the users control then I then we shouldn't change anything.

@tgodzik tgodzik merged commit 6d2adc1 into scalameta:master Mar 22, 2021
@tgodzik tgodzik deleted the save-before-running branch March 22, 2021 09:19
kasiaMarek pushed a commit to kasiaMarek/metals-vscode that referenced this pull request Mar 29, 2023
…rn/prettier-2.8.1

chore(deps-dev): bump prettier from 2.8.0 to 2.8.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clicking 'run' on unsaved code saves code but runs old version
3 participants