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

Branches should be ignored when #170

Open
stephanlachnit opened this issue Jan 7, 2025 · 2 comments
Open

Branches should be ignored when #170

stephanlachnit opened this issue Jan 7, 2025 · 2 comments

Comments

@stephanlachnit
Copy link

Describe the bug

Code branches are checked even though they should never be executed since there is a subdir_done() call before. This is better understood with the reproducer below

To Reproduce

A simple meson project with a build option build_gui that is a combo with none, qt5 and qt6. If build_gui is none, then the subdir is skipped. Otherwise, this option is used to import the corresponding Qt module. See screenshot.

The LSP gives a warning about Unkown module 'none', which obviously can't be true since that case is excluded.

Expected behavior

The LSP should recognize that the branch with none as options is never executed in the file.

Screenshots/Screencasts

Screenshot From 2025-01-07 14-34-03

System info

  • OS: Linux (Flatpak)
  • Editor: Zed v0.167.2 via Flathub with zed-meson v0.2.0
  • Version: latest GitHub release (v4.3.7)
@JCWasmx86
Copy link
Owner

I have to be honest, but I think the analysis code is at the moment not even remotely as far as that. It would probably require rewriting the entire analysis.

@stephanlachnit
Copy link
Author

stephanlachnit commented Jan 13, 2025

Is it possible to ignore warnings from a line? I.e.

qt = import(qt_version) # mesonlsp: ignore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants