Skip to content

panic: runtime error: index out of range [-1] #17

@appleynski

Description

@appleynski

Hi!

I have hyprls installed on Arch Linux and running fine under NeoVim.
However, when running in VSCode with HyprLS extension, I'm getting the following:

2024-07-23T18:49:43.406+0200	DEBUG	hyprls/main.go:25	going to start server
2024-07-23T18:49:43.406+0200	DEBUG	[email protected]/main.go:18	starting server
panic: runtime error: index out of range [-1]

goroutine 6 [running]:
github.com/ewen-lbh/hyprls/parser.Parse({0xc000147b00, 0x856})
	/home/krzysztof/.local/share/go/pkg/mod/github.com/ewen-lbh/[email protected]/parser/lowlevel.go:254 +0xcc9
github.com/ewen-lbh/hyprls.parse({0xc0005d20c0?, 0x75ac00?})
	/home/krzysztof/.local/share/go/pkg/mod/github.com/ewen-lbh/[email protected]/state.go:31 +0xb8
github.com/ewen-lbh/hyprls.Handler.DocumentColor({{0xc0002b8000?, 0x4c?}, 0x8000?}, {0x72c680?, 0xc000592080?}, 0x0?)
	/home/krzysztof/.local/share/go/pkg/mod/github.com/ewen-lbh/[email protected]/color.go:29 +0x49
go.lsp.dev/protocol.serverDispatch({0x888aa0, 0xc00030f8c0}, {0x88e508, 0xc000012f90}, 0xc000592060, {0x7b1fec1a26c8, 0xc0001dfbc0})
	/home/krzysztof/.local/share/go/pkg/mod/go.lsp.dev/[email protected]/server.go:338 +0x6dbd
github.com/ewen-lbh/hyprls.StartServer.ServerHandler.func1({0x888aa0, 0xc00030f8c0}, 0xc000592060, {0x7b1fec1a26c8, 0xc0001dfbc0})
	/home/krzysztof/.local/share/go/pkg/mod/go.lsp.dev/[email protected]/server.go:36 +0x7e
go.lsp.dev/jsonrpc2.(*conn).run(0xc000118cd0, {0x888aa0, 0xc00030f8c0}, 0xc000012fa8)
	/home/krzysztof/.local/share/go/pkg/mod/go.lsp.dev/[email protected]/conn.go:206 +0x33f
created by go.lsp.dev/jsonrpc2.(*conn).Go in goroutine 1
	/home/krzysztof/.local/share/go/pkg/mod/go.lsp.dev/[email protected]/conn.go:189 +0x8f
[Error - 6:49:45 PM] Server process exited with code 2.
[Info  - 6:49:45 PM] Connection to server got closed. Server will restart.
true
2024-07-23T18:49:45.412+0200	DEBUG	hyprls/main.go:25	going to start server
2024-07-23T18:49:45.412+0200	DEBUG	[email protected]/main.go:18	starting server
panic: runtime error: index out of range [-1]

goroutine 13 [running]:
github.com/ewen-lbh/hyprls/parser.Parse({0xc0000abb00, 0x856})
	/home/krzysztof/.local/share/go/pkg/mod/github.com/ewen-lbh/[email protected]/parser/lowlevel.go:254 +0xcc9
github.com/ewen-lbh/hyprls.parse({0xc0004a5680?, 0x88bfc0?})
	/home/krzysztof/.local/share/go/pkg/mod/github.com/ewen-lbh/[email protected]/state.go:31 +0xb8
github.com/ewen-lbh/hyprls.Handler.DocumentSymbol({{0xc0002d0000?, 0x4c?}, 0x8000?}, {0x72c800?, 0xc000509c40?}, 0x0?)
	/home/krzysztof/.local/share/go/pkg/mod/github.com/ewen-lbh/[email protected]/symbols.go:12 +0x49
go.lsp.dev/protocol.serverDispatch({0x888aa0, 0xc000177500}, {0x88e508, 0xc00013e6d8}, 0xc000509c20, {0x788d2d5d94f8, 0xc000225100})
	/home/krzysztof/.local/share/go/pkg/mod/go.lsp.dev/[email protected]/server.go:386 +0x8023
github.com/ewen-lbh/hyprls.StartServer.ServerHandler.func1({0x888aa0, 0xc000177500}, 0xc000509c20, {0x788d2d5d94f8, 0xc000225100})
	/home/krzysztof/.local/share/go/pkg/mod/go.lsp.dev/[email protected]/server.go:36 +0x7e
go.lsp.dev/jsonrpc2.(*conn).run(0xc0005934a0, {0x888aa0, 0xc000177500}, 0xc00013e6f0)
	/home/krzysztof/.local/share/go/pkg/mod/go.lsp.dev/[email protected]/conn.go:206 +0x33f
created by go.lsp.dev/jsonrpc2.(*conn).Go in goroutine 1
	/home/krzysztof/.local/share/go/pkg/mod/go.lsp.dev/[email protected]/conn.go:189 +0x8f
[Error - 6:49:45 PM] Server process exited with code 2.
[Info  - 6:49:45 PM] Connection to server got closed. Server will restart.
true
2024-07-23T18:49:45.612+0200	DEBUG	hyprls/main.go:25	going to start server
2024-07-23T18:49:45.612+0200	DEBUG	[email protected]/main.go:18	starting server
panic: runtime error: index out of range [-1]

goroutine 12 [running]:
github.com/ewen-lbh/hyprls/parser.Parse({0xc0000abb00, 0x856})
	/home/krzysztof/.local/share/go/pkg/mod/github.com/ewen-lbh/[email protected]/parser/lowlevel.go:254 +0xcc9
github.com/ewen-lbh/hyprls.parse({0xc00049e0c0?, 0x88bfc0?})
	/home/krzysztof/.local/share/go/pkg/mod/github.com/ewen-lbh/[email protected]/state.go:31 +0xb8
github.com/ewen-lbh/hyprls.Handler.DocumentSymbol({{0xc0004c6000?, 0x4c?}, 0x8000?}, {0x72c800?, 0xc0002be020?}, 0x0?)
	/home/krzysztof/.local/share/go/pkg/mod/github.com/ewen-lbh/[email protected]/symbols.go:12 +0x49
go.lsp.dev/protocol.serverDispatch({0x888aa0, 0xc00028d0b0}, {0x88e508, 0xc000210de0}, 0xc0002be000, {0x7bc49da523b8, 0xc00058c040})
	/home/krzysztof/.local/share/go/pkg/mod/go.lsp.dev/[email protected]/server.go:386 +0x8023
github.com/ewen-lbh/hyprls.StartServer.ServerHandler.func1({0x888aa0, 0xc00028d0b0}, 0xc0002be000, {0x7bc49da523b8, 0xc00058c040})
	/home/krzysztof/.local/share/go/pkg/mod/go.lsp.dev/[email protected]/server.go:36 +0x7e
go.lsp.dev/jsonrpc2.(*conn).run(0xc000514af0, {0x888aa0, 0xc00028d0b0}, 0xc000210df8)
	/home/krzysztof/.local/share/go/pkg/mod/go.lsp.dev/[email protected]/conn.go:206 +0x33f
created by go.lsp.dev/jsonrpc2.(*conn).Go in goroutine 1
	/home/krzysztof/.local/share/go/pkg/mod/go.lsp.dev/[email protected]/conn.go:189 +0x8f
[Error - 6:49:45 PM] Server process exited with code 2.
[Info  - 6:49:45 PM] Connection to server got closed. Server will restart.
true
2024-07-23T18:49:45.810+0200	DEBUG	hyprls/main.go:25	going to start server
2024-07-23T18:49:45.810+0200	DEBUG	[email protected]/main.go:18	starting server
panic: runtime error: index out of range [-1]

goroutine 34 [running]:
github.com/ewen-lbh/hyprls/parser.Parse({0xc0001bbb00, 0x856})
	/home/krzysztof/.local/share/go/pkg/mod/github.com/ewen-lbh/[email protected]/parser/lowlevel.go:254 +0xcc9
github.com/ewen-lbh/hyprls.parse({0xc00052c000?, 0x88bfc0?})
	/home/krzysztof/.local/share/go/pkg/mod/github.com/ewen-lbh/[email protected]/state.go:31 +0xb8
