Closed momala454 closed 2 weeks ago
Could you try disabling the showTypeOnHover
setting? Fairly certain that's what's causing this (and if it's not, it's probably your own configuration file)
yep it works with this disabled
Would you mind posting your config (maybe censored) so I can maybe figure out what's causing it?
includes:
- phpstan-baseline.neon #TODO disable
- phar://phpstan.phar/conf/bleedingEdge.neon
- vendor/phpstan/phpstan-strict-rules/rules.neon
- vendor/jbboehr/phpstan-laravel-validation/extension.neon
- vendor/cuyz/valinor/qa/PHPStan/valinor-phpstan-configuration.php
- vendor/larastan/larastan/extension.neon
parameters:
level: 10
treatPhpDocTypesAsCertain: true
editorUrl: 'vscode://file/%%file%%:%%line%%'
editorUrlTitle: '%%relFile%%:%%line%%'
paths:
- www
- app
- config
- database
- routes
- swagger
bootstrapFiles:
- www/includes/App.php
reportUnmatchedIgnoredErrors: false
checkImplicitMixed: true
reportMaybesInMethodSignatures: false
reportMaybesInPropertyPhpDocTypes: false
strictRules:
disallowedLooseComparison: true
booleansInConditions: false
uselessCast: true
requireParentConstructorCall: true
#disallowedConstructs: false
disallowedEmpty: false
overwriteVariablesWithLoop: true
closureUsesThis: true
matchingInheritedMethodNames: true
numericOperandsInArithmeticOperators: true
#strictCalls: true
switchConditionsMatchingType: true
noVariableVariables: false
strictArrayFilter: true
ignoreErrors:
- '#Dynamic call to static method Symfony\\Component\\HttpFoundation\\Response::.*#'
- '#Dynamic call to static method Illuminate\\Http\\Request::validate\(\).#'
I encountered the same problem, with remote development. I found that ~/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.14/_config/xxxxxxxxxxxxxxxxxxxx/config.neon
(which is referred from -c
) causes the error. Executing phpstan from terminal with the same args to the vscode extension raises same error, but running without -c ~/.vscode-server/(...)/config.neon
works fine.
config.neon
is like below:
includes:
# Replaced with location of user file when used
- /home/xxxxx/path/to/repo/phpstan.neon.dist
rules:
- PHPStanVSCodeTreeFetcher
parameters:
# Don't complain when a non-included file is checked
- zeroFiles: false
# Use a custom cacheDir so that the transformed-args and
# default args don't clear each others' caches.
tmpDir: /home/xxxxx/.vscode-server/extensions/sanderronde.phpstan-vscode-3.2.14/_config/xxxxxxxxxxxxxxxxxxxx/cache
Note that in my case disabling showTypeOnHover
doesn't solve the problem.
Ah I know what this is, it's due to the recent 2.0 upgrade, will fix this
Also disabling showTypeOnHover
should fix the issue, if it doesn't then it's likely your own config causing the problem. Check out what config is being used by checking the logs. (could be that it didn't register the disabling)
Thank you, it's working fine now
Actually, show type on hover does not work anymore, it doesn't tooltip the type
Hmm probably an obvious question but are you sure it's enabled? And if so do you see anything in the logs?
Could be that PHPStan 2.0 broke it though, in that case I'd need to fix it.
[11/14/2024, 9:14:30 AM] [client] Starting extension with configuration: {
"phpstan.singleFileMode": false,
"phpstan.binPath": "vendor/bin/phpstan",
"phpstan.binCommand": [],
"phpstan.configFile": "phpstan.neon,phpstan.neon.dist,phpstan.dist.neon",
"phpstan.paths": {},
"phpstan.dockerContainerName": "",
"phpstan.rootDir": "",
"phpstan.options": [],
"phpstan.enableStatusBar": true,
"phpstan.memoryLimit": "1G",
"phpstan.enabled": true,
"phpstan.projectTimeout": 300000,
"phpstan.timeout": 300000,
"phpstan.suppressTimeoutMessage": false,
"phpstan.showProgress": false,
"phpstan.showTypeOnHover": true,
"phpstan.enableLanguageServer": false,
"phpstan.ignoreErrors": [
"Xdebug: .*"
],
"phpstan.suppressWorkspaceMessage": false,
"phpstan.pro": false,
"phpstan.tmpDir": "",
"phpstan.checkValidity": false
}
("phpstan.showTypeOnHover": true,
)
When I hover, it shows
[11/14/2024, 9:14:48 AM] [fixer-manager] No file changes, not checking
[11/14/2024, 9:14:49 AM] [file-watcher] Checking: Hover action
[11/14/2024, 9:14:49 AM] [fixer-manager] No file changes, not checking
[11/14/2024, 9:14:50 AM] [file-watcher] Checking: Hover action
[11/14/2024, 9:14:50 AM] [fixer-manager] No file changes, not checking
[11/14/2024, 9:14:51 AM] [file-watcher] Checking: Hover action
[11/14/2024, 9:14:51 AM] [fixer-manager] No file changes, not checking
Found the issue, it's something that changed from PHPStan 2 being bleeding edge to it no longer being bleeding edge. Will release the fix soon (somewhere today, will let you know)
Published the fix in version 3.2.16
thank you!
appeared recently