Skip to content

Launch Native REPL using terminal link - #24734

Merged
Anthony Kim (anthonykim1) merged 22 commits into
microsoft:mainfrom
anthonykim1:shellintegrationLink
Jan 23, 2025
Merged

Launch Native REPL using terminal link#24734
Anthony Kim (anthonykim1) merged 22 commits into
microsoft:mainfrom
anthonykim1:shellintegrationLink

Conversation

@anthonykim1

@anthonykim1 Anthony Kim (anthonykim1) commented Jan 22, 2025

Copy link
Copy Markdown

Resolves: #24270
Perhaps further improve via #24270 (comment) ?

@anthonykim1 Anthony Kim (anthonykim1) changed the title Launch native REPL when custom text from REPL in terminal is clicked. Provide option to launch native REPL when custom text from REPL in terminal is clicked. Jan 22, 2025
@anthonykim1
Anthony Kim (anthonykim1) marked this pull request as ready for review January 22, 2025 22:22
@vs-code-engineering

Copy link
Copy Markdown

⚠️ This PR originates from a fork. Due to security restrictions, pipelines from forks are no longer triggered automatically. Learn more.

If the changes appear safe, you can manually trigger the pipeline by commenting /AzurePipelines run.

@anthonykim1
Anthony Kim (anthonykim1) marked this pull request as draft January 22, 2025 22:52
Comment thread python_files/pythonrc.py
if sys.platform != "win32" and (not is_wsl) and use_shell_integration:
sys.ps1 = PS1()

if sys.platform == "darwin":

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is it weird if only part of this string is fixed to create a link with l10n? Will that translate only half the command?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Do you mean tooltip: l10n.t('Launch VS Code Native REPL'), part?
I think the the tooltip would only show Launch VS Code Native REPL

@vs-code-engineering

Copy link
Copy Markdown

⚠️ This PR originates from a fork. Due to security restrictions, pipelines from forks are no longer triggered automatically. Learn more.

If the changes appear safe, you can manually trigger the pipeline by commenting /AzurePipelines run.

Comment thread src/client/terminals/pythonStartupLinkProvider.ts Outdated
Comment thread src/client/terminals/pythonStartupLinkProvider.ts Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Missing test

Comment thread src/test/terminals/shellIntegration/pythonStartup.test.ts
@karthiknadig Karthik Nadig (karthiknadig) changed the title Provide option to launch native REPL when custom text from REPL in terminal is clicked. Launch native REPL using terminal link Jan 23, 2025
@karthiknadig Karthik Nadig (karthiknadig) changed the title Launch native REPL using terminal link Launch Native REPL using terminal link Jan 23, 2025
Comment on lines +164 to +165
assert.isNotNull(links, 'Expected links to be not undefined');
assert.isArray(links, 'Expected links to be an array');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You should check link.command here and validate start and end lengths. if you put the localized string in localize.ts then you can verify tooltip.

You also need a negative test case.

@anthonykim1

Copy link
Copy Markdown
Author

just realized this has been non-draft mode. Sorry for the spam everyone :)

@anthonykim1
Anthony Kim (anthonykim1) merged commit 25411e5 into microsoft:main Jan 23, 2025
@anthonykim1

Copy link
Copy Markdown
Author

I'm going to delete the outdated comments mentioned in the test file in separate PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-repl debt Code quality issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prompt for Native REPL when user types python in terminal

3 participants