github.com/ewen-lbh/hyprls.Handler.DocumentSymbol({{0xc000512000?, 0x4c?}, 0x8000?}, {0x72c800?, 0xc000016040?}, 0x0?)
	/home/krzysztof/.local/share/go/pkg/mod/github.com/ewen-lbh/[email protected]/symbols.go:12 +0x49
go.lsp.dev/protocol.serverDispatch({0x888aa0, 0xc00026d740}, {0x88e508, 0xc00019f200}, 0xc000016020, {0x79f7181a09b8, 0xc000255b00})
	/home/krzysztof/.local/share/go/pkg/mod/go.lsp.dev/[email protected]/server.go:386 +0x8023
github.com/ewen-lbh/hyprls.StartServer.ServerHandler.func1({0x888aa0, 0xc00026d740}, 0xc000016020, {0x79f7181a09b8, 0xc000255b00})
	/home/krzysztof/.local/share/go/pkg/mod/go.lsp.dev/[email protected]/server.go:36 +0x7e
go.lsp.dev/jsonrpc2.(*conn).run(0xc00042b040, {0x888aa0, 0xc00026d740}, 0xc00019f218)
	/home/krzysztof/.local/share/go/pkg/mod/go.lsp.dev/[email protected]/conn.go:206 +0x33f
created by go.lsp.dev/jsonrpc2.(*conn).Go in goroutine 1
	/home/krzysztof/.local/share/go/pkg/mod/go.lsp.dev/[email protected]/conn.go:189 +0x8f
[Error - 6:49:45 PM] Server process exited with code 2.
[Info  - 6:49:45 PM] Connection to server got closed. Server will restart.
true
2024-07-23T18:49:45.898+0200	DEBUG	hyprls/main.go:25	going to start server
2024-07-23T18:49:45.898+0200	DEBUG	[email protected]/main.go:18	starting server
panic: runtime error: index out of range [-1]

goroutine 7 [running]:
github.com/ewen-lbh/hyprls/parser.Parse({0xc000141b00, 0x856})
	/home/krzysztof/.local/share/go/pkg/mod/github.com/ewen-lbh/[email protected]/parser/lowlevel.go:254 +0xcc9
github.com/ewen-lbh/hyprls.parse({0xc0004c8000?, 0x88bfc0?})
	/home/krzysztof/.local/share/go/pkg/mod/github.com/ewen-lbh/[email protected]/state.go:31 +0xb8
github.com/ewen-lbh/hyprls.Handler.DocumentSymbol({{0xc0003ea000?, 0x4c?}, 0x8000?}, {0x72c800?, 0xc0003aa020?}, 0x0?)
	/home/krzysztof/.local/share/go/pkg/mod/github.com/ewen-lbh/[email protected]/symbols.go:12 +0x49
go.lsp.dev/protocol.serverDispatch({0x888aa0, 0xc0002941e0}, {0x88e508, 0xc0001248e8}, 0xc0003aa000, {0x7f992426b938, 0xc00038a000})
	/home/krzysztof/.local/share/go/pkg/mod/go.lsp.dev/[email protected]/server.go:386 +0x8023
github.com/ewen-lbh/hyprls.StartServer.ServerHandler.func1({0x888aa0, 0xc0002941e0}, 0xc0003aa000, {0x7f992426b938, 0xc00038a000})
	/home/krzysztof/.local/share/go/pkg/mod/go.lsp.dev/[email protected]/server.go:36 +0x7e
go.lsp.dev/jsonrpc2.(*conn).run(0xc000502370, {0x888aa0, 0xc0002941e0}, 0xc000124900)
	/home/krzysztof/.local/share/go/pkg/mod/go.lsp.dev/[email protected]/conn.go:206 +0x33f
created by go.lsp.dev/jsonrpc2.(*conn).Go in goroutine 1
	/home/krzysztof/.local/share/go/pkg/mod/go.lsp.dev/[email protected]/conn.go:189 +0x8f
[Error - 6:49:45 PM] Server process exited with code 2.
[Error - 6:49:45 PM] The Hypr server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

Is there any additional info I can provide to help fix this issue?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions