WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Dev Tools (https://www.wowinterface.com/forums/forumdisplay.php?f=41)
-   -   Lua syntax highlights for Notepad++, UltraEdit, etc.. + WoW Ace2 Ace3 API recognition (https://www.wowinterface.com/forums/showthread.php?t=18172)

Mera 09-13-08 09:17 PM

Lua syntax highlights for Notepad++, UltraEdit, etc.. + WoW Ace2 Ace3 API recognition
 
Last thread update: 05 July 2010



This is a project for World of Warcraft AddOn authors providing the LUA/XML syntax highlighting script updated for the major text editors, the project now supports Notepad++, UltraEdit, PSPad and RjTextEd

Notepad++ uses a homemade plugin based on External lexers and GmodLua, and I completely rewrote the folding procedures so they performs better on Lua code

The API extractions are now done automatically through an addon so I will provide more frequent updates, there is no more missing API and no more deprecated functions.

By default the text editors use the same colors:
  • COMMENTS: green
  • NUMBERS: orange
  • LUA INSTRUCTIONS: bold blue
  • LUA CONSTANTS: red
  • WOW GLOBAL FUNCTIONS: blue
  • WOW UIOBJECTS FUNCTIONS: soft blue
  • ACE2 FUNCTIONS/CONSTANTS: soft purple
  • ACE3 FUNCTIONS/CONSTANTS: purple
http://luawow.googlecode.com

Tristanian 09-13-08 10:07 PM

Very helpful, my old UltraEdit lua.txt was old as hell. Nice job Mera :)

VincentSDSH 09-13-08 10:19 PM

Heh, I've been updating my UltraEdit wordfile a lot lately just getting ready for LK -- stunned at how much has been added since Capnbry's file ages ago.

Dridzt 09-14-08 01:40 AM

Very helpful, thank you.

I've been adding things to my own highlight file too but not a systematic effort.
This is a definite timesaver :)

Dridzt 09-14-08 04:38 AM

At a glance I noticed one thing present in my personal file that's missing.
Maybe you'd like to add it.

Near the top of the lua section after the /delimiters /function string lines
I have
Code:

/Open Fold Strings = "{" "function" "then" "else" "do" "until" "for" "while"
/Close Fold Strings = "}" "end" "else" "elseif"
/Open Comment Fold Strings = "<<"
/Close Comment Fold Strings = ">>"

This makes it so you can collapse blocks
(and comment blocks if you put '<<' and '>>' inside block section,
especially handy for big comment blocks containing license, documentation etc)


I also noticed in the keywords section there's 'UIParent'.
Any reason for it?

Another little detail, you could add
** -0 -1 -2 -3 -4 -5 -6 -7 -8 -9
as a substring to any of your Cx color code sections so that negative numbers are colored as well.
(I usually make an extra color code group just for that but I see you've used the 8 allowed)

Last little comment/question (sorry :p)
I see a
Code:

Block Comment On Alt = --
near the start.
Does that take care of the limitation in UEdit regarding block/line comments that start with the same substring?
To clarify, if you input the -- line comment, block comments break as UEdit
stops processing the after '--' and '[[' part is ignored hence doesn't understand
it's the beginning of a block comment instead treats it as a line comment.

If the alternate block comment definition solves that; neat trick!
If not I used to differentiate the 2 by making a
Code:

Line Comment = ---
3 '-' instead of 2, it's still a valid lua line comment and I combine it with a macro
that I run on my .lua files replacing occurrences of '--' with '---' on first pass and then '---[[' with '--[[' (to restore block comments).

Mera 09-14-08 05:36 AM

Thanks you all for the nice feedbacks I will of course update it to be even better with your help =)

Quote:

Originally Posted by Dridzt (Post 102120)
At a glance I noticed one thing present in my personal file that's missing.
Maybe you'd like to add it.

Near the top of the lua section after the /delimiters /function string lines
I have
Code:

/Open Fold Strings = "{" "function" "then" "else" "do" "until" "for" "while"
/Close Fold Strings = "}" "end" "else" "elseif"
/Open Comment Fold Strings = "<<"
/Close Comment Fold Strings = ">>"

