JGantts / Storyteller

GNU General Public License v3.0
8 stars 3 forks source link

Add intellisense. #49

Open JGantts opened 4 years ago

bedalton commented 4 years ago

I do not know if it will help you, but I am working on a CAOS plugin for Creatures, and have entered all the commands, parameters, types and documentation into a database for C1, C2, CV, C3, and DS. It is how I generated my Lexers and Parsers for both a web editor and JetBrains IDE's. It is also how I generated my definitions for implementing intellisense.

It has names for some known value and I am adding more. This allows for placing an overlays in IntelliJ next to the event number so the SCRP command says scrp 2 6 8 9 (timer) or adding the drive name to a literal value, so it shows drv! eq 10 (fear), stuff like that. I am adding more of those.

Also, for the web editor, I packaged up the data into a JSON structure. The one on my site is not the most current. Luckily, I can just regenerate the definitions for both editors whenever I make a correction.

The other nice thing about having known values, is I use them for Intellisense in my IntelliJ plugin so that a person can type chem HUN| and it suggests HUNGER, and if they select it, and it will insert '3'. I have a number of those entered, but have not inserted them all. So far, over the 5 games, I have entered 134 of these lists, with 2,275 values. Some of these are simple descriptions for binary values such as 0 = asleep, 1 = awake. I have also flagged the values that are bit-flags like ATTR, so when someone setv's the value, it will display hint text to show something like setv attr 3 (carryable, mousable)

If you are interested, I can post the SQL or JSON as a gist for you to use, but I do not want to cramp your style. I just thought it might help prevent you from having to do it all yourself.

bedalton commented 4 years ago

I have not updated the incorrect commands in this editor yet, but I implemented a basic editor in Monaco, you can try it out https://www.caoschaos.com/editor/. It's not as feature rich as the IntelliJ one, but it uses the basic JSON files.

JGantts commented 4 years ago

Thank you so much for the offer. I actually already got something like that from the openc2e team. It’s under (I believe, I’m on my phone) caos-tool-2020/parser/commandinfo.json. I’d still be interested in looking at yours.

That being said, I think we could combine our efforts perhaps? I invite you to contact be on the Caos Coding Cave discord server (or creatures caves, or email) if you are interested.

I was thinking combine the web editor and the electron editor to have the same base code perhaps? I don’t want to cramp your style either.

JGantts commented 4 years ago

I still need to look into your editors tbh too. I’ve just been preoccupied lately