Closed mindriven closed 1 year ago
Are they underlined in yellow?
Are they underlined in yellow?
Some are warnings, some errors if that's what you're asking. And severity and count seems to be changing with changing level in settings file.
Edit: I'm the author of the issue, just now on mobile with another account.
The reason I ask is because most issues should be reported to the main repo. All this repo does is track the plug-in which really doesn't do much.
If you have a reproducible example and can go report it on the main repo then please do that. You can reference me there and they will assign it to me
so I thought, thanks, to avoid confusion can you point me out to the right repo, then? Thanks in advance!
Also are you 100% sure these are coming from psalm. Many of the other php extensions also report errors
:-) sure as it gets, I have filtered using "psalm" as phrase. I will attempt so create a simple example repo to illustrate the problem... or find solution attempting to do so...
Baseline does not hide issues completely, their severity is just lowered to INFO
. And INFO
issues are not shown by default by Psalm's cli tool (you can still display them by passing --show-info=true
flag).
From what I see here those issues are reported to LSP client: https://github.com/vimeo/psalm/blob/bfce3a41e458efd92422a107c8d45f6b65707172/src/Psalm/Internal/LanguageServer/LanguageServer.php#L376-L384
@tm1000 is there an option to hide warnings from certain language servers, either in the extension or VSCode itself?
My investigation suggests that @weirdan's suspicion is correct. I created this simple repository https://github.com/mindriven/vscode-psalm-testing
in VSCode it looks like this:
When executing vendor/bin/psalm
I get:
Warning: "findUnusedBaselineEntry" will be defaulted to "true" in Psalm 6. You should explicitly enable or disable this setting.
Warning: "findUnusedCode" will be defaulted to "true" in Psalm 6. You should explicitly enable or disable this setting.
Target PHP version: 8.1 (inferred from current PHP version) Enabled extensions: .
Scanning files...
Analyzing files...
------------------------------
No errors found!
------------------------------
3 other issues found.
You can display them with --show-info=true
------------------------------
Checks took 0.00 seconds and used 4.563MB of memory
No files analyzed
Psalm was able to infer types for 0.0000% of the codebase
When I add --show-info=true
I get:
Warning: "findUnusedBaselineEntry" will be defaulted to "true" in Psalm 6. You should explicitly enable or disable this setting.
Warning: "findUnusedCode" will be defaulted to "true" in Psalm 6. You should explicitly enable or disable this setting.
Target PHP version: 8.1 (inferred from current PHP version) Enabled extensions: .
Scanning files...
Analyzing files...
INFO: MixedAssignment - src/fileWithErrors.php:2:1 - Unable to determine the type that $a is being assigned to (see https://psalm.dev/032)
$a
INFO: UnusedVariable - src/fileWithErrors.php:2:1 - $a is never referenced or the value is not used (see https://psalm.dev/077)
$a
INFO: UndefinedGlobalVariable - src/fileWithErrors.php:2:6 - Cannot find referenced variable $something_that_does_not_exist in global scope (see https://psalm.dev/127)
$a = $something_that_does_not_exist
------------------------------
No errors found!
------------------------------
3 other issues found.
------------------------------
Checks took 0.01 seconds and used 4.564MB of memory
No files analyzed
Psalm was able to infer types for 0.0000% of the codebase
@tm1000 in this case, I would expect that "errors" should become "infos"
or if not possible to not be shown at all. This would make adoption in "challenging" codebase easier. What do you think?
After reading a bit I understood that the link from @weirdan was actually pointing to the right place where this would need to be changed. I will open an issue there,
@weirdan The option is in my Wip pr
However this seems two-fold. I also need to implement finish instead of clear is that correct?
Closing as the work was done in: https://github.com/vimeo/psalm/pull/8960
First of all thank you for the plugin and psalm at large, really nice! I am trying to introduce it to a legacy code base in one of my teams that is using VScode. I have generated a baseline and when I am using psalm CLI it's obviously working - no errors anywhere. But VSCode still shows a lot of "problems". This makes me assume that baseline file is getting ignored. How can I ignore the VSCode "problems" that already captured in the baseline?![image](https://user-images.githubusercontent.com/4957654/214059111-28bb6fa9-e3e6-44cc-86a8-2111fac1b9d2.png)