diff options
| author | Yong He <yonghe@outlook.com> | 2025-07-03 15:20:23 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-03 22:20:23 +0000 |
| commit | b4fc380af5e390ca11892f9e657e653f6869c21b (patch) | |
| tree | 9072841ed14a190cce0790ced27b283f85d1fc4f /tools | |
| parent | 551d0c365571a2e36505851f6a713464662c5fea (diff) | |
Language Server Enhancements (#7604)
* Language Server: auto-select the best candidate in signature help.
* Fix constructor call highlighting + goto definition.
* Add test.
* format code
* Improve ctor signature help.
* Add tests.
* Fix decl path printing for extension children.
* Allow goto definition to show core module source.
* c++ compile fix.
---------
Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/slang-test/slang-test-main.cpp | 7 | ||||
| -rw-r--r-- | tools/slangd/main.cpp | 8 |
2 files changed, 14 insertions, 1 deletions
diff --git a/tools/slang-test/slang-test-main.cpp b/tools/slang-test/slang-test-main.cpp index c22b6dbf6..5e17513d5 100644 --- a/tools/slang-test/slang-test-main.cpp +++ b/tools/slang-test/slang-test-main.cpp @@ -2141,8 +2141,13 @@ TestResult runLanguageServerTest(TestContext* context, TestInput& input) { actualOutputSB << "activeParameter: " << sigInfo.activeParameter << "\n"; actualOutputSB << "activeSignature: " << sigInfo.activeSignature << "\n"; - for (auto item : sigInfo.signatures) + for (Index i = 0; i < sigInfo.signatures.getCount(); ++i) { + auto& item = sigInfo.signatures[i]; + if (i == sigInfo.activeSignature) + { + actualOutputSB << "(selected) "; + } actualOutputSB << item.label << ":"; for (auto param : item.parameters) { diff --git a/tools/slangd/main.cpp b/tools/slangd/main.cpp index 240992273..f2b962253 100644 --- a/tools/slangd/main.cpp +++ b/tools/slangd/main.cpp @@ -16,6 +16,14 @@ int main(int argc, const char* const* argv) { isDebug = true; } + else if (Slang::UnownedStringSlice(argv[i]) == "--print-builtin-module" && i < argc - 1) + { + Slang::UnownedStringSlice moduleName = Slang::UnownedStringSlice(argv[++i]); + Slang::ComPtr<slang::IBlob> code; + Slang::getBuiltinModuleSource(moduleName, code.writeRef()); + printf("%s\n", (const char*)code->getBufferPointer()); + return 0; + } } if (isDebug) { |
