{
    "astyle.astylerc": "${workspaceRoot}/.astylerc",
    "astyle.additional_languages": [
        "gsc"
    ],
    "[gsc]": {
			"editor.defaultFormatter": "chiehyu.vscode-astyle",
		},
		"editor.quickSuggestions": {
			"other": true,
			"comments": true,
			"strings": true
		},
		"vscode-codscript.use_builtin_completionItems": false
}

// use below to verify no single line blocks with no braces
// /^\s*(if|while|for|switch|else) .*\s*[\r\n]+\s*[^\s{]/gm

// use below to verify array indexing spacing style
// $ egrep -ron "(\[\S|\S\])" --include \*.gsc ./ | egrep -v "\[\[" | egrep -v "\]\]" | egrep -v "\[\]"

// python script for casing fixes i did
/*
import sys
import re

builtins = """
assert
isdefined
println
getentitynumber
delete
spawnstruct
getdvar
setdvar
visionsetnaked
visionsetnight
int
setsunlight
gettime
assertex
isalive
assertmsg
issubstr
istouching
savegame~
getdebugdvar
getarraykeys
print3d
getentarray
spawn
getorigin
setmodel
distance
vectortoangles
anglestoforward
vectordot
getaiarray
distancesquared
bloodimpact
isai
issentient
randomint
radiusdamage
activateclientexploder
deactivateclientexploder
playloopsound
connectpaths
hide
notsolid
show
solid
disconnectpaths
getent
physicslaunch
rotatevelocity
movegravity
ambientplay
getnode
shellshock
iswaitingonsound
linkto
playsound
stopsounds
stoploopsound
playsoundasmaster
iprintlnbold
useanimtree
getaispeciesarray
line
anglestoright
anglestoup
clearenemy
setfriendlychain
strtok
getvehiclenode
soundexists
newhudelem
setclock
missionfailed
randomfloatrange
clearfixednodesafevolume
tolower
playrumbleonentity
setflashbanged
getthreatbiasgroup
getentnum
createthreatbiasgroup
setthreatbiasgroup
setthreatbias
bullettrace
playerphysicstrace
unlink
precachestring
vectornormalize
settext
destroy
setshader
threatbiasgroupexists
setignoremegroup
getcurrentweapon
getfractionmaxammo
givemaxammo
getspawnerarray
isplayer
dodamage
dospawn
getdvarfloat
getspeedmph
setgoalentity
getplayerangles
playerlinkto
rotateto
playerlinktodelta
gettagorigin
gettagangles
stalingradspawn
setblur
setgoalnode
setgoalpos
objective_state
setanimrestart
getdvarint
fadeovertime
getplayerviewheight
setsaveddvar
stopanimscripted
setlightintensity
playerads
geteye
earthquake
getvelocity
playfx
setsoundblend
getweaponslist
getweaponammoclip
iscoopepd
giveachievement
issplitscreen
detach
musicplay
setvolfog
setculldist
splitviewallowed
getplayers
freezecontrols
setdoublevision
visionsetnaked
clientsysregister
clientsyssetstate
clientsyssetstate
getsnapshotindexarray
snapshotacknowledged
oktospawn
getturretowner
useby
stopusingturret
setorigin
setplayerangles
setvolfog
enableinvulnerability
disableweapons
newclienthudelem
enableweapons
disableinvulnerability
setprintchannel
randomfloat
openfile
fprintln
closefile
spawnfx
triggerfx
playfxontag
moveovertime
scaleovertime
clearanim
setanim
setproneanimnodes
setanimknoball
getattachsize
getattachmodelname
weaponclass
localtoworldcoords
getshootatpos
canshoot
getdebugdvarint
angleclamp180
isstanceallowed
getweaponmodel
nearnode
floor
cos
sin
setflaggedanimknoballrestart
getanimlength
getdebugeye
orientmode
isingoal
useturret
setmode
shoot
randomintrange
stopshoot
bulletspread
issuppressed
cansee
sighttracepassed
abs
canattackenemynode
length
weaponisboltaction
weaponisgasweapon
weaponcliptype
enterprone
exitprone
isarray
getmovedelta
startragdoll
physicsexplosionsphere
setflaggedanimknoball
setanimknoblimited
setanimknob
getmotionangle
maymovetopoint
animhasnotetrack
setflaggedanimknob
setanimlimited
updateplayersightaccuracy
absangleclamp180
getanimtime
weaponclipsize
getclosestenemysqdist
setflaggedanimknobrestart
hidepart
updateprone
getthreatbias
max
physicstrace
checkgrenadethrowpos
checkgrenadethrow
min
getattachtagname
throwgrenade
print
attach
magicgrenademanual
findbestcovernode
usecovernode
findreacquiredirectpath
findreacquireproximatepath
reacquiremove
badplace_cylinder
badplace_delete
getcurrentweaponclipammo
getflashbangedstrength
setflaggedanimknoblimitedrestart
logstring
setburn
startfadingblur
setnormalhealth
iprintln
changefontscaleovertime
getkeybinding
getscoremultiplier
setclientdvars
newscorehudelem
ban
coopinfo
setvalue
setscoremultiplier
playlocalsound
closemenu
closeingamemenu
setdepthoffield
resettimeout
stopshellshock
stoprumble
spawn
getcurrentarcadehighscore
uploadscore
loadfx
setcollectible
hascollectible
tablelookup
sethintstring
usetriggerrequirelookat
takeallweapons
giveweapon
allowsprint
setmovespeedscale
setclientdvar
visionsetberserker
disableberserker
enableberserker
unsetcollectible
switchtoweapon
getweaponammostock
setweaponammoclip
setweaponammostock
getweaponslistprimaries
takeweapon
switchtooffhand
precacheitem
allowjump
visionsetlaststand
weapontype
isthrowinggrenade
setcursorhint
enablelinkto
depthinwater
disableweaponcycling
disableoffhandweapons
enableweaponcycling
enableoffhandweapons
bullettracepassed
usebuttonpressed
hasperk
startrevive
stoprevive
reviveplayer
setrank
precacheshader
getstat
setstat
tablelookupistring
setstatbit
getsubstr
iprintlnbold
setpulsefx
weaponissemiauto
weaponfiretime
getweaponclipmodel
precachemodel
createprintchannel
precacheheadicon
precacheshellshock
precacherumble
watersimenable
getnodearray
detachall
itemweaponsetammo
setexploderid
transmittargetname
isweapondetonationtimed
allowprone
allowcrouch
allowstand
getallnodes
buttonpressed
changelevel
newdebughudelem
eqoff
eqon
allowads
setspreadoverride
resetspreadoverride
setmapcenter
numremoteclients
getspawnerteamarray
settimescale
getnumconnectedplayers
getnumexpectedplayers
dropweapon
animmode
asin
geteyeapprox
lengthsquared
getanglestolikelyenemypath
showpart
teleport
trackscriptstate
setflaggedanimlimited
setanimknoballrestart
sqrt
reacquirestep
findreacquirenode
getreacquirenode
usereacquirenode
flagenemyunattackable
getstance
animcustom
getnorthyaw
stopsound
getnotetracktimes
vectorcross
isgodmode
viewkick
getpersistentprofilevar
setpersistentprofilevar
updategamerprofile
meleebuttonpressed
setcandamage
clearpitchorient
setstance
playerlinktoabsolute
allowlean
allowmelee
enablehealthshield
hideviewmodel
showviewmodel
acos
findpath
settargetentity
cleartargetentity
isfiringturret
shootturret
stopfiring
startfiring
isturretactive
canuseturret
getdifficulty
getturrettarget
restoredefaultdroppitch
stopuseturret
getstartorigin
setruntopos
animscripted
maketurretunusable
setdefaultdroppitch
maketurretusable
isturretfiring
pushplayer
setgoalvolume
makefakeai
getstartangles
setanimknobrestart
setflaggedanim
setanimtime
setflaggedanimrestart
getvehicleowner
allowedstances
magicgrenade
weaponfightdist
getangledelta
playrumbleonposition
canspawnturret
spawnturret
getnegotiationstartnode
startcoverarrival
atan
checkcoverexitposwithpath
maymovefrompointtopoint
issaverecentlyloaded
musicstop
setexpfog
setswitchnode
setwaitnode
setspeed
clearlookatent
sethoverparams
setneargoalnotifydist
setairresistance
cleartargetyaw
setgoalyaw
cleargoalyaw
settargetyaw
attachpath
setspeedimmediate
startpath
spawnvehicle
setvehicleteam
freevehicle
clearturrettarget
setvehgoalpos
getspeed
resumespeed
getallvehiclenodes
setshadowhint
setturretteam
precacheturret
playrumblelooponentity
badplace_arc
fireweapon
addvehicletocompass
removevehiclefromcompass
getattachpos
dontinterpolate
precachevehicle
setlookatent
setturrettargetent
setenginevolume
joltbody
isragdoll
setwaitspeed
setturretignoregoals
getturret
makevehicleunusable
isturretready
setvehiclelookattext
clearalltextafterhudelem
devaddpitch
devaddyaw
devaddroll
isstring
playloopedfx
precachemenu
playerpositionvalid
allowspectateteam
finishplayerdamage
openmenu
reportclientdisconnected
setactionslot
setviewmodel
getcurrentoffhand
damageconetrace
detonate
distance2d
rotateyaw
modelhasphyspreset
launchragdoll
beginprediction
endprediction
getpartname
createdynentandlaunch
starttanning
weaponmountable
playsoundatposition
isbeingwatched
pointonsegmentnearesttopoint
predictanim
predictoriginandangles
gethitenttype
gethityaw
isdeflected
lerpposition
getvisionsetnaked
savegamenocommit
commitsave
issavesuccessful
ismeleeing
isfiring
deactivatereverb
setreverb
forcelevelend
makedvarserverinfo
exitlevel
getreflectionlocs
getreflectionorigin
setdebugangles
setdebugorigin
weaponbayonetinfo
hasusedweapon
getnumrestarts
setuinextlevel
missionsuccess
setmissiondvar
attackbuttonpressed
rotateroll
getlightintensity
setcontents
radiusdamage
vibrate
disableaimassist
enableaimassist
setfixednodesafevolume
isknownenemyinradius
isknownenemyinvolume
setlightcolor
getlightcolor
vectorlerp
pickupgrenade
startscriptedanim
spawncollision
rotatepitch
setelectrified
movez
isnotarget
hasweapon
setvisibletoplayer
bbprint
setvisibletoall
setinvisibletoplayer
weaponmaxammo
getammocount
isswitchingweapons
setperk
unsetperk
forceteleport
iprintln
cleargoalvolume
settalktospecies
setailimit
disablegrenadesuicide
adsbuttonpressed
playersetgroundreferenceent
isonground
resetmissiledetonationtime
settransported
setengagementmindist
setengagementmaxdist
setspawnerteam
traversemode
getnegotiationendnode
getnormalhealth
animrelative
getaivelocity
finishactordamage
isdedicated
getfunction
replacefunc
disabledetouronce
cmdexec
getguid
logprint
printconsole
isweaponcliponly
botaction
botstop
botmovement
botmeleeparams
generatepath
getmins
getmaxs
setallowedtraversals
setignoredlinks
getnodenumber
getlinkednodes
addtestclient
notifyonplayercommand
ishost
closer
""".split()

if sys.argv[1] == '1': # checks for capitals in builtins
	for fn in sys.argv[2:]:
		whole_file = ''

		with open(fn, 'r') as file:
			whole_file = file.read()

			seen = {}
			file.seek(0)
			for line in file:
				toks = line.split()

				for tok in toks:
					matches = re.findall(r'\w+', tok)

					for match in matches:
						if any(char.isupper() for char in match) and match.lower() in builtins:
							print(match, match.lower())
							whole_file = whole_file.replace(match, match.lower())

		with open(fn, 'w') as file:
			file.write(whole_file)
elif sys.argv[1] == '2': # checks for capital letters for field names
	for fn in sys.argv[2:]:
		whole_file = ''

		with open(fn, 'r') as file:
			whole_file = file.read()
			file.seek(0)

			for line in file:
				toks = line.split()

				for tok in toks:
					matches = re.findall(r'(\S+(\.\w+)+)', tok)

					for match in matches:
						toks2 = match[0].split('.')
						left = toks2[0]

						if left.isnumeric():
							continue

						right = '.'.join(toks2[1:])

						if not any(char.isupper() for char in right):
							continue

						print(match[0], left + '.' + right.lower())
						whole_file = whole_file.replace(match[0], left + '.' + right.lower())

		with open(fn, 'w') as file:
			file.write(whole_file)

*/
