Skip to content

Commit 0f3128d

Browse files
authored
Merge pull request github#13572 from kaspersv/kaspersv/deprecated-imports-docs
Document deprecated imports
2 parents 06bc460 + d42f6a0 commit 0f3128d

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

docs/codeql/ql-language-reference/annotations.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ body must also be annotated with ``cached``, otherwise a compiler error is repor
126126
``deprecated``
127127
==============
128128

129-
**Available for**: |classes|, |algebraic datatypes|, |member predicates|, |non-member predicates|, |fields|, |modules|, |aliases|
129+
**Available for**: |classes|, |algebraic datatypes|, |member predicates|, |non-member predicates|, |imports|, |fields|, |modules|, |aliases|
130130

131131
The ``deprecated`` annotation is applied to names that are outdated and scheduled for removal
132132
in a future release of QL.

docs/codeql/ql-language-reference/modules.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,12 @@ Import statements are used for importing modules. They are of the form:
264264
Import statements are usually listed at the beginning of the module. Each
265265
import statement imports one module. You can import multiple modules by
266266
including multiple import statements (one for each module you want to import).
267-
An import statement can also be :ref:`annotated <private>` with ``private``.
267+
268+
An import statement can also be :ref:`annotated <annotations-overview>` with
269+
``private`` or ``deprecated``. If an import statement is annotated with
270+
``private`` then the imported names are not reexported. If an imported name is
271+
only reachable through deprecated imports in a given context then usage of the
272+
name in that context will generate deprecation warnings.
268273

269274
You can import a module under a different name using the ``as`` keyword,
270275
for example ``import javascript as js``.

docs/codeql/ql-language-reference/ql-language-specification.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ The following table summarizes the syntactic constructs which can be marked with
794794
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
795795
| ``private`` | yes | | yes | yes | yes | yes | yes | yes | yes |
796796
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
797-
| ``deprecated`` | yes | | yes | yes | | yes | yes | yes | yes |
797+
| ``deprecated`` | yes | | yes | yes | yes | yes | yes | yes | yes |
798798
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+
799799
| ``override`` | | | yes | | | yes | | | |
800800
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+------------+

0 commit comments

Comments
 (0)