Skip to content
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

suggest mermaid syntax highlighting #3389

Merged
merged 5 commits into from
Nov 13, 2024
Merged

Conversation

trajan0x
Copy link
Contributor

@trajan0x trajan0x commented Nov 13, 2024

Description

Add mermaid to cursor/vscode

Summary by CodeRabbit

  • New Features
    • Added support for JSONC format in configuration, allowing comments and lenient syntax.
    • Introduced two new recommended extensions for enhanced markdown support:
      • "bierner.markdown-mermaid"
      • "bpruitt-goddard.mermaid-markdown-syntax-highlighting"
    • Implemented a new linting step for JSONC syntax validation in the workflow.
  • Chores
    • Corrected formatting by ensuring a newline at the end of the file.

Copy link
Contributor

coderabbitai bot commented Nov 13, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

The changes involve modifications to the .vscode/extensions.json file, where comments are added to clarify that the file uses JSON with Comments (JSONC) format. This includes highlighting its features such as support for comments and trailing commas. Additionally, two new recommended extensions for the workspace are introduced, and the file formatting is corrected to ensure there is a newline at the end. The .gitattributes file is updated to specify that JSON files in the .vscode directory should be treated as JSONC. A new linting step for JSONC syntax checking is added to the GitHub Actions workflow.

Changes

