Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Code Completion for AUI / AJS in JavaScript Edited


I am starting to write a Confluence User Macro and I was wondering how I can get JavaScript code completion e.g. in Visual Studio Code (or any other editor) for AUI / AJS.

I would like to know what is behind `AJS.*`. Like `AJS.toInit()` or `AJS.Confluence.*` and so on.

Thanks, Daniel

2 answers

0 votes
Zak Laughton Atlassian Team Jan 15, 2020

Hi Daniel!

Unfortunately, I wasn't able to find a definitive answer, but thought I'd share some of my investigation in case it helps.

As long as you're importing the module that has AJS in the file, VS Code should be able to make suggestions for you. I'm not quite sure where you can import it from though. These pages may give some clues, and it looks like you may be able to use a file in the Confluence installation itself (though I don't have a local installation for testing):

You may also want to ask this question in the Atlassian Developer Community, as there may be someone there who has come up with a solution for this.

– Zak

Hi Zak,

thank you for your research but I have found there nothing what helped me. The links are in my opinion more about including custom JS to macros or are about the Java Macro development (what I am not doing). What file did you mean - do you have a filename for me?

I have also tested using the AUI Node.js module from the AUI - Getting started guide but this did also not help. And I also switched to JetBrains WebStorm and IntelliJ IDEA - which was better with jQuery, but nothing better.

Could you provide me a link to the reference documentation of AJS so I can look up there the possible properties and functions it provides? So I can shimmy down myself there. And for example can you directly show me there the `AJS.toInit()` function?

I have raised my question again in the ADC - let's wait.

Thanks so far - Daniel

0 votes

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence

🏑 Atlympic Event: Confluence

Hello Community!  Quick disclaimer: We are running a contest on Community (The Atlympics!) from July 23rd - August 8th of 2021. If you are interested in participating in this contest (prizes! ...

100 views 3 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you