From 241def9c7619c437aad1bb620be8891e61707d8d Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 16 Jun 2022 01:50:43 -0700 Subject: Language server: document symbols (#2287) * Language Server: Document Symbol outline. * Fix highlighting of extension decls. Co-authored-by: Yong He --- source/slang/slang-workspace-version.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/slang/slang-workspace-version.cpp') diff --git a/source/slang/slang-workspace-version.cpp b/source/slang/slang-workspace-version.cpp index 2742c083c..781d8a3bc 100644 --- a/source/slang/slang-workspace-version.cpp +++ b/source/slang/slang-workspace-version.cpp @@ -390,6 +390,12 @@ ArrayView DocumentVersion::getUTF16Boundaries(Index line) void DocumentVersion::oneBasedUTF8LocToZeroBasedUTF16Loc( Index inLine, Index inCol, Index& outLine, Index& outCol) { + if (inLine <= 0) + { + outLine = 0; + outCol = 0; + } + Index rsLine = inLine - 1; auto line = lines[rsLine]; auto bounds = getUTF16Boundaries(inLine); -- cgit v1.2.3