On 7/31/23 02:24, Vladimir Machat wrote:
Hello,

I started using PlantUML plugin recently (https://github.com/matthiasblaesing/plantuml-nb) . As I am also learning Netbeans platform programming, as an exercise I fixed the auto-complete. Now I would like to implement auto-indent but I seem to be stuck on this one, I can't find any information on this anywhere, can someone point me in the right direction, please?

How and where do I specify the indent style for given type of file? What I want to achieve is when i type:

 class Customer {<enter>

that the next line is auto-indented by specified amount of spaces.

Thanks

Vlad

The Indent style is actually defined by the indenter associated with the mime type.

Whenever you hit the enter, the indenter is called with the document, and the location of the cursor, so you need to indent that.

Depending on the type of the document, implementing an indenter could be a tricky one. If you are lucky it could be done using the TokenSequence from the Lexer, but some languages may require to have Parser information as well.

https://github.com/apache/netbeans/blob/master/ide/languages.hcl/src/org/netbeans/modules/languages/hcl/HCLIndenter.java



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org
For additional commands, e-mail: dev-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



Reply via email to