Skip to content

Update regex to get the version#293

Merged
mame merged 1 commit into
ruby:masterfrom
sinsoku:update-regex-to-get-typeprof-version
May 1, 2025
Merged

Update regex to get the version#293
mame merged 1 commit into
ruby:masterfrom
sinsoku:update-regex-to-get-typeprof-version

Conversation

@sinsoku
Copy link
Copy Markdown
Contributor

@sinsoku sinsoku commented May 1, 2025

If there is any output while loading .zshrc, TypeProf will not start because it cannot get the version.
In my use case, I was loading .iterm2_shell_integration.zsh in the .zshrc.

To avoid this problem, remove the ^ from the regular expression.
I think it is enough to check the end of the output with $.

スクリーンショット 2025-05-01 22 15 43

If there is any output while loading `.zshrc`, TypeProf will not start
because it cannot get the version.
In my use case, I was loading `.iterm2_shell_integration.zsh` in the
`.zshrc`.
refs: https://github.com/gnachman/iTerm2/blob/v3.5.13/Resources/shell_integration/iterm2_shell_integration.zsh

To avoid this problem, remove the `^` from the regular expression.
I think it is enough to check the end of the output with `$`.
@sinsoku sinsoku marked this pull request as ready for review May 1, 2025 13:28
@mame
Copy link
Copy Markdown
Member

mame commented May 1, 2025

Alright, I'll merge it!

@mame mame merged commit 76cb66f into ruby:master May 1, 2025
3 checks passed
@sinsoku sinsoku deleted the update-regex-to-get-typeprof-version branch May 1, 2025 14:13
Comment thread src/extension.ts
const str = output.trim();
log(`typeprof version: ${str}`);
const version = /^typeprof (\d+.\d+.\d+)$/.exec(str);
const version = /typeprof (\d+.\d+.\d+)$/m.exec(str);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oops, I included this /m flag by mistake.
It is unnecessary and will be removed.

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