Skip to content

Conversation

@sfc-gh-kbregula
Copy link
Contributor

@sfc-gh-kbregula sfc-gh-kbregula commented Feb 1, 2023

📚 Context

Close: #5756

Please describe the project or issue background here

  • What kind of change does this PR introduce?

    • Bugfix
    • Feature
    • Refactoring
    • Other, please describe:

🧠 Description of Changes

  • Add bullet points summarizing your changes here

    • This is a breaking API change
    • This is a visible (user-facing) change

Revised:

Insert screenshot of your updated UI/code here

Current:

Insert screenshot of existing UI/code here

🧪 Testing Done

  • Screenshots included
  • Added/Updated unit tests
  • Added/Updated e2e tests

🌐 References

Does this depend on other work, documents, or tickets?

  • Issue: Closes #XXXX

Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@sfc-gh-kbregula sfc-gh-kbregula force-pushed the sfc-gh-kbregula-add-line-numbers-to-st-code branch 3 times, most recently from 35b7e46 to 8fc6738 Compare February 1, 2023 16:51
@snehankekre snehankekre added the security-assessment-completed Security assessment has been completed for PR label Feb 2, 2023
Copy link
Contributor

@snehankekre snehankekre left a comment

Choose a reason for hiding this comment

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

Approving the docstring change 👍

Copy link
Contributor

@sfc-gh-tszerszen sfc-gh-tszerszen left a comment

Choose a reason for hiding this comment

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

Overall LGTM, before merging first please fix extra characters if they are not needed and the tests 👍

@snehankekre
Copy link
Contributor

snehankekre commented Feb 2, 2023

@sfc-gh-tszerszen I've resolved the comments about extra characters and why they are needed. Not sure what's needed to make the tests pass. Eslint is complaining about the "unist" import in the code block frontend code . I thought merging the latest changes from develop might help, but that's not the case.

@sfc-gh-tszerszen
Copy link
Contributor

sfc-gh-tszerszen commented Feb 2, 2023

@sfc-gh-skekre thank you for clarification 👍 When it comes to missing import if it's missing dependency we need to add it. Otherwise if the dependency is present, but for some reason not visible, then maybe just ignore it? @sfc-gh-kbregula

@sfc-gh-kbregula
Copy link
Contributor Author

unist is our transient dependency, so we just need to add it to package.json.

Copy link
Contributor

@sfc-gh-mnowotka sfc-gh-mnowotka left a comment

Choose a reason for hiding this comment

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

I see a problem with this code. In two different places, on front-end and back-end it checks for the existence of an arbitrary string: showLineNumbers. This makes it hard to maintain. If for some reason that name will be changed in one of these two places, this feature will stop working.

Since we are already using protobuf, I'd like us to add showLineNumbers as a new optional field to Markdown.proto because IMO this is exactly why we are using protobufs.

@sfc-gh-kbregula sfc-gh-kbregula force-pushed the sfc-gh-kbregula-add-line-numbers-to-st-code branch from b31f8f5 to 911f998 Compare February 2, 2023 16:25
@sfc-gh-kbregula sfc-gh-kbregula force-pushed the sfc-gh-kbregula-add-line-numbers-to-st-code branch from 14a567f to 9fe3093 Compare February 9, 2023 11:08
Heading heading = 47;

// Next ID: 48
Code code = 49;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should be 48, because that's the next available ID. Doing a check I don't see 48 being used. (Feel free to adjust the comment to be more descriptive).

@sfc-gh-kbregula sfc-gh-kbregula force-pushed the sfc-gh-kbregula-add-line-numbers-to-st-code branch from 8f57e2b to 68c2437 Compare February 10, 2023 16:14
@sfc-gh-mnowotka sfc-gh-mnowotka requested a review from kmcgrady March 1, 2023 08:48
@sfc-gh-mnowotka sfc-gh-mnowotka merged commit 2d0993c into develop Mar 6, 2023
@vdonato vdonato deleted the sfc-gh-kbregula-add-line-numbers-to-st-code branch March 15, 2023 22:12
sfc-gh-lwilby added a commit that referenced this pull request Mar 7, 2025
## Describe your changes

In [this PR](#6042), we added
a new `def code` function in `code.py` which replaces the one in
`markdown.py`.

Since `CodeMixin` comes first in the definition of `DeltaGenerator`
before `MarkdownMixin`, the `CodeMixin` version of the function takes
precedence due to python's MRO algorithm and we can safely remove this
function.

## GitHub Issue Link (if applicable)

## Testing Plan

Covered by existing tests. 

---

**Contribution License Agreement**

By submitting this pull request you agree that all contributions to this
project are made under the Apache 2.0 license.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security-assessment-completed Security assessment has been completed for PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optionally add line numbers to st.code output

8 participants