This makes it so you can collapse blocks
(and comment blocks if you put '<<' and '>>' inside block section,
especially handy for big comment blocks containing license, documentation etc)


I also noticed in the keywords section there's 'UIParent'.
Any reason for it?

Another little detail, you could add
** -0 -1 -2 -3 -4 -5 -6 -7 -8 -9
as a substring to any of your Cx color code sections so that negative numbers are colored as well.
(I usually make an extra color code group just for that but I see you've used the 8 allowed)

Last little comment/question (sorry :p)
I see a
Code:

Block Comment On Alt = --
near the start.
Does that take care of the limitation in UEdit regarding block/line comments that start with the same substring?
To clarify, if you input the -- line comment, block comments break as UEdit
stops processing the after '--' and '[[' part is ignored hence doesn't understand
it's the beginning of a block comment instead treats it as a line comment.

If the alternate block comment definition solves that; neat trick!
If not I used to differentiate the 2 by making a
Code:

Line Comment = ---
3 '-' instead of 2, it's still a valid lua line comment and I combine it with a macro
that I run on my .lua files replacing occurrences of '--' with '---' on first pass and then '---[[' with '--[[' (to restore block comments).

awesome dude I will work on all that, the option to open/close function is very awesome and helpful however I found a bug yet do you see why I'm unable to close the first function in this small test code

PHP Code:

function test:u()
    for 
ij in ipairs(a) do
        
local test
    end
    
for ij in ipairs(a) do
        
local test
    end
end 

With your script I can open close the second for loop but never the first one. I'm looking to find a patch but if you have one feel free to share =) Thanks again for the kind comments all, took me all day yesterday to revamp it :)

//EDIT: I think I have found the glitch, with "for" and "do" on the same line it is looking for 2x "end" statements and then breaking the open/close function, should be patchable that, will look closely the help file to check for possible workarounds

Mera 09-14-08 06:23 AM

I think the patch for your code Dridzt is to not add "for" because for is always called with a "do", like having "if" already not present is fine because it's always coming with a "then" which is declared.

Dridzt 09-14-08 07:47 AM

Quote:

Originally Posted by Mera (Post 102122)
I think the patch for your code Dridzt is to not add "for" because for is always called with a "do", like having "if" already not present is fine because it's always coming with a "then" which is declared.

Yes that's an elegant solution, nice thinking.
For the same reason "while" must also be removed (it's always while () do)
"repeat" is also missing along the same lines ("until" is defined).
So that line should be
Code:

/Open Fold Strings = "{" "function" "then" "else" "do" "until"

Mera 09-14-08 09:17 AM

Quote:

Originally Posted by Dridzt (Post 102120)
I also noticed in the keywords section there's 'UIParent'.
Any reason for it?

Another little detail, you could add
** -0 -1 -2 -3 -4 -5 -6 -7 -8 -9
as a substring to any of your Cx color code sections so that negative numbers are colored as well.
(I usually make an extra color code group just for that but I see you've used the 8 allowed)

I have removed UIParent because I wsnt really sure if I need to highlight it, else I do not see what do you mean with numbers because I haven't defined rules for numbers because they are already handled by ultraedit and they are correctly highlighted with or without a - in front, not you ? maybe are you using an old uedit version me I have 14.10

Dridzt 09-14-08 09:54 AM

I have a 12.x.. that's probably it :)

Mera 09-14-08 10:08 AM

I think that's why it fail on you because the highlight feature has changed since this old version

Quote:

Originally Posted by Dridzt (Post 102120)
Last little comment/question (sorry :p)
I see a
Code:

Block Comment On Alt = --
near the start.
Does that take care of the limitation in UEdit regarding block/line comments that start with the same substring?
To clarify, if you input the -- line comment, block comments break as UEdit
stops processing the after '--' and '[[' part is ignored hence doesn't understand
it's the beginning of a block comment instead treats it as a line comment.

If the alternate block comment definition solves that; neat trick!
If not I used to differentiate the 2 by making a
Code:

Line Comment = ---
3 '-' instead of 2, it's still a valid lua line comment and I combine it with a macro
that I run on my .lua files replacing occurrences of '--' with '---' on first pass and then '---[[' with '--[[' (to restore block comments).

1)

not sure what you mean here but do you mean if I have a block like that for example

--[[
line1
line2
--line3
line4
line5
]]

you mean if the "--" will break the full block and the block will stops at line3 instead of line5 ? if that what you mean I have tested and "--" does not break the full block and what is commented is from line1 to line5

2) Else I have got the idea to add another section like /C8"WoW Default Frames" to highlight the calls of blizzard frames like UIParent, DessupFrame etc etc, dunno if thats a good idea , maybe too much , will add more apis anyway I have to browse blizz files now

Ackis 11-26-08 10:53 AM

Is there something like this for Notepad++? :)

