From 2c09275388d4c88ea26bf709132b8be4a9e342bc Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 30 Jun 2022 14:19:39 -0700 Subject: Language server: extract documentation from ordinary comments (#2308) * Language server: improved documentation formatting. * Extend doc extractor to search in ordinary comments. Reuse language server instance between tests. * Fix test case. * Fix comment. * Fix crash. * Fix enum case doc extraction. * Doc extractor fixes. * Fix. * Fix. Co-authored-by: Yong He --- source/slang/slang-language-server-auto-format.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source/slang/slang-language-server-auto-format.cpp') diff --git a/source/slang/slang-language-server-auto-format.cpp b/source/slang/slang-language-server-auto-format.cpp index 8d31c44c6..8d877eaca 100644 --- a/source/slang/slang-language-server-auto-format.cpp +++ b/source/slang/slang-language-server-auto-format.cpp @@ -26,13 +26,12 @@ String findClangFormatTool() auto localProcess = Path::combine(dirName, processName); if (File::exists(localProcess)) return localProcess; - - Index vsCodeLoc = dirName.indexOf(".vscode"); + auto extensionsStr = UnownedStringSlice("extensions"); + Index vsCodeLoc = dirName.indexOf(extensionsStr); if (vsCodeLoc != -1) { // If we still cannot find clang-format, try to use the clang-format bundled with VSCode's C++ extension. - String vsCodeExtDir = dirName.subString(0, vsCodeLoc + 7); - vsCodeExtDir = Path::combine(vsCodeExtDir, "extensions"); + String vsCodeExtDir = dirName.subString(0, vsCodeLoc + extensionsStr.getLength()); struct CallbackContext { String foundPath; -- cgit v1.2.3