DragonKnightOfBreeze / Paradox-Language-Support

IDEA Plugin: Paradox Language Support.
https://windea.icu/Paradox-Language-Support
MIT License
36 stars 4 forks source link

Paramaters that are multi line trigger blocks do not type inference correctly. #72

Closed adriangaro closed 2 months ago

adriangaro commented 4 months ago

I have this utility inline which forces usually the plugin to do type inference where it can't easily infer from the code due to complex use or if the parameter is used in interpolation.

image As you could see the parameter should try to make $trigger$ into that specific (complex) (which is described in the cwt configs).

image However the type is lost due to having to put the parameter between quotes, as otherwise the trigger would bleed into the inline parameters invocation and cause errors at load time, so quotes are necessary.

I could think of two ways to handle this, one a shortcut which would fix in most cases, but not too versatile. It would be if something is simply just passed along with the quotes, to just copy the type of where it is passed as for inference purposed.

The second option would be to infer config/context from within the place where the parameter is interpolated/used.

For full context the snippet is bellow how $trigger$ is used in the inline, and where type inference of it fails normally.

image

DragonKnightOfBreeze commented 3 months ago

What about related cwt configs and inline script files?

DragonKnightOfBreeze commented 3 months ago

Config of parameter job_planet_trigger_block is inferred from extended cwt configs Config of parameter trigger is not inferred from extended cwt configs, and should be inferred from usages (based on paramerter job_planet_trigger_block)

Is above description right?

adriangaro commented 3 months ago

Yup that sounds about right, similar case should have been infered from the context where $trigger$ is used in jobs/tec_job inline trigger param. Mostly the config i added above was to try to force it to infer the config.

DragonKnightOfBreeze commented 2 months ago

image

DragonKnightOfBreeze commented 2 months ago

May need further testing