Skip to content

Commit 3520f2c

Browse files
authored
Merge pull request github#3714 from shati-patel/name-res-114
QL handbook: Update process for module resolution
2 parents 57c8dd8 + 947ccb0 commit 3520f2c

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

docs/language/ql-handbook/name-resolution.rst

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,31 +61,23 @@ following import statement::
6161

6262
import examples.security.MyLibrary
6363

64-
To find the precise location of this library module, the QL compiler processes the import
64+
To find the precise location of this :ref:`library module <library-modules>`, the QL compiler processes the import
6565
statement as follows:
6666

6767
#. The ``.``\ s in the qualified reference correspond to file path separators, so it first looks
6868
up ``examples/security/MyLibrary.qll`` from the directory containing ``Example.ql``.
6969

70-
#. If that fails, it looks up ``examples/security/MyLibrary.qll`` relative to the enclosing query
71-
directory, if any.
72-
This query directory is a directory containing a |queries.xml file|_, and where the contents
73-
of that file is compatible with the current database schema.
74-
(For example, if you are querying a JavaScript database, then the |queries.xml file|_ should
75-
contain ``<queries language="javascript"/>``.)
70+
#. If that fails, it looks up ``examples/security/MyLibrary.qll`` relative to the query
71+
directory, if any.
72+
The query directory is the first enclosing directory containing a file called ``qlpack.yml``. (Or, in legacy products, a file called ``queries.xml``.)
7673

77-
#. If no file is found using the above two checks, it looks up ``examples/security/MyLibrary.qll``
78-
relative to each library path entry. The library path depends on the environment where you
79-
run your query, and whether you have specified any extra settings.
74+
#. If the compiler can't find the library file using the above two checks, it looks up ``examples/security/MyLibrary.qll``
75+
relative to each library path entry.
76+
The library path is usually specified using the ``libraryPathDependencies`` of the ``qlpack.yml`` file, though it may also depend on the tools you use to run your query, and whether you have specified any extra settings.
77+
For more information, see `Library path <https://help.semmle.com/QL/ql-spec/language.html#library-path>`__ in the QL language specification.
8078

81-
.. |queries.xml file| replace:: ``queries.xml`` file
82-
.. _queries.xml file: https://help.semmle.com/wiki/display/SD/queries.xml+file
83-
8479
If the compiler cannot resolve an import statement, then it gives a compilation error.
8580

86-
This process is described in more detail in the section on `module resolution <https://help.semmle.com/QL/ql-spec/language.html#module-resolution>`_
87-
in the QL language specification.
88-
8981
.. _selections:
9082

9183
Selections

0 commit comments

Comments
 (0)