Skip to content

Conversation

Yusyuriv
Copy link
Member

This PR adds information on using JSON schemas for IDE validation and auto-complete in plugin.json and SettingsTemplate.yaml files.

@Yusyuriv Yusyuriv added the documentation Improvements or additions to documentation label Nov 21, 2024
@Yusyuriv Yusyuriv self-assigned this Nov 21, 2024
Copy link

coderabbitai bot commented Nov 21, 2024

📝 Walkthrough

Walkthrough

The pull request introduces updates to two documentation files: json-rpc-settings.md and plugin.json.md. A new section on JSON Schema is added to json-rpc-settings.md, providing instructions for enabling validation and auto-completion in IDEs, specifically for JetBrains IDEs. Similarly, plugin.json.md includes a new section detailing the addition of a $schema property to the plugin.json file, aimed at facilitating validation and auto-completion across various IDEs. The overall structure and existing content of both documents remain unchanged.

Changes

File Change Summary
json-rpc-settings.md Added a new section on JSON Schema with instructions for enabling validation in IDEs.
Included a comment line for SettingsTemplate.yaml: #$schema: https://www.flowlauncher.com/schemas/settings-template.schema.json.
plugin.json.md Introduced a new section detailing the $schema property for the plugin.json file for IDE validation.

Possibly related PRs

Suggested reviewers

  • jjw24
  • taooceros

🐰 In the meadow where ideas bloom,
A schema added to dispel the gloom.
With validation in sight,
IDEs shine bright,
Settings now dance with a new tune! 🌼


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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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

@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: 0

🧹 Outside diff range and nitpick comments (2)
json-rpc-settings.md (2)

186-191: Consider enhancing the JSON Schema section with additional context.

The section effectively explains how to enable JSON Schema support. Consider these enhancements to make it even more helpful:

  1. Add a brief introduction explaining the benefits of JSON Schema (e.g., "JSON Schema provides real-time validation, auto-completion, and documentation while editing your settings file").
  2. Make the # requirement more prominent, perhaps in a separate note or warning block.
 ### JSON Schema
+
+JSON Schema provides real-time validation, auto-completion, and documentation while editing your settings file, helping you avoid errors and discover available options.
+
 Add the following line at the beginning of your `SettingsTemplate.yaml` file to enable validation and auto-completion in your IDE. Unfortunately, this feature is supported only in JetBrains IDEs (WebStorm, PhpStorm, Rider, etc.) and does not work in Visual Studio or Visual Studio Code. Please note that it must start with `#` as it must be a comment, otherwise Flow Launcher won't be able to parse the file.

+> **Important:** The `$schema` line must start with `#` to be treated as a comment. Without the `#` prefix, Flow Launcher will fail to parse the file.
+
 ```yaml
 #$schema: https://www.flowlauncher.com/schemas/settings-template.schema.json

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 LanguageTool</summary>

[typographical] ~187-~187: The word “otherwise” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ... it must start with `#` as it must be a comment, otherwise Flow Launcher won't be able to parse th...

(THUS_SENTENCE)

</details>

</details>

---

`187-187`: **Improve sentence structure for clarity.**

The current sentence structure could be improved by properly separating the clauses.


```diff
-Please note that it must start with `#` as it must be a comment, otherwise Flow Launcher won't be able to parse the file.
+Please note that it must start with `#` to be treated as a comment. Otherwise, Flow Launcher won't be able to parse the file.
🧰 Tools
🪛 LanguageTool

[typographical] ~187-~187: The word “otherwise” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ... it must start with # as it must be a comment, otherwise Flow Launcher won't be able to parse th...

(THUS_SENTENCE)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 96c3257 and df8fdfe.

📒 Files selected for processing (2)
  • json-rpc-settings.md (1 hunks)
  • plugin.json.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
json-rpc-settings.md

[typographical] ~187-~187: The word “otherwise” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ... it must start with # as it must be a comment, otherwise Flow Launcher won't be able to parse th...

(THUS_SENTENCE)

🔇 Additional comments (3)
plugin.json.md (2)

21-32: Documentation looks good and provides clear guidance!

The new section effectively explains the purpose and usage of JSON schema, with good IDE coverage and a clear example.


26-26: Verify the schema URL accessibility

Let's ensure the schema URL is accessible and properly hosted.

✅ Verification successful

Schema URL is accessible and returns valid JSON Schema

The schema URL https://www.flowlauncher.com/schemas/plugin.schema.json is accessible, returns a valid JSON Schema document, and is properly hosted. The verification was successful, confirming that the schema reference in the plugin.json is correct and functional.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the schema URL is accessible and returns valid JSON Schema

# Test schema URL accessibility and validate JSON content
curl -s -f -L https://www.flowlauncher.com/schemas/plugin.schema.json | jq 'has("$schema")' || echo "Schema URL not accessible or invalid JSON Schema"

# Look for any references to schema hosting setup in the repository
rg -l "plugin.schema.json" --type md

Length of output: 150

json-rpc-settings.md (1)

190-190: Verify the JSON Schema URL is accessible and valid.

Let's ensure the schema URL is accessible and contains a valid JSON Schema.

✅ Verification successful

Schema URL is accessible and contains a valid JSON Schema

The schema URL is accessible and contains a valid JSON Schema:

  • Confirms presence of $schema property
  • Uses JSON Schema Draft-07
  • Has correct root type of "object"
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the JSON Schema URL is accessible and contains valid schema

# Check if the schema URL is accessible and contains valid JSON
curl -s https://www.flowlauncher.com/schemas/settings-template.schema.json | jq 'has("$schema")'

# Verify schema version and type
curl -s https://www.flowlauncher.com/schemas/settings-template.schema.json | jq '.["$schema"], .type'

Length of output: 258

Copy link
Member

@jjw24 jjw24 left a comment

Choose a reason for hiding this comment

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

👍

@jjw24 jjw24 merged commit 8cacb4f into main Nov 21, 2024
1 check passed
@jjw24 jjw24 deleted the add-json-schema-info branch November 21, 2024 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants