Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSP selects the "wrong" location to display error message #747

Open
denismerigoux opened this issue Nov 12, 2024 · 2 comments
Open

LSP selects the "wrong" location to display error message #747

denismerigoux opened this issue Nov 12, 2024 · 2 comments
Assignees
Labels
🤩 ide IDE plugins and tooling ❓ invalid This doesn't seem right

Comments

@denismerigoux
Copy link
Contributor

Suppose the following error message in CLI :

┌─[ERROR]─
│
│  Field montant_après_CRDS does not belong to structure Commun.Droit
│
├─➤ src/hierarchisation.catala_fr:94.11-94.69:
│    │
│ 94 │           droit_final_af_majorées - prestation_af.montant_avant_crds
│    │           ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
├─ Brique 5 : hiérarchisation des prestations
│  └─ Règles à implémenter
│
│ Declaration of structure Commun.Droit
├─➤ src/commun.catala_fr:56.23-56.28:
│    │
│ 56 │ déclaration structure Droit:
│    │                       ‾‾‾‾‾
└─

When displayed with the LSP and VSCode extension, this error messages highlights Droit and the structure declaration instead of the place where the struct field access is. This bad choice of location for the LSP concern other error messages that display more than one code location.

@denismerigoux denismerigoux added ❓ invalid This doesn't seem right 🤩 ide IDE plugins and tooling labels Nov 12, 2024
@denismerigoux denismerigoux moved this from In Progress to Todo in Catala - language & tooling Nov 12, 2024
@denismerigoux
Copy link
Contributor Author

@vincent-botbol upping the priority of fixing this, it caused some confusion for @guillaumeFerard and I last Friday when debugging his code :)

@vincent-botbol
Copy link
Contributor

This one instance is strange, I got a consistent message on the catala's test file.
image

However, you're definitely right, in some instances, it would be useful to have multiple locations in some cases. We'll need to find a solution in the long term. For the short term, we can manually prioritize these locations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤩 ide IDE plugins and tooling ❓ invalid This doesn't seem right
Projects
Status: Todo
Development

No branches or pull requests

2 participants