-
Notifications
You must be signed in to change notification settings - Fork 4
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
Got 'Called initialized on language server, currently a no-op' on a previously working project after some modification #55
Comments
That's because you set phan.enableDebug to true while setting it up. You should set that to false normally. This option is slow and verbose, and only should be used if debugging the extension. It deliberately logs a lot of information to stderr. |
Hi, Thanks for the quick reply. Forgot to mention that I don't have any output under 'Problems' nor tooltips. |
Did 0.8.2 work? What's the filename and extension of the file that failed to be analyzed? E.g. do .php files work? I'm assuming site-root-dir was in the CLI options and you omitted it. |
Also, Phan doesn't automatically restart it you change the configuration (e.g. user configuration especially). So it may be running, but on a different directly. - check in process explorer if that is the case. There are open tickets for that. Also, you can set up multiple independent Phan instances by providing an array to analyzed project directory. This may use up a lot of memory due the servers running independently. |
Hi, Even 0.8.3 works with my previous (inconvenient) configuration. Please let me know how can I clarify the issue even more. |
|
I've analyzing a WordPress site with plugins and everything, yes, this has been worked before. |
I'm able to see this issue with a file with the suffix
|
As far as I'm concerned, this directive should be more than enough (
|
And if I change my vscode phan client configuration, I can analyze files with html extensions again.:
I'd agree that it'd be useful to do that, but the vscode client doesn't do that |
Related to #55 Will investigate later
Will continue looking into this later tonight I tried reverting the upgrade to npm dependencies, but that didn't seem to help. The issue with Maybe the extensions check is case sensitive, but I doubt it's that. Is the file you're analyzing a |
No, there are no |
Can you attach a full screenshot of the VS code window with a file that should be analyzed that isn't? |
Oops! We're getting there... So I've modified the path to be analyzed (because I cannot post the source, sorry) and it works with a different dir to be analyzed. So it's something(?) in the other folder. How can I get more debug info in the devtools? |
Setting phan.enableDebug to true is usually as much info as possibly needed. If you don't see anything in one directory, that may be because didChange events and didSave events aren't being sent by this client (the library it uses) Any special characters in the other folder? Did you exclude a directory from analysis? Phan had a recent change to limit emitting warnings just to the files to be analyzed, it could be that |
Also, the phan language server had a bug where it would analyze files not included in the
It's possible that what you're seeing is a symptom of that changing. (Then again, I don't think I've fixed that yet) It could also be an issue normalizing the paths on Windows (e.g.
https://github.com/phan/phan/blob/1.2.2/NEWS.md
|
Do you have any workspace settings in that other folder (or it's parent folders), e.g. in |
// Optional (Advanced). If provided, this overrides the Phan script to use, e.g. `/path/to/phan_git_checkout/phan`. (Modifying requires restart)
"phan.phanScriptPath": null, If you want to check if your issues are caused by upgrading the server with 0.8.3 of this extension, you can download phan.phar for Phan 1.2.1 and point
|
This is what I'm seeing in the debug log: Phan Language Server starts without any errors (see original post) Next, I'm seeing an error in the log twice (formatted for readability):
Then I'm getting this:
where
Opening a file from under
No matter how much I limit On the other hand, if I set |
No exclusions defined (yet), and I'm using Yes, there are some other If I'm using a previous version of Phan, we're getting back to this issue (which is interesting, because you fixed that in a previous version already). |
Okay, it looks like the conversion to |
Just updated to
Is this expected? |
Maybe it's unrelated, but I'm still getting errors from the languageserver itself:
The accompanying message:
|
Yes, it's a different issue. Does the language server work other than that? Dispatcher.php calls json_decode, and passes it to JsonMapper. It turns out not to expect a regular associative array, and either expects no reflection type or a named class reflection type. didChangeConfiguration is a no-op, so it's easy enough to fix the log by removing the real type.
That's from a newer version of php-advanced-json-rpc, but the old one was equivalent - checking for ReflectionNamedType just avoids deprecation notices and bugs with nullable |
Aside: There were a few recent fixes to directory handling on windows since February, including
|
Hi @TysonAndre, Thank you very much for your response. Yes, Phan works from CLI, but not with VSCode. |
Also, removing typehint from signature of |
I'm also seeing the same error in didChangeConfiguration, but the language server continues running normally for me anyway, so I don't think didChangeConfiguration is the cause of the issue. Is the site root directory something really short, like C:\app? Does it include the drive? Does it end with a slash (I don't know if that'd matter, I usually don't do that). Are you using forward or backwards slashes in the configured root directory? |
This is the directory I'm trying to analyze in the IDE:
|
And what's the full directory in the directory_list (with forward or backward slashes) in It may be a bug in the language server normalizing slashes, since the testing on Windows was done with a single part directory, not a multi part directory with slashes |
The config is placed under
|
Maybe this is more about phan itself again.
I have many Bedrock-enabled WordPress websites where I used to configure each plugin independently across different sites which resulted in a mess in my custom configuration in VSCode, so I went and tried to abstract my configuration to the site root and configure each directory to analyze there (may be not the best use case).
Setup:
config.php
has been created with phan's--init
command, and it contains only one directory to analyze. It works fine when running it via cli.VSCode settings'
phan.analyzedProjectDirectory
points to<site-root-dir>
(above), I see no errors during startup:But, when opening a file in the analyzed directory, I'll get the following message:
I saw that this comes straight from phan, but since it works fine in cli I posted this here instead.
I'm on Windows 10, VSCode is 1.30.2, PHP-Phan is 0.8.3.
Please let me know if you need more details.
The text was updated successfully, but these errors were encountered: