diff --git a/docs/source/development/change_log.rst b/docs/source/development/change_log.rst index b3a2e2e..420cdd8 100644 --- a/docs/source/development/change_log.rst +++ b/docs/source/development/change_log.rst @@ -3,8 +3,12 @@ Changelog ========= -Unreleased ----------- +.. _`release:1.4.0`: + +1.4.0 +----- + +:Released: 30.07.2026 New and Improved ................ @@ -16,6 +20,51 @@ New and Improved ``comment_type = "bash"``. The supported comment style is ``#``. Fish shell is not supported (no ``tree-sitter-fish`` grammar is published for the Python package). +- โœจ Added an opt-in preprocessor-aware C/C++ extraction engine, powered by libclang. + + The default tree-sitter engine sees every comment in a file, regardless of conditional + compilation. Configuring the new :ref:`analyse.preprocessor ` table + switches C/C++ extraction to libclang, which evaluates the preprocessor and emits only + the markers in **active** branches โ€” a need behind an inactive ``#if`` / ``#else`` is + dropped. Compiler flags are resolved per file from a ``compile_commands.json`` + compilation database, with an explicit ``defines`` list for headers, which are not + listed in such a database. Active markers keep their original line numbers. + + The engine requires the optional ``libclang`` dependency + (``pip install 'sphinx-codelinks[libclang]'``). Plain tree-sitter C/C++ extraction is + unaffected when it is not installed. See :ref:`preprocessor_engine` for details. + +- ๐Ÿ“š Traced the preprocessor-aware C/C++ engine in the feature documentation. + + ``features.rst`` now declares the engine as a feature with its fault children, and the + implementation carries the one-line markers that link back to it. The engine is therefore + covered by the project's own traceability report, like every supported language. + +- ๐Ÿงช Added a declarative fixture and snapshot test layer for marker extraction. + + Extraction cases are now data (a YAML fixture plus a captured JSON snapshot) instead of + bespoke test functions, covering the one-line, need-ID-reference and ``@rst`` block + surfaces across all supported languages. + +Fixes +..... + +- ๐Ÿ› Anchor newline-terminated one-line markers to the start of the comment. + + A start sequence (default ``@``) that appeared in free-form prose was matched anywhere in + a comment, so a line such as ``// See @author, check the example`` was parsed as a need + definition and the bogus ID raised ``InvalidNeedException`` in Sphinx-Needs. Markers that + run to the end of the line now only match when nothing but comment decoration (``//``, + ``#``, ``*``, ``///``, ``//!``, โ€ฆ) and whitespace precedes the start sequence. Markers + with an explicit ``end_sequence`` (e.g. ``[[ โ€ฆ ]]``) are self-delimiting and remain + position-independent, so they may still follow prose. + +- ๐Ÿ› Pinned ``typer`` and ``sphinxcontrib-typer`` to keep the documentation build working. + + ``typer 0.26.8`` removed ``rich_utils.STYLE_METAVAR`` and ``sphinxcontrib-typer 0.9.1`` + requires ``rich_utils.STYLE_TYPES``; either combination broke ``sphinx-build``. The + dependencies are now capped at ``typer<0.26.8`` and ``sphinxcontrib-typer<0.9.1``. + .. _`release:1.3.0`: 1.3.0 diff --git a/pyproject.toml b/pyproject.toml index 015f5ed..3e0d54c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "sphinx-codelinks" -version = "1.3.0" +version = "1.4.0" description = "Fast Source Code Traceability for Sphinx-Needs" authors = [{ name = "team useblocks", email = "info@useblocks.com" }] maintainers = [