Better LSP error handling

This commit is contained in:
Martino Ferrari
2026-01-27 08:58:38 +01:00
parent aedc715ef3
commit 71a3c40108
5 changed files with 94 additions and 17 deletions

View File

@@ -5,7 +5,6 @@ import (
"path/filepath"
"strings"
"github.com/marte-community/marte-dev-tools/internal/logger"
"github.com/marte-community/marte-dev-tools/internal/parser"
)
@@ -456,9 +455,7 @@ type QueryResult struct {
}
func (pt *ProjectTree) Query(file string, line, col int) *QueryResult {
logger.Printf("File: %s:%d:%d", file, line, col)
for i := range pt.References {
logger.Printf("%s", pt.Root.Name)
ref := &pt.References[i]
if ref.File == file {
if line == ref.Position.Line && col >= ref.Position.Column && col < ref.Position.Column+len(ref.Name) {