diff options
| author | Yong He <yonghe@outlook.com> | 2023-12-05 10:06:19 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-05 10:06:19 -0800 |
| commit | 1050e0eb96d6c8e7a6cfb253458155e1014625c3 (patch) | |
| tree | ce6c3cbde591759fa2fe2aeb05cb132e50a9a419 /source/compiler-core/slang-include-system.h | |
| parent | 4fb3b10b81cf8c976ebd1ebb7fcde7708f022957 (diff) | |
Support `include` for pulling file into the current module. (#3377)
* Support `include` for pulling file into the current module.
* Add auto-completion, hover info and goto-def support.
* Disable warning for missing `module` declaration for now.
---------
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/compiler-core/slang-include-system.h')
| -rw-r--r-- | source/compiler-core/slang-include-system.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/compiler-core/slang-include-system.h b/source/compiler-core/slang-include-system.h index 108c4901b..cc89985dd 100644 --- a/source/compiler-core/slang-include-system.h +++ b/source/compiler-core/slang-include-system.h @@ -36,7 +36,12 @@ struct IncludeSystem SlangResult findFile(const String& pathToInclude, const String& pathIncludedFrom, PathInfo& outPathInfo); SlangResult findFile(SlangPathType fromPathType, const String& fromPath, const String& path, PathInfo& outPathInfo); String simplifyPath(const String& path); - SlangResult loadFile(const PathInfo& pathInfo, ComPtr<ISlangBlob>& outBlob); + SlangResult loadFile(const PathInfo& pathInfo, ComPtr<ISlangBlob>& outBlob, SourceFile*& outSourceFile); + inline SlangResult loadFile(const PathInfo& pathInfo, ComPtr<ISlangBlob>& outBlob) + { + SourceFile* sourceFile; + return loadFile(pathInfo, outBlob, sourceFile); + } SlangResult findAndLoadFile(const String& pathToInclude, const String& pathIncludedFrom, PathInfo& outPathInfo, ComPtr<ISlangBlob>& outBlob); @@ -45,6 +50,7 @@ struct IncludeSystem SourceManager* getSourceManager() const { return m_sourceManager; } /// Ctor + IncludeSystem() = default; IncludeSystem(SearchDirectoryList* searchDirectories, ISlangFileSystemExt* fileSystemExt, SourceManager* sourceManager = nullptr); protected: |
