Closed adriangaro closed 4 months ago
The implemention of infer cwt config context (to get the common possible cwt configs) for expressions in inline script files will be optimized the next version.
The optimized logic is to infer all the possible root configs at inline script file level first, ahd then resolve all the possibe configs at the current position level.
The optimized infer logic is to get all the possible configs from all the inline script usages first, and then recursive merge all the possible configs.
Currently PLS use 'pointerEquals' logic, means must be same configs in cwt files. 'contentEquals' logic should be better but not best. 'recursiveMerge' logic should be perfect so far.
I found it's not very easy to 'merge cwt configs', for there are not only key - values, but also additional options and documents...
Since 1.1.0, cwt configs from same location in cwt files (or after inline, e.g. single_alias_right[trigger_clause]
), can be merged, when using Language Injection to provide inferred configs.
Further optimization could be applied in future versions.
As the title says, conflicting usage scopes disables auto completion inside inline scripts.
There are some usecases where an inline might be used in multiple scopes (ie. used in buildings and districts and deposits) which is almost similar scopes. Would it be possible to generate the common set of supported features and blocks in such cases instead of disabling fully?
For example,
triggered_planet_modifier
will work on both districts, buildings or deposits, while if an inline is used in all those 3 scopes,triggered_desc
should probably error since it is not supported on deposits.Or going the opposite and combing the scopes and allowed stuff, in case it would be easier and developer discretion should be used in such cases.