• LuaSense - Lua Intellisense
    160 replies, posted
  • Avatar of cpf
  • [IMG]http://content.screencast.com/users/cpfair/folders/Jing/media/c889a52a-309e-4237-98a8-31d20464d0e9/2010-02-28_1916.png[/IMG] [media]http://youtube.com/watch?v=AKy85-qdmYU[/media] Stuff that's done: [LIST] [*]Full support for all default gmod libraries & functions [*]Options (not pictured) to enable/disable various elements (esp. those images) [*]Click on the tooltip to go to the wiki [*]Works in most applications that don't do text entry weirdly (notepad++,notepad, the windows 7 start bar) [*]OK just look at the video [/LIST] Stuff that I'm working on: [LIST=1] [*]Text wrapping in the tooltip [*]More reliable [*]More graphics [*]Other stuff [/LIST] Stuff that I could do if this was integrated into an actual editor: [LIST] [*]Better performance & usability all around [*]Scanning your code (yes that's right, your code) for functions [/LIST] Stuff that will almost probably never happen so don't ask: [LIST] [*]Objects/Tables and their (metatable or otherwise) functions (avector:Function) [/LIST] Suggestions?
  • Avatar of Rambo_9
  • nice. my current notepadd++ setup is absolute garbage. The function list on the right hand side doesn't work and the autocomplete is a pain in the ass. I would gladly switch to this if you could get function listing working. it makes working on bigger files easier.
  • Avatar of alexgrist
  • Oh wow. Would love to have this in my Notepad++, would make my life so much easier.
  • Avatar of Gbps
  • :worship::worship::worship::worship: I cannot bare any more time before a release. [editline]08:55PM[/editline] Can I have your children, just saying. [editline]08:59PM[/editline] Rate OP a heart.
  • Avatar of Crazy Quebec
  • Hmm this looks pretty cool but how dependent is it on the lua function template of the wiki staying the same? Also could you do the following : - Autocomplete for ENT:, GM: and SWEP: hooks. It's a static prefix so it shouldn't be too hard. - If possible an auto-complete for certain functions such as hook.Add (Would list gamemode hooks). Oh and if you're feeling extremely fancy you could add support for pseudo "doc strings" in the form of comments exactly one line after the function's declaration. You could then display that in the tooltip for those functions.
  • Avatar of cpf
  • [QUOTE=Crazy Quebec;20486407]Hmm this looks pretty cool but how dependent is it on the lua function template of the wiki staying the same? Also could you do the following : - Autocomplete for ENT:, GM: and SWEP: hooks. It's a static prefix so it shouldn't be too hard. - If possible an auto-complete for certain functions such as hook.Add (Would list gamemode hooks). Oh and if you're feeling extremely fancy you could add support for pseudo "doc strings" in the form of comments exactly one line after the function's declaration. You could then display that in the tooltip for those functions.[/QUOTE] 1st I can do fairly easily, 2nd I think I'll rewrite the display logic (oh [U]joy[/U]) so it's less coupled with the current means of watching keystrokes and could work better in an editor. Oh and be less of a disaster.
  • Avatar of Whitewater
  • It looks like it will be fantastic, but I have a bit of a strange request... In most intellisense systems (That I have used), you have to type out your function, then hit enter, then continue. In this one, will it be possible to just barrel on past with a ( or something? Because hitting enter after every single function name would be annoying. Sometimes one can't recall a function name, sometimes one can't recall whether the number or string goes first. Anyway, looks like it'll be a great benefit.
  • Avatar of aVoN
  • [QUOTE=Rambo_9;20485913]nice. my current notepadd++ setup is absolute garbage. The function list on the right hand side doesn't work and the autocomplete is a pain in the ass. I would gladly switch to this if you could get function listing working. it makes working on bigger files easier.[/QUOTE] Working function-list for you: [url]http://www.facepunch.com/showpost.php?p=19988544&postcount=106[/url]
  • Avatar of gamer_lv
  • This looks awesome, Exactly what I could use. This will probable same me about 50 trips to wiki.garrysmod.com when coding ( I keep forgetting where to put capitals)
  • Avatar of yakahughes
  • [QUOTE=Metanoia;20492876]I've never used any sort of auto-complete for LUA stuff. This looks great.[/QUOTE] It's not LUA, it's lua. It's a word, not an acronym, people don't go around saying "Look at the beautiful MOON tonight." This looks extremely awesome and please finish it. Also, I read [quote] Objects/Tables and their (metatable or otherwise) functions (avector:Function) [/quote] I'm not sure, but does that mean the thing won't recognize functions that you have written in the code? For instance, if you write a function in a C++ project in MSVC, and then you do the name of your function later in the code, and hit (, it will show you the arguments for the function. Will this do that, or did the quote above mean that that won't happen?
  • Avatar of MakeR
  • [QUOTE=yakahughes;20493069]It's not LUA, it's lua. It's a word, not an acronym, people don't go around saying "Look at the beautiful MOON tonight.[/QUOTE] It's Lua, not lua. It is a noun.
  • Avatar of cpf
  • Clarification: lua is a pain to parse (compared to c/++/#) so I won't be writing anything to parse your file and determin that local variable "mxv" is a color. I might be able to parse user defined global tables (Evolve.doStuff() eg) but probably only if this was integrated into an editor (so I could scan all project files and read unsaved file contents). Until then it's only predefined libraries (default ones or ones you add yourself-there's an editor).
  • Avatar of lexic
  • Well as long as we can add our own without too much fuss then there's no real problem. How does this work at the moment then, if it's not attached to an editor? I mean, I'd like that in np++, but not for random popups to appear while writing a blog post or whatever.
  • So when will you be able to release this? :3: It would make learning lua MUCH easier
  • Avatar of cpf
  • [QUOTE=Lexic;20494549]Well as long as we can add our own without too much fuss then there's no real problem. How does this work at the moment then, if it's not attached to an editor? I mean, I'd like that in np++, but not for random popups to appear while writing a blog post or whatever.[/QUOTE] You can set which windows it's active in (by title).
  • Avatar of Kogitsune
  • What does your functions list look like? If it isn't too much trouble, it might be a good idea to do it via xml like the summary tags in Visual Studio. [code] <summary> <function library="concommand" name="Add" > <param name="command_name" datatype="string" desc="The unique name of the console command" /> <param name="callback_function" datatype="function" desc="The function called when the command is run" /> <param name="autocomplete_function" datatype="function:table:string" optional=1 /> <returns>nil</returns> <description>Creates a console command that runs the given function</description> <remarks>Warnings/tricks here if needed</remarks> </function> </summary> [/code] It's a mess because I'm just whipping together an example and could probably be ordered better. I feel something like the above would take some time to implement, but would allow you a more friendly experience, especially if you detect which argument you are currently entering and show the description text, which in theory should be as simple as counting commas not inside strings. Regardless of if you implement it or not, this looks really good so far =).
  • Avatar of cpf
  • This is what one looks like atm (beat you to the XML) [code]<Item ID="2482" Name="ents" AvailableOn="SHARED" IsLib="true"> <Children> <Function ID="2483" Name="Create" AvailableOn="SHARED" Parent="2482" Desc="This example spawns an angry zombie in front of the first player in the server (Usually you!)."> <Params> <Parameter Type="String" Name="entity class" /> </Params> <ReturnVal Type="Entity" Name="" /> </Function> <Function ID="2484" Name="FindByClass" AvailableOn="SHARED" Parent="2482" Desc="This example finds all of the npcs in the map"> <Params> <Parameter Type="String" Name="class name" /> </Params> <ReturnVal Type="Table" Name=": {{Arg|Entity}}" /> </Function> <Function ID="2485" Name="FindByModel" AvailableOn="SERVER" Parent="2482" Desc="This example finds all the entities with the huge chimney model"> <Params> <Parameter Type="String" Name="model name" /> </Params> <ReturnVal Type="Table" Name=": {{Arg|Entity}}" /> </Function> <Function ID="2486" Name="FindByName" AvailableOn="SERVER" Parent="2482" Desc="This example finds all the entities with the target-name &amp;quot;bill&amp;quot;"> <Params> <Parameter Type="String" Name="name" /> </Params> <ReturnVal Type="Table" Name=": {{Arg|Entity}}" /> </Function> <Function ID="2487" Name="FindInBox" AvailableOn="SHARED" Parent="2482" Desc="This example finds all the entities near the origin of the map"> <Params> <Parameter Type="Vector" Name="min" /> <Parameter Type="Vector" Name="max" /> </Params> <ReturnVal Type="Table" Name=": {{Arg|Entity}}" /> </Function> <Function ID="2488" Name="FindInCone" AvailableOn="SHARED" Parent="2482" Desc="Kills any NPCs in the SWEP's viewcone."> <Params> <Parameter Type="Vector" Name="Pos" /> <Parameter Type="Vector" Name="Dir" /> <Parameter Type="Float" Name="Distance" /> <Parameter Type="Float" Name="Radius" /> </Params> <ReturnVal Type="Table" Name=": {{Arg|Entity}}" /> </Function> <Function ID="2489" Name="FindInSphere" AvailableOn="SHARED" Parent="2482" Desc="This example finds all the entities whose distance from the origin is less than 32 from map coordinate 0,0,0."> <Params> <Parameter Type="Vector" Name="center" /> <Parameter Type="Number" Name="radius" /> </Params> <ReturnVal Type="Table" Name=": {{Arg|Entity}}" /> </Function> <Function ID="2490" Name="GetAll" AvailableOn="SHARED" Parent="2482" Desc="Prints the class of every entity in the map"> <Params /> <ReturnVal Type="Table" Name="of {{Arg|Entity}} objects." /> </Function> <Function ID="2491" Name="GetByIndex" AvailableOn="SHARED" Parent="2482" Desc="This example finds the 96th entity object"> <Params> <Parameter Type="Integer" Name="index" /> </Params> <ReturnVal Type="Entity" Name="" /> </Function> </Children> </Item>[/code]Yes, there is a completely legitimate reasons for the IDs on everything. The database itself is culled from the wiki (ofc). @Parameter descriptions and remarks: The wiki has none, but I am doing VS-style highligting of the current parameter.
  • Avatar of Metanoia
  • [QUOTE=yakahughes;20493069]It's not LUA, it's lua. It's a word, not an acronym, people don't go around saying "Look at the beautiful MOON tonight."[/QUOTE] A part of me wants to keep capitalizing it just to piss off pedants Another part of me wants to keep capitalizing it because this forum is called "LUA Scripting", so I see it capitalized every day and I'm used to it. And about 2% of me actually cares about spelling it properly
  • Avatar of Grea$eMonkey
  • [QUOTE=Metanoia;20503989]A part of me wants to keep capitalizing it just to piss off pedants Another part of me wants to keep capitalizing it because this forum is called "LUA Scripting", so I see it capitalized every day and I'm used to it. And about 2% of me actually cares about spelling it properly[/QUOTE] The ironic part is that Lua is a case-sensitive language.