Dridzt 01-08-10 10:32 AM

I've updated this for the current wow 3.3 API and new uestudio wordfile format (.uew) but don't know where to upload it :)
PHP Code:

AcceptProposal
AddOrRemoveFriend
AddPreviewTalentPoints
AddTrackedAchievement
BattlefieldMgrEntryInviteResponse
BattlefieldMgrExitRequest
BattlefieldMgrQueueInviteResponse
BattlefieldMgrQueueRequest
CalendarContextDeselectEvent
CalendarContextEventGetCalendarType
CalendarContextEventSignUp
CalendarContextGetEventIndex
CalendarContextInviteTentative
CalendarContextInviteType
CalendarContextSelectEvent
CalendarEventCanModerate
CalendarEventGetCalendarType
CalendarEventGetInviteResponseTime
CalendarEventSignUp
CalendarEventTentative
CalendarGetDayEventSequenceInfo
CalendarMassInviteArenaTeam
CalendarMassInviteGuild
CalendarNewGuildAnnouncement
CanAlterSkin
CanChangePlayerDifficulty
CanEjectPassengerFromSeat
CanHearthAndResurrectFromArea
CanMapChangeDifficulty
CanPartyLFGBackfill
CanQueueForWintergrasp
CanResetTutorials
CanSwitchVehicleSeat
CanUseEquipmentSets
CannotBeResurrected
CastSpellByID
ChangePlayerDifficulty
ClearAllLFGDungeons
ClearLFGDungeon
CollapseAllFactionHeaders
CompleteLFGRoleCheck
ConsoleAddMessage
ContainerRefundItemPurchase
DeleteEquipmentSet
DetectWowMouse
DungeonUsesTerrainMap
EjectPassengerFromSeat
EndBoundTradeable
EndRefund
EquipmentManagerClearIgnoredSlotsForSave
EquipmentManagerIgnoreSlotForSave
EquipmentManagerIsSlotIgnoredForSave
EquipmentManagerUnignoreSlotForSave
EquipmentSetContainsLockedItems
ExpandAllFactionHeaders
FillLocalizedClassList
FindSpellBookSlotByID
GMReportLag
GMResponseNeedMoreHelp
GMResponseResolve
GMSurveyAnswer
GMSurveyNumAnswers
GetActiveTalentGroup
GetArenaTeamGdfInfo
GetAutoCompleteResults
GetAvailableRoles
GetBattlegroundInfo
GetCVarAbsoluteMax
GetCVarAbsoluteMin
GetCVarMax
GetCVarMin
GetContainerFreeSlots
GetContainerItemGems
GetContainerItemID
GetContainerItemPurchaseInfo
GetContainerItemPurchaseItem
GetCurrentMapAreaID
GetDebugZoneMap
GetDungeonDifficulty
GetEquipmentSetInfo
GetEquipmentSetInfoByName
GetEquipmentSetItemIDs
GetEquipmentSetLocations
GetExpansionLevel
GetFactionInfoByID
GetGlyphLink
GetGroupPreviewTalentPointsSpent
GetInstanceInfo
GetInstanceLockTimeRemaining
GetInstanceLockTimeRemainingEncounter
GetInventoryItemGems
GetInventoryItemID
GetItemStatDelta
GetItemStats
GetItemUniqueness
GetLFDChoiceCollapseState
GetLFDChoiceEnabledState
GetLFDChoiceInfo
GetLFDChoiceLockedState
GetLFDChoiceOrder
GetLFDLockInfo
GetLFDLockPlayerCount
GetLFGBootProposal
GetLFGCompletionReward
GetLFGCompletionRewardItem
GetLFGDungeonInfo
GetLFGDungeonRewardInfo
GetLFGDungeonRewardLink
GetLFGDungeonRewards
GetLFGInfoLocal
GetLFGInfoServer
GetLFGProposal
GetLFGProposalEncounter
GetLFGProposalMember
GetLFGQueueStats
GetLFGQueuedList
GetLFGRandomDungeonInfo
GetLFGRoleUpdate
GetLFGRoleUpdateMember
GetLFGRoleUpdateSlot
GetLFGRoles
GetLFRChoiceOrder
GetLastQueueStatusIndex
GetMaxArenaCurrency
GetMultiCastBarOffset
GetMultiCastTotemSpells
GetNextCompleatedTutorial
GetNumArenaOpponents
GetNumBattlegroundTypes
GetNumEquipmentSets
GetNumQuestItemDrops
GetNumQuestLogRewardFactions
GetNumRandomDungeons
GetNumTalentGroups
GetNumTrackedAchievements
GetPartyLFGBackfillInfo
GetPetTalentTree
GetPlayerFacing
GetPlayerInfoByGUID
GetPrevCompleatedTutorial
GetPreviewTalentPointsSpent
GetPreviousArenaSeason
GetQuestLogCompletionText
GetQuestLogItemDrop
GetQuestLogRewardArenaPoints
GetQuestLogRewardFactionInfo
GetQuestLogRewardXP
GetQuestLogSpecialItemCooldown
GetQuestLogSpecialItemInfo
GetQuestPOILeaderBoard
GetQuestSortIndex
GetQuestWorldMapAreaID
GetQuestsCompleted
GetRaidDifficulty
GetRandomDungeonBestChoice
GetRewardArenaPoints
GetRewardXP
GetSocketItemBoundTradeable
GetSocketItemRefundable
GetTrackedAchievements
GetUnspentTalentPoints
GetVehicleUIIndicator
GetVehicleUIIndicatorSeat
GetWintergraspWaitTime
GetWorldPVPQueueStatus
HasCompletedAnyAchievement
HasDebugZoneMap
HasLFGRestrictions
HearthAndResurrectFromArea
InteractUnit
IsAtStableMaster
IsInLFGDungeon
IsLFGDungeonJoinable
IsListedInLFR
IsPartyLFG
IsPetAttackAction
IsPlayerResolutionAvailable
IsQuestLogSpecialItemInRange
IsSpellKnown
IsStereoVideoAvailable
IsTrackedAchievement
IsTutorialFlagged
IsXPUserDisabled
IsZoomOutAvailable
JoinLFG
LFGTeleport
LearnPreviewTalents
LeaveLFG
OpenCalendar
PartyLFGStartBackfill
PickupEquipmentSet
PickupEquipmentSetByName
PlayerCanTeleport
PlayerIsPVPInactive
ProcessQuestLogRewardFactions
QueryQuestsCompleted
QuestGetAutoAccept
QuestMapUpdateAllQuests
QuestPOIGetIconInfo
QuestPOIGetQuestIDByIndex
QuestPOIGetQuestIDByVisibleIndex
QuestPOIUpdateIcons
QuestPOIUpdateTexture
RefreshLFGList
RegisterStaticConstants
RejectProposal
RemoveTrackedAchievement
RenameEquipmentSet
RequestBattlegroundInstanceInfo
RequestLFDPartyLockInfo
RequestLFDPlayerLockInfo
ResetGroupPreviewTalentPoints
ResetPreviewTalentPoints
RespondInstanceLock
RespondMailLockSendItem
RestoreVideoEffectsDefaults
RestoreVideoResolutionDefaults
RestoreVideoStereoDefaults
ResurrectGetOfferer
SaveEquipmentSet
SearchLFGGetEncounterResults
SearchLFGGetJoinedID
SearchLFGGetNumResults
SearchLFGGetPartyResults
SearchLFGGetResults
SearchLFGJoin
SearchLFGLeave
SearchLFGSort
SetActiveTalentGroup
SetChatColorNameByClass
SetChatWindowUninteractable
SetLFGBootVote
SetLFGDungeon
SetLFGDungeonEnabled
SetLFGHeaderCollapsed
SetLFGRoles
SetMapByID
SetMultiCastSpell
SetPOIIconOverlapDistance
SetPOIIconOverlapPushDistance
SetRaidDifficulty
SetSavedInstanceExtend
TargetDirectionEnemy
TargetDirectionFinished
TargetDirectionFriend
TargetNearest
TargetTotem
TradeSkillOnlyShowSkillUps
TriggerTutorial
UnitGroupRolesAssigned
UnitIsControlling
UnitIsTappedByAllThreatList
UnitSelectionColor
UnitTargetsVehicleInRaidUI
UnitUsingVehicle
UseEquipmentSet
UseQuestLogSpecialItem 

