-
Notifications
You must be signed in to change notification settings - Fork 660
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
NodeDataProvider empty in LSP #3216
Comments
Hey @joehoyle, can you reproduce the issue on https://psalm.dev ? |
No, I don’t believe I can include my custom plugin on psalm.dev
…--
Joe Hoyle
CTO
Human Made
On Thu, Apr 23 2020 at 15:58, psalm-github-bot[bot] < ***@***.*** > wrote:
Hey @joehoyle ( https://github.com/joehoyle ) , can you reproduce the issue
on https://psalm.dev ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub (
#3216 (comment) ) , or unsubscribe
(
https://github.com/notifications/unsubscribe-auth/AABHPE6HC2XZHEO63TYRDBLROBCRHANCNFSM4MPCBNTQ
).
|
@joehoyle I'd use the (more-recently-added) |
@muglug Thanks! I'll give that a go, will re-open if I see the same issue there. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a custom plugin that makes use of the
Psalm\Internal\Provider\NodeDataProvider
for some custom return type logic viaAfterFunctionCallAnalysisInterface
.As I understand it,
afterFunctionCallAnalysis
is passed an expression, where I'm looking at the type of the second param on a function call. That second param is of typePhpParser\Node\Name
.afterFunctionCallAnalysis
needs to providereturn_type_candidate
with aUnion
containing that type. However, the "type" I get from theFuncCall
expression is thePhpParser
type.I had been using
StatementsSource::getNodeTypeProvider::getType()
which appears to be able to map a PhpParser expression or node name to a Psalm Type. This works well when runningpsalm
from the command line.However, when running via the LSP, it seems that the
StatementsSource::getNodeTypeProvider->node_types
is an empty SplObjectStorage object. Perhaps this is to do with how the file contents is passed to the LSP, and given (perhaps) that file is in memory rather than on-disk, then there's some different behavior where the current file does not appear to be tokenized (or something!).Could anyone provide me some guidance on why the LSP behavior I'm seeing here is different from the Psalm CLI. Thanks!
The text was updated successfully, but these errors were encountered: