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

Functions and throw statements are underlined even if caught #71

Closed
thedevbirb opened this issue Dec 14, 2023 · 1 comment · Fixed by #81
Closed

Functions and throw statements are underlined even if caught #71

thedevbirb opened this issue Dec 14, 2023 · 1 comment · Fixed by #81
Labels
bug Something isn't working

Comments

@thedevbirb
Copy link

Description of the issue

As title says, even if a function has a single throw statement that is properly catched, the plugin underlines both the throw statement and the function. Calls to such function results in hints provided by the plugin too.

This can lead a lot of verbose LSP hints even in a relatively small codebase.

Example of the issue

Consider this simple code snippet:

function A() {
  try {
    throw new Error();
  } catch {}
}

function B() {
    A();
}

Here is how the LSP handles such code:
image

Expected/Desired behaviour

Given that the function A in the example does not have uncaught errors, I'd expect to not receive any LSP hint at all.

System information

If needed, here are my machine specs:

Version: 1.85.1
Commit: 0ee08df0cf4527e40edc9aa28f4b5bd38bbff2b2
Date: 2023-12-13T09:47:11.635Z
Electron: 25.9.7
ElectronBuildId: 25551756
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Linux x64 6.6.6-100.fc38.x86_64
@thedevbirb thedevbirb changed the title Functions and throw statements are underlined even if catched Functions and throw statements are underlined even if caught Dec 14, 2023
@michaelangeloio michaelangeloio added enhancement New feature or request bug Something isn't working and removed enhancement New feature or request labels Dec 16, 2023
@michaelangeloio
Copy link
Owner

@lorenzofero done! Please re-open if you find any edge cases!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants