Closed zongsheng-zhao closed 2 years ago
Hi @zongsheng-zhao - sorry for the big delay in replying. Thank you for taking the time to prepare this PR! I think I want to go another way though (#235) for a couple of reasons.
additionalIncludeDirectories
and virtualDirectoryMappings
separate, mainly to keep the implementation simple.
Supported use of relative path in virtual directory key, value and include path.
For example, we write shadertoolsconfig.json like this:
Then HlslTools extension can correctly parse the include paths like these:
The logic is like this: In the json file we have
"<vpath>": "<rpath>"
pairs. The extension will create a virtual directory at<vpath>
, which will be mapped to the real path<rpath>
. If<vpath>
or<rpath>
is not a fully qualified path, then absolute fully qualified path will be calculated based on the path of json file. And when the extension searches include files, it will obey the normal search rule. If the include path is a relative path, tries to prefix include directories and convert it to absolute path. And then tries to find the file in that path, considering virtual directories.