-
Notifications
You must be signed in to change notification settings - Fork 16
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
fix: added missing keywords for highlighting #30
Conversation
Oh you beat me to it, I opened #31 before seeing this. You're still missing 'retries' |
Easier to review if you just change this one file: https://github.com/snakemake/snakemake-lang-vscode-plugin/pull/24/files |
No worries, I am sure I missed a few more too I couldn't find a good extensive list of all keywords and their support or deprecation by version. |
Oh damn, I might be wrong, PR #24 doesn't seem to fix syntax highlighting. Have to dig a bit deeper, but thanks for giving this a go. We should figure out how to test it, that'd be useful! |
OK I am not so familiar with VScode extension development, so I might have borked it up. But I made this into a local vsix and distributed it to my group and it worked for our highlighting purposes. |
|
added |
📝 WalkthroughWalkthroughThe pull request updates the package version in the Changes
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
🔭 Outside diff range comments (2)
src/keywords.yaml (2)
14-16
: 🛠️ Refactor suggestionDuplicate Entry in Configs
The
configs
section lists the keywordpepschema
twice. Removing the duplicate will help keep the configuration clean and unambiguous.
23-70
: 🛠️ Refactor suggestionDuplicate Keywords in Ruleparams
Within the
ruleparams
section, several keywords appear more than once (for example,container
,notebook
,default_target
,handover
,template_engine
, andlocalrule
). Duplicates in this list are unnecessary and may cause confusion for maintainers or downstream processing. It is recommended to deduplicate these entries to improve clarity and maintainability.Suggested diff snippet:
- - notebook ... - - default_target - - handover ... - - template_engine ... - - localrule(Remove the redundant occurrences.)
🧹 Nitpick comments (4)
languages/snakemake.json (1)
96-102
: Enhanced Regex Pattern for OnEnter RulesThe updated
beforeText
regex now incorporates additional keywords (e.g.,container
,shellcmd
,name
,norun
,conda_env
,container_img
,is_containerized
, etc.) needed for proper syntax highlighting. While the pattern is comprehensive, consider adding documentation or refactoring it into a more modular form if further keyword additions are anticipated.src/yaml/snakemake.language.yaml (1)
38-45
: Remove Duplicate Indentation ActionIn the
onEnterRules
block, theaction
object mistakenly includes twoindent: indent
entries. Removing the redundant entry will simplify the configuration without affecting behavior.Suggested diff:
- indent: indent - - indent: indent + indent: indent🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 42-42: syntax error: could not find expected ':'
(syntax)
syntaxes/snakemake.tmLanguage.json (2)
27-27
: Review Keyword Update for Configs SectionThe regex pattern now includes the keyword
module
as intended. Please verify that this addition does not conflict with any existing syntax rules or usage elsewhere in the highlighting definitions.
46-46
: Duplicate Keywords in Rule Parameters PatternThe regex pattern for rule parameters contains duplicate keywords (e.g.,
notebook
,template_engine
,default_target
, andhandover
appear twice). Removing these duplicates would simplify maintenance and improve readability. Consider revising the pattern as follows:- (benchmark|conda|container|shellcmd|name|norun|conda_env|container_img|is_containerized|env_modules|shadow_depth|docstring|notebook|template_engine|cache|path_modifier|handover|default_target|localrule|cwl|group|input|log|message|notebook|output|params|priority|resources|run|script|shadow|shell|singularity|threads|version|wildcard_constraints|wrapper|default_target|template_engine|handover) + (benchmark|conda|container|shellcmd|name|norun|conda_env|container_img|is_containerized|env_modules|shadow_depth|docstring|notebook|template_engine|cache|path_modifier|handover|default_target|localrule|cwl|group|input|log|message|output|params|priority|resources|run|script|shadow|shell|singularity|threads|version|wildcard_constraints|wrapper)This will ensure each keyword appears only once and reduce any potential confusion in the highlighting rules.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (21)
package.json
(1 hunks)src/js/keywords-regex.json
(1 hunks)src/keywords.yaml
(1 hunks)src/yaml/snakemake.language.yaml
(1 hunks)syntaxes/snakemake.tmLanguage.json
(2 hunks)languages/snakemake.json
(1 hunks)src/js/keywords-regex.json
(1 hunks)src/keywords.yaml
(2 hunks)src/yaml/snakemake.language.yaml
(1 hunks)syntaxes/snakemake.tmLanguage.json
(2 hunks)src/js/keywords-regex.json
(1 hunks)src/keywords.yaml
(1 hunks)syntaxes/snakemake.tmLanguage.json
(1 hunks)languages/snakemake.json
(1 hunks)src/yaml/snakemake.language.yaml
(1 hunks)syntaxes/snakemake.tmLanguage.json
(1 hunks)languages/snakemake.json
(1 hunks)src/js/keywords-regex.json
(1 hunks)src/keywords.yaml
(1 hunks)src/yaml/snakemake.language.yaml
(1 hunks)syntaxes/snakemake.tmLanguage.json
(1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
src/yaml/snakemake.language.yaml
[error] 42-42: syntax error: could not find expected ':'
(syntax)
🔇 Additional comments (1)
package.json (1)
6-6
: Version Bump UpdateThe version has been updated to
"0.4.1"
, which properly reflects the release that includes the new highlighting keywords.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this 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 comments (2)
src/keywords.yaml (2)
14-16
: 🛠️ Refactor suggestionRemove duplicate keyword "pepschema" in the configs section.
The list under
configs
contains"pepschema"
twice (lines 15 and 16). This duplication might be unintended and could lead to ambiguity in processing or maintenance overhead. Please remove one occurrence.- - pepfile - - pepschema - - pepschema + - pepfile + - pepschema
65-70
: 🛠️ Refactor suggestionEliminate duplicate entries in the ruleparams section.
The keywords listed after line 64 (including
localrule
,template_engine
,default_target
, and another set oflocalrule
andtemplate_engine
) appear to be duplicates of entries already present in this section. Duplicate entries can lead to unexpected behavior in highlighting and increase maintenance complexity. It is recommended to remove the repeated keywords.- - localrule - - template_engine - - default_target - - localrule - - template_engine
🧹 Nitpick comments (1)
src/keywords.yaml (1)
23-49
: Review existing duplicates in the ruleparams list.Beyond the newly added duplicates (lines 65–70), the list already contains potential duplicates such as
"container"
(at lines 26 and 48) and"handover"
(at lines 47 and later repeated at line 63). Although these may predate the current changes, it’s advisable to verify their necessity and remove any unintended repetition.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
CHANGELOG.md
is excluded by!CHANGELOG.md
package-lock.json
is excluded by!**/package-lock.json
📒 Files selected for processing (18)
package.json
(1 hunks)src/js/keywords-regex.json
(1 hunks)src/keywords.yaml
(1 hunks)syntaxes/snakemake.tmLanguage.json
(2 hunks)src/js/keywords-regex.json
(1 hunks)src/keywords.yaml
(2 hunks)syntaxes/snakemake.tmLanguage.json
(2 hunks)src/js/keywords-regex.json
(1 hunks)src/keywords.yaml
(1 hunks)syntaxes/snakemake.tmLanguage.json
(1 hunks)syntaxes/snakemake.tmLanguage.json
(1 hunks)src/js/keywords-regex.json
(1 hunks)src/keywords.yaml
(1 hunks)syntaxes/snakemake.tmLanguage.json
(1 hunks)package.json
(1 hunks)src/js/keywords-regex.json
(1 hunks)src/keywords.yaml
(1 hunks)syntaxes/snakemake.tmLanguage.json
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (17)
- package.json
- src/keywords.yaml
- syntaxes/snakemake.tmLanguage.json
- src/keywords.yaml
- syntaxes/snakemake.tmLanguage.json
- syntaxes/snakemake.tmLanguage.json
- src/keywords.yaml
- src/keywords.yaml
- syntaxes/snakemake.tmLanguage.json
- src/js/keywords-regex.json
- src/js/keywords-regex.json
- package.json
- syntaxes/snakemake.tmLanguage.json
- syntaxes/snakemake.tmLanguage.json
- src/js/keywords-regex.json
- src/js/keywords-regex.json
- src/js/keywords-regex.json
🔇 Additional comments (2)
src/keywords.yaml (2)
12-12
: Approve addition of “module” in the configs section.Adding the
module
keyword fills one of the missing parameters. This change looks good.
50-64
: Validate the new ruleparams keywords.New keywords such as
shellcmd
,name
,norun
,conda_env
,container_img
,is_containerized
,env_modules
,shadow_depth
,docstring
,notebook
,template_engine
,cache
,path_modifier
,handover
, anddefault_target
have been added. Please double-check that these keywords are in the intended order and that none of them conflict with existing definitions.
A lot of missing keywords for snakemake highlighting. Just added into 0.4.0 token lists.
Addresses some or all of issues #23, #18, #14, #22, #25
Summary by CodeRabbit
New Features
retries
parameter.pepfile
,pepschema
, andcontainer
to improve rule formatting and syntax highlighting.Chores