pherrymason / c3-lsp Goto Github PK
View Code? Open in Web Editor NEWLanguage Server for C3 Language
License: GNU General Public License v3.0
Language Server for C3 Language
License: GNU General Public License v3.0
Organizing parsed symbols in a way that is easier to loop through all parsed symbols defined in a module even if they are split in different files would be easier.
Being able to find symbols by file name is still required though.
Describe the bug
Go to declaration determines the wrong symbol.
To Reproduce
Asking declaration of a struct member is redirecting to a wrong module (which is also not included):
module system;
import std::io;
import std::time;
import std::time::clock;
import std::thread;
import types;
import cpu;
import io;
import ppu;
import lcd;
import input;
import cart;
import serial;
import apu;
import debug;
struct System {
Cpu cpu; <---
Ppu ppu;
Lcd lcd;
Cart cart;
Io io;
Apu apu;
Serial serial;
UInt8[0x100] bios;
UInt8[0x2000] ram;
UInt8[0x7f] hram;
UInt8 interrupts;
bool bios_enabled;
UInt64 tick_counter;
UInt16 sysclk;
}
LSP evaluates to first argument on a function present in a non imported module.
module inst;
fn void push16(Cpu* cpu, Inst* inst, UInt16 value) {
UInt16 stack_addr = cpu.readReg16(SP);
stack_addr -= 2;
cpu.system.write16(stack_addr, value);
cpu.writeReg16(SP, stack_addr);
}
Expected behavior
It should find the Cpu
struct in the cpu
module.
Describe the bug
Server crashes when requesting "Go to declaration" on a string literal.
To Reproduce
Steps to reproduce the behavior:
double aha = "dddd";
Expected behavior
Should do nothing.
Log
2024/05/05 11:56:21.343 DEBUG [C3-LSP.rpc] jsonrpc2: --> request #22: textDocument/declaration: {"position":{"character":18,"line":60},"textDocument":{"uri":"file:///some-path/src/system.c3"}}
2024/05/05 11:56:21.344 DEBUG [C3-LSP.server] normalized path:/some-path/src/system.c3
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x20 pc=0x102401834]
goroutine 6 [running]:
github.com/pherrymason/c3-lsp/lsp.NewServer.func7(0x1400051e750?, 0x140002a8840)
/some-path/go-lsp/server/lsp/server.go:145 +0x84
github.com/tliron/glsp/protocol_3_16.(*Handler).Handle(0x14000166000, 0x14000028740)
/some-path/go/pkg/mod/github.com/tliron/[email protected]/protocol_3_16/handler.go:412 +0x1c10
github.com/tliron/glsp/server.(*Server).handle(0x1400010e240, {0x1025f56c0?, 0x102784fe0}, 0x14000142090, 0x14000094360)
/some-path/go/pkg/mod/github.com/tliron/[email protected]/server/handle.go:46 +0x260
github.com/sourcegraph/jsonrpc2.(*HandlerWithErrorConfigurer).Handle(0x140000122b0, {0x1025f56c0, 0x102784fe0}, 0x14000142090, 0x14000094360)
/some-path/go/pkg/mod/github.com/sourcegraph/[email protected]/handler_with_error.go:21 +0x4c
github.com/sourcegraph/jsonrpc2.(*Conn).readMessages(0x14000142090, {0x1025f56c0, 0x102784fe0})
/some-path/go/pkg/mod/github.com/sourcegraph/[email protected]/conn.go:205 +0x264
created by github.com/sourcegraph/jsonrpc2.NewConn in goroutine 1
/some-path/go/pkg/mod/github.com/sourcegraph/[email protected]/conn.go:62 +0x218
[Info - 11:56:21] Connection to server got closed. Server will restart.
When hovering on x
in this source code:
fn void foo() {
int x;
}
It sometimes will resolve with symbols with same name declared in different files.
What is expected
As this is a new symbol declaration, it should not search for other symbols with same name.
Symbols present in stdlib should be available.
This would allow:
Could stdlib symbols be extracted from https://github.com/c3lang/c3c and be included in an internal table?
Describe the bug
Searching for symbol declaration (caused by a hover on symbol) crashes the server as it enters into an infinite loop.
To Reproduce
Steps to reproduce the behavior:
fn void System.init(System* system) {
}
init
Expected behavior
Should not crash, maybe even return null to client as we are hovering on the very same declaration.
Log
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module std::io
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module std::time
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module std::time::clock
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module std::thread
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module cpu
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] _findSymbolDeclarationInModule: search with fdcdd inside cpu file /path/src/cpu.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/cpu.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module cpu
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module inst
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] _findSymbolDeclarationInModule: search with fdcdd inside inst file /path/src/inst.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/inst.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module inst
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module debug
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] _findSymbolDeclarationInModule: search with fdcdd inside debug file /path/src/debugger/debug.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/debugger/debug.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module debug
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module raylib
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module libc
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module io
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] _findSymbolDeclarationInModule: search with fdcdd inside io file /path/src/io.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/io.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module io
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module ppu
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] _findSymbolDeclarationInModule: search with fdcdd inside ppu file /path/src/ppu.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/ppu.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module ppu
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module lcd
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] _findSymbolDeclarationInModule: search with fdcdd inside lcd file /path/src/lcd.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/lcd.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module lcd
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module raylib
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module input
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] _findSymbolDeclarationInModule: search with fdcdd inside input file /path/src/input.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/input.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module input
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module raylib
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module serial
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] _findSymbolDeclarationInModule: search with fdcdd inside serial file /path/src/serial.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/serial.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module serial
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module apu
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] _findSymbolDeclarationInModule: search with fdcdd inside apu file /path/src/apu.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/apu.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module apu
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/audio/sweep.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module apu::sweep
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module types
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] _findSymbolDeclarationInModule: search with fdcdd inside types file /path/src/types.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/types.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module types
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/audio/square.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module apu::square
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module apu::lengthduty
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] _findSymbolDeclarationInModule: search with fdcdd inside apu::lengthduty file /path/src/audio/lengthduty.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/audio/lengthduty.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module apu::lengthduty
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/apu.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module apu
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module std::io
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module std::thread
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module types
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] _findSymbolDeclarationInModule: search with fdcdd inside types file /path/src/types.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/types.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module types
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module system
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] _findSymbolDeclarationInModule: search with fdcdd inside system file /path/src/system.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/system.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module system
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module std::time
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module std::time::clock
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module cpu
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] _findSymbolDeclarationInModule: search with fdcdd inside cpu file /path/src/cpu.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/cpu.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module cpu
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module inst
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] _findSymbolDeclarationInModule: search with fdcdd inside inst file /path/src/inst.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/inst.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module inst
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module debug
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] _findSymbolDeclarationInModule: search with fdcdd inside debug file /path/src/debugger/debug.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/debugger/debug.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module debug
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module raylib
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module libc
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module io
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] _findSymbolDeclarationInModule: search with fdcdd inside io file /path/src/io.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/io.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module io
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module ppu
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] _findSymbolDeclarationInModule: search with fdcdd inside ppu file /path/src/ppu.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/ppu.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module ppu
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module lcd
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] _findSymbolDeclarationInModule: search with fdcdd inside lcd file /path/src/lcd.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/lcd.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module lcd
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module raylib
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module input
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] _findSymbolDeclarationInModule: search with fdcdd inside input file /path/src/input.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/input.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module input
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module raylib
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module cart
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] _findSymbolDeclarationInModule: search with fdcdd inside cart file /path/src/cart.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/cart.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module cart
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module mappers
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] _findSymbolDeclarationInModule: search with fdcdd inside mappers file /path/src/mappers/mapper.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/mappers/mapper.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module mappers
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/mappers/mcb3.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module mappers::mcb3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module types
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] _findSymbolDeclarationInModule: search with fdcdd inside types file /path/src/types.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/types.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module types
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module cart
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] _findSymbolDeclarationInModule: search with fdcdd inside cart file /path/src/cart.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/cart.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module cart
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module system
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] _findSymbolDeclarationInModule: search with fdcdd inside system file /path/src/system.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/system.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module system
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module std::io
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module std::time
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module std::time::clock
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module std::thread
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module cpu
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] _findSymbolDeclarationInModule: search with fdcdd inside cpu file /path/src/cpu.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/cpu.c3
2024/05/04 19:01:17.925 DEBUG [C3-LSP.parser] Checking module cpu
2024/05/04 19:01:17.926 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration: search in imported module inst
2024/05/04 19:01:17.926 DEBUG [C3-LSP.parser] _findSymbolDeclarationInModule: search with fdcdd inside inst file /path/src/inst.c3
2024/05/04 19:01:17.926 DEBUG [C3-LSP.parser] findClosestSymbolDeclaration on doc /path/src/inst.c3
2024/05/04 19:01:17.926 DEBUG [C3-LSP.parser] Checking module inst
Stack
runtime stack:
runtime.throw({0x10494a69c?, 0x104793ae4?})
/usr/local/go/src/runtime/panic.go:1077 +0x40 fp=0x16b69aac0 sp=0x16b69aa90 pc=0x10479b570
runtime.newstack()
/usr/local/go/src/runtime/stack.go:1107 +0x458 fp=0x16b69ac70 sp=0x16b69aac0 pc=0x1047b57d8
traceback: unexpected SPWRITE function runtime.morestack
runtime.morestack()
/usr/local/go/src/runtime/asm_arm64.s:316 +0x70 fp=0x16b69ac70 sp=0x16b69ac70 pc=0x1047cb8e0
goroutine 4 [GC scavenge wait]:
runtime.gopark(0x12cfa22?, 0x11d4e87?, 0x0?, 0x0?, 0x0?)
/usr/local/go/src/runtime/proc.go:398 +0xc8 fp=0x1400004bf50 sp=0x1400004bf30 pc=0x10479e2c8
runtime.goparkunlock(...)
/usr/local/go/src/runtime/proc.go:404
runtime.(*scavengerState).park(0x104c5c820)
/usr/local/go/src/runtime/mgcscavenge.go:425 +0x5c fp=0x1400004bf80 sp=0x1400004bf50 pc=0x10478873c
runtime.bgscavenge(0x0?)
/usr/local/go/src/runtime/mgcscavenge.go:658 +0xac fp=0x1400004bfb0 sp=0x1400004bf80 pc=0x104788cfc
runtime.gcenable.func2()
/usr/local/go/src/runtime/mgc.go:201 +0x28 fp=0x1400004bfd0 sp=0x1400004bfb0 pc=0x10477fbb8
runtime.goexit()
/usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x1400004bfd0 sp=0x1400004bfd0 pc=0x1047cddd4
created by runtime.gcenable in goroutine 1
/usr/local/go/src/runtime/mgc.go:201 +0xac
...
goroutine 37 [GC worker (idle)]:
runtime.gopark(0x54cebd4ab9f73?, 0x3?, 0xdc?, 0x5?, 0x0?)
/usr/local/go/src/runtime/proc.go:398 +0xc8 fp=0x14000325f30 sp=0x14000325f10 pc=0x10479e2c8
runtime.gcBgMarkWorker()
/usr/local/go/src/runtime/mgc.go:1295 +0xd8 fp=0x14000325fd0 sp=0x14000325f30 pc=0x1047815e8
runtime.goexit()
/usr/local/go/src/runtime/asm_arm64.s:1197 +0x4 fp=0x14000325fd0 sp=0x14000325fd0 pc=0x1047cddd4
created by runtime.gcBgMarkStartWorkers in goroutine 21
/usr/local/go/src/runtime/mgc.go:1219 +0x28
[Info - 19:01:19] Connection to server got closed. Server will restart.
true
[Error - 19:01:19] Server process exited with code 2.
2024/05/04 19:01:19.739 INFO [C3-LSP.server] reading from stdin, writing to stdout
findClosestSymbolDeclaration
is checking first in implicit module (both parent and child) before checking in already loaded document.
Should check first in current document as it will usually be shorter than checking the whole chain of implicit imports.
Describe the bug
Hovering over any language keyword, make the server crash
To Reproduce
Steps to reproduce the behavior:
¿Does this happens with any symbol that cannot be found?
Expected behavior
Should ignore language keywords.
Make sure it does not breaks when a symbol cannot be found also.
2024/05/04 21:58:24.122 DEBUG [C3-LSP.rpc] jsonrpc2: --> request #1: textDocument/hover: {"position":{"character":4,"line":11},"textDocument":{"uri":"file:///path/src/cart.c3"}}
2024/05/04 21:58:24.122 DEBUG [C3-LSP.server] normalized path:/path/src/cart.c3
2024/05/04 21:58:24.122 DEBUG [C3-LSP.server] HOVER requested on 6726 157
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] | findClosestSymbolDeclaration on doc /path/src/cart.c3
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] | Checking module "cart"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] | findClosestSymbolDeclaration: search in imported module "types"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |_ findSymbolDeclarationInModule: search symbols in module "types" file "/path/src/types.c3"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |__ findClosestSymbolDeclaration on doc /path/src/types.c3
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |__ Checking module "types"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |_ end searching symbols in module "types" file "/path/src/types.c3"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] | findClosestSymbolDeclaration: search in imported module "system"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |_ findSymbolDeclarationInModule: search symbols in module "system" file "/path/src/system.c3"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |__ findClosestSymbolDeclaration on doc /path/src/system.c3
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |__ Checking module "system"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |__ findClosestSymbolDeclaration: search in imported module "std::io"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |__ findClosestSymbolDeclaration: search in imported module "std::time"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |__ findClosestSymbolDeclaration: search in imported module "std::time::clock"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |__ findClosestSymbolDeclaration: search in imported module "std::thread"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |__ findClosestSymbolDeclaration: search in imported module "cpu"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |___ findSymbolDeclarationInModule: search symbols in module "cpu" file "/path/src/cpu.c3"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |____ findClosestSymbolDeclaration on doc /path/src/cpu.c3
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |____ Checking module "cpu"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |____ findClosestSymbolDeclaration: search in imported module "inst"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |_____ findSymbolDeclarationInModule: search symbols in module "inst" file "/path/src/inst.c3"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |______ findClosestSymbolDeclaration on doc /path/src/inst.c3
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |______ Checking module "inst"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |_____ end searching symbols in module "inst" file "/path/src/inst.c3"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |____ findClosestSymbolDeclaration: search in imported module "debug"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |_____ findSymbolDeclarationInModule: search symbols in module "debug" file "/path/src/debugger/debug.c3"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |______ findClosestSymbolDeclaration on doc /path/src/debugger/debug.c3
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |______ Checking module "debug"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |______ findClosestSymbolDeclaration: search in imported module "raylib"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |______ findClosestSymbolDeclaration: search in imported module "libc"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |_____ end searching symbols in module "debug" file "/path/src/debugger/debug.c3"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |___ end searching symbols in module "cpu" file "/path/src/cpu.c3"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |__ findClosestSymbolDeclaration: search in imported module "io"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |___ findSymbolDeclarationInModule: search symbols in module "io" file "/path/src/io.c3"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |____ findClosestSymbolDeclaration on doc /path/src/io.c3
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |____ Checking module "io"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |___ end searching symbols in module "io" file "/path/src/io.c3"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |__ findClosestSymbolDeclaration: search in imported module "ppu"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |___ findSymbolDeclarationInModule: search symbols in module "ppu" file "/path/src/ppu.c3"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |____ findClosestSymbolDeclaration on doc /path/src/ppu.c3
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |____ Checking module "ppu"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |___ end searching symbols in module "ppu" file "/path/src/ppu.c3"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |__ findClosestSymbolDeclaration: search in imported module "lcd"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |___ findSymbolDeclarationInModule: search symbols in module "lcd" file "/path/src/lcd.c3"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |____ findClosestSymbolDeclaration on doc /path/src/lcd.c3
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |____ Checking module "lcd"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |____ findClosestSymbolDeclaration: search in imported module "raylib"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |___ end searching symbols in module "lcd" file "/path/src/lcd.c3"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |__ findClosestSymbolDeclaration: search in imported module "input"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |___ findSymbolDeclarationInModule: search symbols in module "input" file "/path/src/input.c3"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |____ findClosestSymbolDeclaration on doc /path/src/input.c3
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |____ Checking module "input"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |____ findClosestSymbolDeclaration: search in imported module "raylib"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |___ end searching symbols in module "input" file "/path/src/input.c3"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |__ findClosestSymbolDeclaration: search in imported module "cart"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |___ findSymbolDeclarationInModule: search symbols in module "cart" file "/path/src/cart.c3"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |____ findClosestSymbolDeclaration on doc /path/src/cart.c3
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |____ Checking module "cart"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |____ findClosestSymbolDeclaration: search in imported module "mappers"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |_____ findSymbolDeclarationInModule: search symbols in module "mappers" file "/path/src/mappers/mapper.c3"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |______ findClosestSymbolDeclaration on doc /path/src/mappers/mapper.c3
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |______ Checking module "mappers"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |________ findClosestSymbolDeclaration on doc /path/src/mappers/mcb5.c3
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |________ Checking module "mappers::mcb5"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |________ findClosestSymbolDeclaration: search in imported module "types"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |________ findSymbolDeclarationInModule: search symbols in module "types" file "/path/src/types.c3"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |________ findClosestSymbolDeclaration on doc /path/src/types.c3
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |________ Checking module "types"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |________ end searching symbols in module "types" file "/path/src/types.c3"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |________ findClosestSymbolDeclaration: search in imported module "cart"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |________ findSymbolDeclarationInModule: search symbols in module "cart" file "/path/src/cart.c3"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |________ findClosestSymbolDeclaration on doc /path/src/cart.c3
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |________ Checking module "cart"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |________ findClosestSymbolDeclaration: search in imported module "system"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |________ findSymbolDeclarationInModule: search symbols in module "system" file "/path/src/system.c3"
2024/05/04 21:58:24.122 DEBUG [C3-LSP.parser] |________ findClosestSymbolDeclaration on doc /path/src/system.c3
@align @benchmark @BigEndian @Builtin
@cdecl @deprecated @dynamic @export
@extern @extname @inline @interface
@LittleEndian @Local @maydiscard @naked
@NODISCARD @noinit @noinline @NoReturn
@nostrip @obfuscate @operator @Overlap
@PACKED @priority @Private @public
@pure @reflect @section @stdcall
@test @unused @used @veccall
@wasm @weak @winmain
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.