are the API additions.

Mera 01-08-10 12:34 PM

Thank you Dridzt Yet I dont play wow but I hope soon

Quote:

Originally Posted by Ackis (Post 110613)
Is there something like this for Notepad++? :)

I will update it too later for Notepad++ as I use it now

Xruptor 02-06-10 08:30 AM

Quote:

Originally Posted by Mera (Post 173795)
Thank you Dridzt Yet I dont play wow but I hope soon



I will update it too later for Notepad++ as I use it now


Awesome! I would love to have all the updated API working with Notepad++! I use a primitive old list that is so out of date. This would be a god send :)

Cralor 02-06-10 01:49 PM

Notepad++ is really easy:

(Thanks to p3lim)

http://gist.github.com/280186

Should be enough. Hope this helps!

EDIT: I should have added that you just replace the Lua portion in your langs.xml with this. :)

Xruptor 02-06-10 04:47 PM

Quote:

Originally Posted by Cralor (Post 177595)
Notepad++ is really easy:

(Thanks to p3lim)

http://gist.github.com/280186

Should be enough. Hope this helps!


WOW thanks!

Mera 07-04-10 06:10 PM

The project has now moved to http://luawow.googlecode.com

The home page, helps and the zip are not yet finalized but you can download in advance syntaxes on the google subversion for Notepad++ UltraEdit PSPad and RjTextEd

