parseDescription using regex by csalg · Pull Request #752 · LeetCode-OpenSource/vscode-leetcode · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

parseDescription using regex #752

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

csalg
Copy link

@csalg csalg commented Oct 26, 2021

There are several issues open regarding parseDescription breaking the whole extension, e.g. #749, #715

The problem seems to be that vscode-leetcode-cli sometimes prepends a few lines on top of the output, which breaks the parseDescription method.

This PR addresses this issue in two ways:

  1. It uses regex to parse the output instead of breaking the output into lines and hardcoding in which line each property should be. This solves tthe issue of the output having lines prepended.
  2. It assumes that the string can be empty or formatting might change and will not break under those circumstances, instead providing some defaults.

@csalg
Copy link
Author

csalg commented Oct 26, 2021

Additionally, I wrote two regression tests but I am not sure what to do with them. Is there a different repo with tests?

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.

1 participant

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.