File Change Summary
.vscode/extensions.json Added comments about JSONC format, added extensions "bierner.markdown-mermaid" and "bpruitt-goddard.mermaid-markdown-syntax-highlighting", and ensured a newline at the end of the file.
.gitattributes Added entry .vscode/*.json linguist-language=jsonc to specify JSON files as JSONC.
.github/workflows/lint.yml Added new step jsonc-syntax-check using stevieb9/[email protected] to validate JSON files in the .vscode directory.

Possibly related PRs

  • suggest mermaid syntax highlighting #3389: This PR is directly related as it also adds the extensions "bierner.markdown-mermaid" and "bpruitt-goddard.mermaid-markdown-syntax-highlighting" to the .vscode/extensions.json file, which is a key change in the main PR.

Suggested reviewers

  • ChiTimesChi

Poem

In the garden where ideas bloom,
New tools arrive to chase the gloom.
With mermaid magic, we shall create,
A world of wonder, oh, isn’t it great?
Hopping through code, with joy we sing,
Embrace the change that new extensions bring! 🐇✨

Warning

Rate limit exceeded

@trajan0x has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 0 minutes and 40 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 60ea876 and 4101bb1.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

cloudflare-workers-and-pages bot commented Nov 13, 2024

Deploying sanguine-fe with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4101bb1
Status:⚡️  Build in progress...

View logs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between fd8ad75 and 60ea876.

📒 Files selected for processing (1)
  • .vscode/extensions.json (1 hunks)
🧰 Additional context used
🪛 Biome
.vscode/extensions.json

[error] 18-18: Expected an array, an object, or a literal but instead found ']'.

Expected an array, an object, or a literal here.

(parse)


[error] 19-19: Expected a property but instead found '}'.

Expected a property here.

(parse)

🔇 Additional comments (2)
.vscode/extensions.json (2)

2-6: LGTM! Well-documented file format explanation.

The added comments clearly explain the JSONC format and its features, which is helpful for future maintainers.


16-17: LGTM! Appropriate extension choices for Mermaid support.

The combination of these extensions provides both rendering and syntax highlighting capabilities for Mermaid diagrams.

Let's verify the extensions' metadata:

✅ Verification successful

mermaid" -g "*.md"

Search for any Mermaid-related configuration or documentation

echo -e "\n=== Searching for Mermaid-related configuration or documentation ==="
rg -i "mermaid" -g "!.vscode/" -g ".{md,json,yaml,yml}"


---

mermaid' "$file" || rg -A 5 -B 1 'mermaid' "$file"
done

LGTM! The Mermaid extensions are essential for the codebase

The repository actively uses Mermaid diagrams in multiple README files for documentation:

  • services/omnirpc/modules/harmonyproxy/README.md: Contains a sequence diagram showing proxy flow
  • ethergo/submitter/README.md: Uses a graph diagram for nonce locking visualization
  • ethergo/listener/README.md: Includes a sequence diagram for listener architecture

The added VS Code extensions are necessary as they provide:

  1. Rendering support for these diagrams in VS Code's Markdown preview
  2. Syntax highlighting for better diagram authoring experience
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify VSCode extension metadata
# Check both extensions' latest versions, download counts, and ratings

gh api \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/repos/mjbvz/vscode-markdown-mermaid/releases/latest

gh api \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/repos/bpruitt-goddard/vscode-mermaid-syntax-highlight/releases/latest

Length of output: 653


Script:

#!/bin/bash
# Let's try a different approach by checking if there are any Mermaid-related files or documentation in the repository
# This will help verify if the extensions are being used appropriately

# Search for Mermaid diagrams in markdown files
echo "=== Searching for Mermaid diagrams in markdown files ==="
rg -l "

Length of output: 216


Script:

#!/bin/bash
# Let's try a simpler approach to search for Mermaid-related content

# Search for Mermaid diagrams in markdown files
echo "=== Searching for Mermaid diagrams in markdown files ==="
rg -l 'mermaid' -g '*.md'

# Search for Mermaid-related configuration
echo -e "\n=== Searching for Mermaid configuration ==="
rg -i 'mermaid' -g '!.vscode/extensions.json' -g '*.{json,yaml,yml}'

Length of output: 508


Script:

#!/bin/bash
# Let's check the content of one of the README files to verify Mermaid usage

echo "=== Checking Mermaid diagram content in README files ==="
for file in services/omnirpc/modules/harmonyproxy/README.md ethergo/submitter/README.md ethergo/listener/README.md contrib/promexporter/internal/gql/dfk/README.md contrib/git-changes-action/README.md; do
    echo -e "\n=== Content from $file ==="
    rg -A 5 -B 1 '

Length of output: 216


Script:

#!/bin/bash
# Let's examine one README file at a time

echo "=== Checking services/omnirpc/modules/harmonyproxy/README.md ==="
cat services/omnirpc/modules/harmonyproxy/README.md

echo -e "\n=== Checking ethergo/submitter/README.md ==="
cat ethergo/submitter/README.md

echo -e "\n=== Checking ethergo/listener/README.md ==="
cat ethergo/listener/README.md

Length of output: 9330

Comment on lines 17 to 19
],
} No newline at end of file
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix JSON formatting issues.

There are two formatting issues to address:

  1. Remove the trailing comma after the last array item
  2. Add a newline at the end of file

Apply this diff to fix the formatting:

      "dbaeumer.vscode-eslint",
      "editorconfig.editorconfig",
      "juanblanco.solidity",
      "golang.go",
      "bierner.markdown-mermaid",
-     "bpruitt-goddard.mermaid-markdown-syntax-highlighting",
+     "bpruitt-goddard.mermaid-markdown-syntax-highlighting"
    ],
-  }
+  }
+
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
],
}
\ No newline at end of file
}
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig",
"juanblanco.solidity",
"golang.go",
"bierner.markdown-mermaid",
"bpruitt-goddard.mermaid-markdown-syntax-highlighting"
],
}
🧰 Tools
🪛 Biome

[error] 18-18: Expected an array, an object, or a literal but instead found ']'.

Expected an array, an object, or a literal here.

(parse)


[error] 19-19: Expected a property but instead found '}'.

Expected a property here.

(parse)

@github-actions github-actions bot added the M-ci Module: CI label Nov 13, 2024
@trajan0x trajan0x merged commit 5ee4d85 into master Nov 13, 2024
26 of 27 checks passed
@trajan0x trajan0x deleted the feat/suggest-mermaid-highlight branch November 13, 2024 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant