Monaco TM1 Editor with Intellisense

Post Reply
bgregs
Posts: 75
Joined: Wed Sep 12, 2018 11:19 am
OLAP Product: TM1 / Planning Analytics
Version: 2.0
Excel Version: 2016

Monaco TM1 Editor with Intellisense

Post by bgregs » Fri Dec 18, 2020 7:00 pm

UPDATE
*****************************************************************************************************************************************
This project will remain in its current state, but is being replaced by the TM1Code - VS Code extension project:
viewtopic.php?f=3&t=15758
I just don't have the time to develop both in parallel.
*****************************************************************************************************************************************
Hi Everyone,

After my last Notepad++ plugin project I was left wanting something with more robust syntax highlighting out of the box. I personally can't stand developing in a web browser (although that is the current trend), but connecting to the rest api with standard desktop languages (C/C++) proved more trouble than it was really worth. This led me down the path of building out a tool that I could actually use myself.

My design goals were relatively straightforward:

- Simple, clean interface
- As few dependencies as possible
- Webapp with a desktop feel
- Easy to extend functionality
- Intellisense and syntax highlighting
- FREE: It's almost 2021, we shouldn't have to pay for licenses for simple tools

Through a little research, I finally settled on the Electron framework to provide a desktop feel to my webapp. It was extremely straightforward, and I'm honestly quite surprised there isn't a bigger push to develop apps using frameworks like it (at least in our tiny space of the IT world). Electron also allows me to easily integrate this with ElectronForge for easy installer creation - I have used this to deploy to my dev box and it's pretty slick. For intellisense I used Monaco, which is what powers Microsoft's Visual Studio Code editor. All that was left was to create the syntax and intellisense files and string everything together. All-in-all this was about a 1.5 week build, so it lacks quite a few features, but should hopefully demonstrate the potential and possibly pique some other developers' interests :).

Things it does:

- Intellisense:
intellisense.png
intellisense.png (23.15 KiB) Viewed 852 times
- Direct documentation reference:
documentation.png
documentation.png (18.22 KiB) Viewed 852 times
- AutoComplete with tab based parameter entry:
autocomplete.png
autocomplete.png (7.86 KiB) Viewed 852 times
- Template Macros (these perform actions like "create skipcheck and feeders template")
- Full syntax highlighting and code browsing on the right hand side
* I ran out of image space so I could only upload 3 screenshots

Things it doesn't do:

- No CAM support yet, although this is extremely easy to implement
- No TI support yet
- Not much in the way of error handling currently

How to use it:
* You will need npm installed
- Clone the project from the github site: https://github.com/bgregs514/tm1_ide
- Open a powershell prompt in the root of the folder
- Run the command "npm start" (without double quotes)
- The config file will be created in /Users/[User]/AppData/Roaming/ElectronTest/configuration.json - edit this

This project has been a lot more fun than I initially thought it would be. I have been using this tool for day-to-day rule edits for a few weeks now, and it's worked out surprisingly well. It's definitely rough and has some half baked features in it (like the alternate hierarchy viewer), but it performs rule saves without any issues once it is configured.

While it has been fun, I must admit that the technology itself just isn't that exciting to me personally, and I have largely lost interest in providing updates to this one. If anyone does plan on extending this for their own use, go right ahead, just don't forget to leave a shout-out for me somewhere in the source code :). As always, if there is interest in this project, I would be happy to add features and support - I just don't see myself adding anything new if it's only me using it.

Thanks again for reading, and enjoy!
Last edited by bgregs on Tue Feb 23, 2021 2:42 am, edited 1 time in total.

Bakkone
Posts: 119
Joined: Mon Oct 27, 2014 10:50 am
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2013

Re: Monaco TM1 Editor with Intellisense

Post by Bakkone » Mon Jan 11, 2021 7:19 pm

Hi,

Just wanted to write to say I appreciate your work. Will use it a bit and come back with feedback.

Edward Stuart
Community Contributor
Posts: 240
Joined: Tue Nov 01, 2011 10:31 am
OLAP Product: TM1
Version: All
Excel Version: All
Location: Manchester
Contact:

Re: Monaco TM1 Editor with Intellisense

Post by Edward Stuart » Tue Jan 12, 2021 9:26 am

I'll second that, I've been tinkering with Javascript/ React interaction with the REST Api where time allows and whilst I think there is demand and space for an application like this (and I will also look to contribute). Workspace is a surprisingly comfortable place to develop once you start using it regularly

bgregs
Posts: 75
Joined: Wed Sep 12, 2018 11:19 am
OLAP Product: TM1 / Planning Analytics
Version: 2.0
Excel Version: 2016

Re: Monaco TM1 Editor with Intellisense

Post by bgregs » Mon Feb 01, 2021 7:59 pm

@Edward @Bakkone

Thank you both for your kind words and for taking the time to look through the project! I apologize for the long delay - I need to make a habit of checking the forums more often.

I'm finally wrapping up some completely unrelated projects that consumed a lot more of my time than I originally expected (pcb design and cramming keyboard firmware on a microcontroller with 32k of memory ;) ), but now that I'm back I should be able to get some updates rolling out on this again. For those that are interested, here's what I'm planning to target for the next batch of updates:

- Additional polish; this includes proper error handling for existing calls, as well as integration into electron forge for a better installation experience
* A bit of an aside, but last I tested, forge had a strange bug where the installer would exclude one of the .dlls needed to get the whole thing rendered properly; I'm not sure if that's fixed in subsequent releases, but I'll need to follow up on that
- Complete first pass at alternate hierarchy browser
- Begin work on TI integration

An additional fun-fact for those that use VS Code - the js/langRule.js and js/compRule.js files can be added to VS Code to provide the syntax highlighting and intellisense functionality. The rest of this project is just additional fluff to actually allow for live saving/editing of the code files, but if your workflow is just copying and pasting text into VS Code, those files may be able to save you a lot of time.

I'll continue to update here as I roll changes out. At this point, I'm not entirely sure when they will start be released, but they will be here eventually.

bgregs
Posts: 75
Joined: Wed Sep 12, 2018 11:19 am
OLAP Product: TM1 / Planning Analytics
Version: 2.0
Excel Version: 2016

Re: Monaco TM1 Editor with Intellisense

Post by bgregs » Wed Feb 10, 2021 3:43 pm

Rolling Update Post (so I don't continue to necro this old thread):

2/10/21 - A bit more polish, a few quality of life tweaks, and the groundwork for a more robust notification system:
  • CAM authentication now supported (see config file for new parameters)
  • README updated to provided installation and use commands, as well as project goals and features
  • New font
  • New icon (to display cubes with rules)
  • Cleaned up some nasty code and consolidated functions
  • Pre-cache rules on load so rule access is now instantaneous and won't kick off a separate network call
  • Desktop notification integration using Electron's Notification system (should be platform agnostic)
  • Title Bar to display cube name and status of the rule; currently status will just display if this is a new rule or not
  • Loading animation for network calls
  • Proper error handling and error throwing

Bakkone
Posts: 119
Joined: Mon Oct 27, 2014 10:50 am
OLAP Product: TM1
Version: 10.2.2
Excel Version: 2013

Re: Monaco TM1 Editor with Intellisense

Post by Bakkone » Sat Feb 13, 2021 12:08 pm

Ill add on to my earlier praise then and thank you for your contributions to the MK community. I personally just lurk around r/MK and similar. Still havent pulled the trigger on my first split... but Im thinking 2021 is the year it will happen. Just don't know how I will manage all the soldering. Or just the mad prices... those GMK sets are not cheap.

bgregs
Posts: 75
Joined: Wed Sep 12, 2018 11:19 am
OLAP Product: TM1 / Planning Analytics
Version: 2.0
Excel Version: 2016

Re: Monaco TM1 Editor with Intellisense

Post by bgregs » Thu Feb 18, 2021 4:15 pm

Thanks Bakkone! Not to turn this thread into an extension of GeekHack or Deskthority, but the MK world is a wonderful and painful place all at the same time. On one hand, there's a never ending supply of stuff to learn and things to try, but your wallet always takes a hit. ;) I've unfortunately fallen into both mechanical and trackball mouse worlds, which seems to consume most of time. If you do plan on getting into custom builds, I highly recommend eating the cost of a good soldering iron (Hakko fx-888d for example). It'll pay off dividends in the long run.

I actually am working on developing a more budget friendly "starter kit" for custom builds. I have a friend currently cranking out prototype cases and mounting plates, and we hope to get a pcb prototyped shortly. Nothing official yet, but the plan is to have a full kit under $200 (compared to the $300+ kits) for people that want something to practice on, or just don't need all of the flashy RGBs and stuff.

Anyway, thanks again for your feedback! Stay tuned for updates on TM1 Editor, a slight shift in design will be taking place shortly and I plan on having an announcement out later this week - as soon as we can get over this crazy Texas weather!

scrumthing
Posts: 67
Joined: Tue Jan 26, 2016 4:18 pm
OLAP Product: TM1
Version: 2.0.9
Excel Version: too many

Re: Monaco TM1 Editor with Intellisense

Post by scrumthing » Fri Feb 19, 2021 8:58 am

bgregs wrote:
Thu Feb 18, 2021 4:15 pm
Stay tuned for updates on TM1 Editor, a slight shift in design will be taking place shortly and I plan on having an announcement out later this week - as soon as we can get over this crazy Texas weather!
Looking forward to that. Can't wait to see what will happen. ;-) Awesome project!
There is no OLAP database besides TM1!

bgregs
Posts: 75
Joined: Wed Sep 12, 2018 11:19 am
OLAP Product: TM1 / Planning Analytics
Version: 2.0
Excel Version: 2016

Re: Monaco TM1 Editor with Intellisense

Post by bgregs » Fri Feb 19, 2021 3:42 pm

Updates

First off, thank you all for your support. I honestly never expected this to garner much interest, but I'm thrilled to have people looking at it - really, I appreciate all of your feedback! Now let's get into the updates.

It was recently brought to my attention that there is a desire to port this type of functionality (intellisense, possibly a linter, etc.) into Visual Studio Code as a native extension (thank you Christoph for reaching out! :D ). I really like this approach for its many tangible benefits in terms of ease of rollout, fewer dependencies, etc., as well as my own selfish reasons (I don't have to worry about the GUI...seriously, CSS/HTML and the battle over pixel placement always makes my head hurt). The only downsides that I can see is that we are somewhat confined to what VS Code offers in terms of a GUI (not really a huge negative, and an exposed API makes integration much easier), and that the core logic will need to be rewritten in TypeScript. JavaScript is offered as an option, but given that VS Code is written in TS to begin with, I'd like to keep things as vanilla as possible. TypeScript is a new world for me, so I expect there will be a slight ramp up time to get something worth sharing created.

So what does this mean in terms of the future? Well, that's entirely up to everyone here. I enjoy working on these things as long as there is interest, so if there are ideas or design decisions that you think would add to the overall project, please share them! This does not necessarily mean the end of the existing TM1 IDE, but more of a shift of focus to add existing functionality to an already stable editor (why reinvent the wheel?). Given the technology change, I will be creating a new git repo that I will share as soon as I have something stable.

What do you think? Keep going down the original path of a standalone editor, or continue to pursue VS Code integration? Let me know what you would like to see!

scrumthing
Posts: 67
Joined: Tue Jan 26, 2016 4:18 pm
OLAP Product: TM1
Version: 2.0.9
Excel Version: too many

Re: Monaco TM1 Editor with Intellisense

Post by scrumthing » Fri Feb 19, 2021 7:51 pm

VS Code!!! Definitely!
There is no OLAP database besides TM1!

Emixam
Posts: 102
Joined: Tue May 21, 2019 3:33 pm
OLAP Product: TM1
Version: PA 2.0.x
Excel Version: 2016
Location: The Internet

Re: Monaco TM1 Editor with Intellisense

Post by Emixam » Sat Feb 20, 2021 3:58 am

I will for sure give it a try if I can easily download the extension directly in VS Code.

CarpeDatum did something similar:
https://marketplace.visualstudio.com/it ... tm1-helper

Have a good day !
Sorry for my English :)

User avatar
ykud
MVP
Posts: 130
Joined: Sat Jan 10, 2009 10:52 am
Contact:

Re: Monaco TM1 Editor with Intellisense

Post by ykud » Sat Feb 20, 2021 10:55 am

Vscode would be amazing, it adds a lot of really good extensions and is a very well thought through IDE, so it’s confines are more like a benefit from my point of view.
CarpeDatums plug-in was only doing syntax highlighting, live editing with rest api would be a game changer. I’d be happy to contribute, but will need to learn typescript )

scrumthing
Posts: 67
Joined: Tue Jan 26, 2016 4:18 pm
OLAP Product: TM1
Version: 2.0.9
Excel Version: too many

Re: Monaco TM1 Editor with Intellisense

Post by scrumthing » Sat Feb 20, 2021 10:01 pm

ykud wrote:
Sat Feb 20, 2021 10:55 am
live editing with rest api would be a game changer. I’d be happy to contribute, but will need to learn typescript )
Agreed!
There is no OLAP database besides TM1!

Post Reply