Notepad + + plugin is based on External lexers and GmodLua and I reworked the code so that the folding of Lua code performs better, you can now fold more lua instructions with a behavior similar to text editors of the best known.

the list of API is divided into four groups in four groups now, 1) global functions 2) uiobject functions 3) ace2 constants 4) ace3 constants

By default the text editors use the same colors.

Any suggestion is welcome

Sythalin 07-13-10 10:03 AM

Fair warning. Using this with NP++ causes the client to slow down SIGNIFICANTLY. I'm not sure why.

Mera 07-13-10 11:08 AM

This is not from the plugin Chaos this issue but the library the plugin is based on, Garthex already replied to my request

Quote:

Originally Posted by Garthex
The solution to your problem is currently in the pipeline. It lies in the Scintilla component of Notepad++, and Neil Hodgson, the maker of Scintilla has already devised a solution. When he releases a new version of Scintilla, we'll still have to wait for Don Ho, the maker of Notepad++ to integrate it. At this point, all I can really do is wait.

If you want to read more up on it, you can do that here: http://sourceforge.net/tracker/?func...39&atid=102439

Garthex reply

I have caught this bug while adding 33000 entries into my file (function + variables)

But actually LuaWoW uses ~5000 API functions in WoW and you should not notice speed issues or maybe your computer is slow too, here on a Core i7 and 12Gb DDR3 it's fast and I don't notice the speed issues, the client respond as normal.

To summarize any actual syntax plugin is increasingly slow in the number of recognized functions, a workaround is to add the list to langs.xml but you will have less controls on your language and dirty folders.


All times are GMT -6. The time now is 10:43 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI