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

Adds missing filter flags for the outline filter. #206

Merged
merged 1 commit into from
Aug 15, 2020

Conversation

Neerti
Copy link
Contributor

@Neerti Neerti commented Aug 14, 2020

Fixes #205
Tried to fix the issue I found last night in the same way that #165 added other filter flags, but that PR seemed to have forgotten to add the two outline flags.

I tested this locally and the error doesn't come up now so it does work.

Hopefully I did everything right, let me know if there's any issues.

@ZeWaka
Copy link
Contributor

ZeWaka commented Aug 14, 2020

You'll need to add stuff here I think:

pub static VALID_FILTER_TYPES: phf::Map<&'static str, &[&str]> = phf_map! {
"alpha" => &[ "x", "y", "icon", "render_source", "flags" ],
"angular_blur" => &[ "x", "y", "size" ],
"color" => &[ "color", "space" ],
"displace" => &[ "x", "y", "size", "icon", "render_source" ],
"drop_shadow" => &[ "x", "y", "size", "offset", "color"],
"blur" => &[ "size" ],
"layer" => &[ "x", "y", "icon", "render_source", "flags", "color", "transform", "blend_mode" ],
"motion_blur" => &[ "x", "y" ],
"outline" => &[ "size", "color" ],
"radial_blur" => &[ "x", "y", "size" ],
"rays" => &[ "x", "y", "size", "color", "offset", "density", "threshold", "factor", "flags" ],
"ripple" => &[ "x", "y", "size", "repeat", "radius", "falloff", "flags" ],
"wave" => &[ "x", "y", "size", "offset", "flags" ],
};
// filter type => (flag field name, exclusive, can_be_0, valid flag values)
pub static VALID_FILTER_FLAGS: phf::Map<&'static str, (&str, bool, bool, &[&str])> = phf_map! {
"alpha" => ("flags", false, true, &[ "MASK_INVERSE", "MASK_SWAP" ]),
"color" => ("space", true, false, &[ "FILTER_COLOR_RGB", "FILTER_COLOR_HSV", "FILTER_COLOR_HSL", "FILTER_COLOR_HCY" ]),
"layer" => ("flags", true, true, &[ "FLAG_OVERLAY", "FLAG_UNDERLAY" ]),
"rays" => ("flags", false, true, &[ "FLAG_OVERLAY", "FLAG_UNDERLAY" ]),
"ripple" => ("flags", false, true, &[ "WAVE_BOUND" ]),
"wave" => ("flags", false, true, &[ "WAVE_SIDEWAYS", "WAVE_BOUND" ]),
};

@Neerti
Copy link
Contributor Author

Neerti commented Aug 15, 2020

When I look on the latest version on the master branch, that block of code appears to already have the outline stuff there.

"outline" => &[ "size", "color", "flags" ],

"outline" => ("flags", false, true, &[ "OUTLINE_SHARP", "OUTLINE_SQUARE" ]),

@SpaceManiac SpaceManiac merged commit 235ae71 into SpaceManiac:master Aug 15, 2020
@SpaceManiac SpaceManiac added this to the suite v1.6 milestone Sep 19, 2020
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.

DM-Langserver does not know about builtin Filter flags
3 participants