kayler-renslow / arma-intellij-plugin

A plugin for Intellij IDEA that allows for syntactical analysis, code inspections, and other nifty features for the SQF scripting language in Arma 3.
MIT License
41 stars 10 forks source link

Plugin feature request for adding custom operators as valid ones #41

Closed Aebian closed 7 years ago

Aebian commented 7 years ago

Plugin Version

1.0.7

Summary

Possibility to add custom operators in config files

Detail

Hi, nice plugin I like it. The only thing I would like to see is the following:

Currently me and my group have a custom written loadout system with configs. In that particular we have an operator += that is allowed in our .cpp and therefore works. The plugin although marks this operator as an error as it does not know that it's legit there.

As an example:

We have a base class for e.g.

class Russia {
items[] = {"ACE_morphine",1,"ACE_epinephrine",2,"};
} 

Now I want another soldier to have more medicine. If I would type just an equal sign = I would override the base class. Instead I type += so the items are getting added and not replaced.

class SomeSoldier : Russia {
items[] += {"ACE_morphine",1,"ACE_epinephrine",2,"ACRE_PRC148",2}; // Soldier will have 2 Morphine and 4 Epinephrine
}

So I'm seeking for an option to define custom operators that are valid either plugin wide or for specific files / folders.

Thanks,

A/

kayler-renslow commented 7 years ago

I'm not going to be adding support for custom operators because it doesn't really make sense; if an operator is allowed in header files, the grammar should allow it and similarly, if an operator isn't allowed, the grammar should have an error. There is no custom operators in header files.

I added support for += for header files, but I tested the operator with non-arrays and it didn't appear to work. So, += will only work for header array assignments (arr[] += {0})

Fixed in commit 75026d8

Ragebone commented 7 years ago

There is actually a BIS article about this. https://community.bistudio.com/wiki/Array%2B%3D

kayler-renslow commented 7 years ago

fixed in releaes 1.0.8