I have the following code from Intellij's indentation:
public static String[] defaultMethodBlacklist = new String[]{
"getClass",
"wait",
"notify",
"notifyAll",
"finalize"
};
And:
public InternalClusterInfoService(Settings settings, NodeSettingsService nodeSettingsService,
TransportNodesStatsAction transportNodesStatsAction,
TransportIndicesStatsAction transportIndicesStatsAction, ClusterService clusterService,
ThreadPool threadPool) {
However, when I attempt to adjust/fix the indentation in Emacs, I get:
public static String[] defaultMethodBlacklist = new String[]{
"getClass",
"wait",
"notify",
"notifyAll",
"finalize"
};
public InternalClusterInfoService(Settings settings, NodeSettingsService nodeSettingsService,
TransportNodesStatsAction transportNodesStatsAction,
TransportIndicesStatsAction transportIndicesStatsAction, ClusterService clusterService,
ThreadPool threadPool) {
My current indentation configuration looks like:
(c-offsets-alist . ((inline-open . 0)
(topmost-intro-cont . +)
(statement-block-intro . +)
(knr-argdecl-intro . 5)
(substatement-open . +)
(substatement-label . +)
(label . +)
(statement-case-open . +)
(statement-cont . ++)
(arglist-intro . ++)
(arglist-close . ++)
(arglist-cont-nonempty . ++)
(access-label . 0)
(inher-cont . ++)
(func-decl-cont . ++))))
How can I configure the indentation in emacs to match Intellij's for code like this?
Also, how can I diagnose and fix issues like this in the future myself? Is there a way to get which "type" of indentation is being used at a particular point?
C-c C-s
(forc-show-syntactic-information
) to see which syntactic elements could influence indentation at point.