Skip to content

Commit 88b8208

Browse files
committed
fix crash when line not found
1 parent 674a67a commit 88b8208

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/language_server/lib/language_server/providers/document_symbols.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ defmodule ElixirLS.LanguageServer.Providers.DocumentSymbols do
482482
if parent_end_line > parent_do_line do
483483
# take end location from parent and assume end_of_expression is last char in previous line
484484
end_of_expression =
485-
Enum.at(lines, parent_end_line - 2)
485+
Enum.at(lines, max(parent_end_line - 2, 0))
486486
|> String.length()
487487

488488
SourceFile.elixir_position_to_lsp(

0 commit comments

Comments
 (0)