summaryrefslogtreecommitdiff
path: root/source/slang
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-12-11 16:58:13 -0800
committerGitHub <noreply@github.com>2024-12-11 16:58:13 -0800
commit2999cb72a297152699a099b0f7762143dcc9a055 (patch)
tree63ae1e0d6488a2fd92b59360c1fec4a91a31ef5f /source/slang
parent1f3be303e7f54f04b6eebfa5973838df89282a68 (diff)
LSP: fix "documentSymbol failed" error. (#5842)
Diffstat (limited to 'source/slang')
-rw-r--r--source/slang/slang-language-server-document-symbols.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/slang/slang-language-server-document-symbols.cpp b/source/slang/slang-language-server-document-symbols.cpp
index f41f14f08..c13316a71 100644
--- a/source/slang/slang-language-server-document-symbols.cpp
+++ b/source/slang/slang-language-server-document-symbols.cpp
@@ -195,6 +195,11 @@ static void _getDocumentSymbolsImpl(
sym.range.end.line = (int)line;
sym.range.end.character = (int)col;
}
+ if (sym.selectionRange.end.line == sym.range.end.line ||
+ sym.selectionRange.end.character >= sym.range.end.character)
+ {
+ sym.selectionRange.end = sym.range.end;
+ }
}
if (const auto childContainerDecl = as<ContainerDecl>(child))
{