This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Roadhouse699's profile picture

APIs appear colored in code

Started by Roadhouse699, 08 March 2013 - 10:58 AM
Roadhouse699 #1
Posted 08 March 2013 - 11:58 AM
I was thinking maybe if when one is coding, the computer could detect APIs and make them a certain color, just like it does with loops, variables, and stuff in quotes. I know that this doesn't really happen with lua or whatever but it would be nice to add in.
SuicidalSTDz #2
Posted 08 March 2013 - 12:09 PM
I don't think Dan200 or any of the other devs feel like looking through all the api's and documenting their "keywords". The keywords are defined and set as a color within the edit file using a table. So, good luck with that :P/>

EDIT: If you wish, you can add to the pre-existing table and make the words whatever color you want!
Dlcruz129 #3
Posted 08 March 2013 - 04:38 PM
I'm thinking about making an IDE. I'll link you if I ever get it done.
SuicidalSTDz #4
Posted 08 March 2013 - 04:41 PM
I'm thinking about making an IDE. I'll link you if I ever get it done.
It's a great idea, dont' get me wrong, the only problem being that there is an insane amount of APIs that would need to be documented thoroughly and updated frequently.
Pharap #5
Posted 08 March 2013 - 04:57 PM
That reminds me, IDE needs to go on my list of programs to make.

I'm thinking about making an IDE. I'll link you if I ever get it done.
It's a great idea, dont' get me wrong, the only problem being that there is an insane amount of APIs that would need to be documented thoroughly and updated frequently.
That's why you reference them before importing them.
In visual studio (known for being a damned awesome IDE) you have to reference a library before you can use it, after which all of it's features get registered into the syntax analyser, available for highlighting (assuming you remember to put the using line at the top of the page).
In theory you could cheat by running the API, then pulling apart it's components, noting their name and type (using pairs() ofc) then caching that data for use in the lexical analyser. If the file updates, force the IDE to recache it. Cheating but simpler than you think.
SuicidalSTDz #6
Posted 08 March 2013 - 05:02 PM
That reminds me, IDE needs to go on my list of programs to make.

I'm thinking about making an IDE. I'll link you if I ever get it done.
It's a great idea, dont' get me wrong, the only problem being that there is an insane amount of APIs that would need to be documented thoroughly and updated frequently.
That's why you reference them before importing them.
In visual studio (known for being a damned awesome IDE) you have to reference a library before you can use it, after which all of it's features get registered into the syntax analyser, available for highlighting (assuming you remember to put the using line at the top of the page).
In theory you could cheat by running the API, then pulling apart it's components, noting their name and type (using pairs() ofc) then caching that data for use in the lexical analyser. If the file updates, force the IDE to recache it. Cheating but simpler than you think.
My point still stands :P/> I don't think Dan or any devs have time to be doing this, nor do they really have a need to.
Dlcruz129 #7
Posted 08 March 2013 - 05:37 PM
My IDE will constantly scan code for user-created functions, and will scan files loaded with os.loadAPI(). If the user types an un-recognized function, it will display a warning which may be dismissed. I'm trying to make it extremely noob-friendly, if a noob types print(hi world), it will notify the user and have a quick-fix button to add "s. It's very large and ambitious, but I think I can handle it with enough time.
Pharap #8
Posted 09 March 2013 - 11:02 AM
That's why you reference them before importing them.
In visual studio (known for being a damned awesome IDE) you have to reference a library before you can use it, after which all of it's features get registered into the syntax analyser, available for highlighting (assuming you remember to put the using line at the top of the page).
In theory you could cheat by running the API, then pulling apart it's components, noting their name and type (using pairs() ofc) then caching that data for use in the lexical analyser. If the file updates, force the IDE to recache it. Cheating but simpler than you think.
My point still stands :P/> I don't think Dan or any devs have time to be doing this, nor do they really have a need to.

I wasn't intending them to. I was intending someone to hear the idea and try to incorporate it into their own IDE because they think it sounds cool lol
IDEs are fiddly but worth the effort if done right.


My IDE will constantly scan code for user-created functions, and will scan files loaded with os.loadAPI(). If the user types an un-recognized function, it will display a warning which may be dismissed. I'm trying to make it extremely noob-friendly, if a noob types print(hi world), it will notify the user and have a quick-fix button to add "s. It's very large and ambitious, but I think I can handle it with enough time.

Never say will when planning to make a program, 'will' usually jinxes things with the curse of procrastination or great difficulty lol
Not doubting you can't do it, just try avoiding saying 'will', use 'I intend to' or 'I hope to' it makes it easier to back down if need be lol