Configuring Use Clause Indenting

The indent of a use clause is set during the indent phase shortly after a file is read.

There are several options which allow configuration of use clauses.

Option

Values

Default

Description

token_after_library_clause

<integer> current '+<integer>' '-<integer>'

'+1'

  • <integer> = Sets the indent level to the specified value.

  • current = Uses the existing indent level.

  • '+<integer>' = Increase the indent relative to the current indent level.

  • '-<integer>' = Decrease the indent relative to the current indent level.

token_if_no_matching_library_clause

This is an example of how to configure these options.

indent:
  tokens:
    use_clause:
      keyword:
        token_after_library_clause: '+1'
        token_if_no_matching_library_clause: '+1'

The following code snippet is used for all examples.

library ieee;
  use ieee.std_logic_1164.all;

  use work.my_package.all;

Example: token_if_no_matching_library_clause set to current

The token_if_no_matching_library_clause option controls the indent of use clauses if there is no matching library clause.

library ieee;
  use ieee.std_logic_1164.all;

use work.my_package.all;

Example: token_if_no_matching_library_clause set to '+1'

library ieee;
  use ieee.std_logic_1164.all;

  use work.my_package.all;

Example: token_after_library_clause set to current

The token_after_library_clause option controls the indent of use clauses if there is a matching library clause.

library ieee;
use ieee.std_logic_1164.all;

  use work.my_package.all;

Example: token_after_library_clause set to '+1'

library ieee;
  use ieee.std_logic_1164.all;

  use work.my_package.all;

Rules Enforcing Use Clause Indenting