/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
**
****************************************************************************/

/*!
    \contentspage index.html
    \previouspage creator-coding-navigating.html
    \page creator-highlighting.html
    \nextpage creator-checking-code-syntax.html

    \title Semantic Highlighting

    \QC understands the C++, QML, and JavaScript languages as code, not as plain
    text. It reads the source code, analyzes it, and highlights it based on the
    semantic checks that it does for the following code elements:

    \list
        \li Types (such as classes, structs, and type definitions)
        \li Local variables
        \li Class fields
        \li Virtual functions
    \endlist

    To specify the color scheme to use for semantic highlighting, select
    \uicontrol Tools > \uicontrol Options > \uicontrol {Text Editor} >
    \uicontrol {Fonts & Color}.

    \QC supports syntax highlighting also for other types of files than C++,
    QML, or JavaScript.

    \section1 Generic Highlighting

    Generic highlighting is based on highlight definition files that are
    provided by the
    \l{http://kate-editor.org/2005/03/24/writing-a-syntax-highlighting-file/}
    {Kate Editor}. You can download highlight definition files for use with \QC.
    For more information about the definition files, see
    \l{http://kde-files.org/index.php?xcontentmode=680}{KDE-Files.org}.

    If you have a Unix installation that comes with the Kate Editor, you might
    already have the definition files installed. Typically, the files are
    located in a read-only directory, and therefore, you cannot manage them. \QC
    can try to locate them and use them as fallback files, when the primary
    location does not contain the definition for the current file type. You can
    also specify the directory that contains preinstalled highlight
    definition files as the primary location.

    When you open a file for editing and the editor cannot find the highlight
    definition for it, an alert appears. To suppress the alerts, you can specify
    patterns for ignoring files.

    To download highlight definition files:

    \list 1
        \li Select \uicontrol Tools > \uicontrol Options >
            \uicontrol {Text Editor} > \uicontrol {Generic Highlighter}.
            \image qtcreator-generic-highlighter.png "Generic Highlighter options"
        \li In the \uicontrol Location field, specify the path to the primary
            location for highlight definition files.
        \li Click \uicontrol {Download Definitions} to open a list of highlight
            definition files available for download.
            \image qtcreator-manage-definitions.png "Download Definitions dialog"
        \li Select highlight definition files in the list and click
            \uicontrol {Download Selected Definitions}.
        \li Select the \uicontrol {Use fallback location} check box to specify
            the secondary location where the editor will look for highlight
            definition files.
        \li Click \uicontrol Autodetect to allow \QC to look for highlight
            definition files on your system, or click \uicontrol Browse to
            locate them in the file system yourself.
        \li In the \uicontrol {Ignored file patterns} field, specify file
            patterns to suppress alerts if the highlight definitions for the
            specified files are not found.
        \li Click \uicontrol OK to save your changes.
    \endlist

    \section1 Highlighting and Folding Blocks

    Use block highlighting to visually separate parts of the code that belong
    together. For example, when you place the cursor within the braces, the code
    enclosed in braces is highlighted.

    \image qtcreator-blockhighlighting.png

    To enable block highlighting, select \uicontrol Tools >
    \uicontrol Options > \uicontrol {Text Editor} > \uicontrol Display >
    \uicontrol {Highlight blocks}.

    Use the folding markers to collapse and expand blocks of code within braces.
    Click the folding marker to collapse or expand a block. In the figure above,
    the folding markers are located between the line number and the text pane.

    To show the folding markers, select \uicontrol Tools > \uicontrol Options >
    \uicontrol {Text Editor} > \uicontrol Display >
    \uicontrol {Display folding markers}. This option is enabled by default.

    When the cursor is on a brace, the matching brace is animated by default. To
    turn off the animation and just highlight the block and the braces, select
    \uicontrol Tools > \uicontrol Options > \uicontrol {Text Editor} >
    \uicontrol Display and deselect \uicontrol {Animate matching parentheses}.

    You can use keyboard shortcuts to move within and between blocks. To go to
    block end, press \key {Ctrl+]} and to go to block start, press
    \key {Ctrl+[}. To also select the lines from the cursor position to the end
    or beginning of the block, press \key {Ctrl+Shift+]} and
    \key {Ctrl+Shift+[}, respectively.

    To select the current block, press \key Ctrl+U. A second key press extends
    the selection to the parent block. To undo the last selection, press
    \key {Ctrl+Alt+Shift+U}. To enable smart block selection, select
    \uicontrol Tools > \uicontrol Options > \uicontrol {Text Editor} >
    \uicontrol Behavior > \uicontrol {Enable smart selection changing}.
*/
