Skip to content

VSCode clickable URL to attach debugger#133

Merged
n-gao merged 6 commits intoTUM-DAML:masterfrom
Grutschus:master
Mar 20, 2024
Merged

VSCode clickable URL to attach debugger#133
n-gao merged 6 commits intoTUM-DAML:masterfrom
Grutschus:master

Conversation

@Grutschus
Copy link
Contributor

Added a log message containing a clickable URL to automatically attach a debugger in VSCode. No need to create a launch config every time.

Reference issue

No issue.

What does this implement/fix?

If running seml [collection] start --debug-server, previously, the IP and port have just been printed to the console.
To attach the debugger in VSCode one had to create a launch configuration every time.

Using the VSCode extension Debug Launcher one can create clickable URLs for launch configs.
This PR adds a generator for such a URL and prints it to the console.

debug_url_seml

Additional information

I had to hack the logger in order to prevent line breaks due to the limited console width.
This is very unpretty.
If there is a better way, let me know.

  • I updated the docs via typer-cli with _SEML_COMPLETE=1 typer seml.__main__ utils docs --name seml --output docs.md or did not change the CLI.

@Grutschus Grutschus requested a review from n-gao March 8, 2024 17:45
@n-gao
Copy link
Collaborator

n-gao commented Mar 11, 2024

@Grutschus The debug launcher has been scrapped from vscode marketplace? at least the link is dead (same for google link)?

@Grutschus
Copy link
Contributor Author

It seems that the extension has been scrapped yesterday(!) 🙄
Closing this PR.

image

@Grutschus Grutschus closed this Mar 11, 2024
@n-gao
Copy link
Collaborator

n-gao commented Mar 18, 2024

@Grutschus it looks like the extension is back online. Though the project is still archived. Not sure whether we want to rely on archived code? But I also don't see a big issue where. What do you think?

@Grutschus
Copy link
Contributor Author

@n-gao I think the worst that can happen here is a dead URL in the console that we can remove, should the extension become truly outdated.
Let me integrate your latest feedback  👍

@Grutschus Grutschus reopened this Mar 19, 2024
@Grutschus
Copy link
Contributor Author

The console output now looks something like this:

image

@n-gao
Copy link
Collaborator

n-gao commented Mar 19, 2024

Thanks a lot! :) Just tested it, and it works great! But could you please rebase to the current master and do the following changes:

  • Use the with pause_live_widget(): context around start_srun_job from seml.console
  • Add with pause_live_widget(): before the Progress in start_local_worker from seml.console
  • Import at the top of functions

@n-gao n-gao merged commit 5f0674c into TUM-DAML:master Mar 20, 2024
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.

2 participants