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

Che 7 plugin: Update PHP Intelephense to the latest available version >=v.1.1.1 - 2019-06-27? #13700

Closed
vrubezhny opened this issue Jul 4, 2019 · 12 comments
Labels
area/languages Issues related to Language extensions or plugins integration. status/blocked Issue that can’t be moved forward. Must include a comment on the reason for the blockage.
Milestone

Comments

@vrubezhny
Copy link
Contributor

Description

A new version of PHP Intelephense - v.1.1.1 - is released. It has few interesting additions and improvements comparing to v.1.0.14 (that is currently used as latest plugin included to Che7 plugins registry):

[1.1.1 - 2019-06-27, 1.1.0 - 2019-06-27]
Added

    Support for PhpDoc intersection types, generic collections, variadic notation, default param args
    File path completion
    Support PHPStorm metadata
    Support .jsbeautifyrc file in project root
    Setting to enable/disable triggering param hints on completion intelephense.completion.triggerParameterHints
    Setting to run server with alternate node runtime intelephense.runtime
    Setting to control server memory usage intelephense.maxMemory
    Setting to declare document root intelephense.environment.documentRoot
    Setting to declare include paths intelephense.environment.includePaths
    Global scoped variable completion/hover/definition
    Client now webpacked.
    Plain text documentation support.

Changed

    updated stubs
    fast-glob 3
    Improved type inferrence when using asserts, instanceof (negation too), and built in function type guards
    improved keyword completion
    x2+ increase in indexing speed

Fixed

    Group use declaration formatting
    Range formatting with mixed php/html files
    Formatting removing comments
    False undefined var diagnostics in closures
    Completion not working in anon class argument lists
    Wrong closure signature when inspecting closures that return closures.
    Error when indexing workspace with NTFS junctions
    Auto add group use declaration adding name with backslash
    Unused method diagnostics not considering traits
    Obey LSP client capabilities
    Index workspace now guaranteed to clear cache.
    Various read prop of undefined errors.
    Diagnostics/signature help using overidden base constructor signature.

It looks interesting to be included to Che7 PHP Language Support

@tsmaeder tsmaeder added this to the 7.0.0 milestone Jul 4, 2019
@tsmaeder tsmaeder added the area/languages Issues related to Language extensions or plugins integration. label Jul 4, 2019
@tsmaeder
Copy link
Contributor

tsmaeder commented Jul 4, 2019

I would argue to do this update for Che 7. There are a number of interesting improvements and the risk is relatively low: worst case, people can go back to the version of the plugins we have now.

@tsmaeder tsmaeder modified the milestones: 7.0.0, 7.1.0 Jul 5, 2019
@tsmaeder
Copy link
Contributor

tsmaeder commented Jul 5, 2019

Changed my mind, it's not strictly necessary, so defer.

@tsmaeder tsmaeder mentioned this issue Jul 25, 2019
20 tasks
@danidoedel
Copy link

Current version is 1.1.5 with many bug fixes.

@vrubezhny vrubezhny changed the title Che 7 plugin: Update PHP Intelephense to v.1.1.1 - 2019-06-27? Che 7 plugin: Update PHP Intelephense to the latest available version >=v.1.1.1 - 2019-06-27? Aug 1, 2019
@vrubezhny
Copy link
Contributor Author

vrubezhny commented Aug 7, 2019

The versions v1.1.1 - v1.1.5 do not work on theia-ide:che-7.0.0 branch (which currently is used for Che7), because of wide usage of workspace configuration which is not fully supported.

[Trace - 9:28:37 PM] Received request 'workspace/configuration - (1)'.
Params: {
    "items": [
        {
            "section": "intelephense"
        },
        {
            "section": "intelephense",
            "scopeUri": "file:///home/jeremy/projects/che/phptest"
        }
    ]
}
[Trace - 9:28:37 PM] Sending response 'workspace/configuration - (1)'. Processing request took 6ms
Result: [
    null,
    null
]
(node:24459) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'telemetry' of null
    at Object.t.getDeepObjectValue (/tmp/vscode-unpacked/vscode-intelephense-client-1.1.5.vsix/extension/node_modules/intelephense/lib/intelephense.js:40:53770)
    at G (/tmp/vscode-unpacked/vscode-intelephense-client-1.1.5.vsix/extension/node_modules/intelephense/lib/intelephense.js:53:23488)
    at D (/tmp/vscode-unpacked/vscode-intelephense-client-1.1.5.vsix/extension/node_modules/intelephense/lib/intelephense.js:53:21568)
    at Object.<anonymous> (/tmp/vscode-unpacked/vscode-intelephense-client-1.1.5.vsix/extension/node_modules/intelephense/lib/intelephense.js:53:26668)
    at Generator.next (<anonymous>)
    at o (/tmp/vscode-unpacked/vscode-intelephense-client-1.1.5.vsix/extension/node_modules/intelephense/lib/intelephense.js:53:20564)

...

[Trace - 9:28:51 PM] Sending notification 'textDocument/didOpen'.
Params: {
    "textDocument": {
        "uri": "file:///home/jeremy/projects/che/phptest/test1.php",
        "languageId": "php",
        "version": 1,
        "text": "<?php\n\n$db = new PDO;\n$stmt = $db->prepare('SELECT * FROM users WHERE id = ?');\n$stmt->execute([1]);\n\n$text = 'new Str';\n\nvar_dump($stmt->fetchAll());\n\nfunction var_dump(mixed $statement) {\n    echo $statement;\n}\n\nfunction fff() {}\n\n/**\n * @param int $i G f p o\n * @param bool $b D f p\n */\nfunction foo(int $i, bool $b = false) {}\n\n/**\n * @param int $i G f p o\n * @param bool $b D f p\n * @param Test|null ...$things T t\n */\nfunction fooo(int $i, bool $b = false, Test ...$things ) {}\n\nfooo(123, true, new Test());\n\nfff();\n\n\n"
    }
}
[Trace - 9:28:51 PM] Received notification 'window/logMessage'.
Params: {
    "type": 1,
    "message": "Notification handler 'textDocument/didOpen' failed with message: Cannot read property 'files' of null"
}
[Error - 9:28:51 PM] Notification handler 'textDocument/didOpen' failed with message: Cannot read property 'files' of null

I believe these errors are result of lack of support of workspace configuration by Theia which is required in following call examples (https://github.com/bmewburn/vscode-intelephense/blob/master/src/middleware.ts#L278):

        let vscodeAssociations = workspace.getConfiguration('files').get('associations') || { };
...
        let vscodeExclude = workspace.getConfiguration('files', resourceUri || null).get('exclude') || { };
...
        v.telemetry.enabled = workspace.getConfiguration('telemetry').get('enableTelemetry');

@vrubezhny
Copy link
Contributor Author

For master branch we have pretty the same problem. It starts working until the plugin asks for the configuration, then fails:

[Trace - 3:06:48 PM] Sending response 'workspace/configuration - (1)'. Processing request took 7ms
Result: [
    null,
    null
]
(node:31346) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'files' of null
    at Object.t.getDeepObjectValue (/tmp/vscode-unpacked/vscode-intelephense-client-1.1.4.vsix/extension/node_modules/intelephense/lib/intelephense.js:40:88018)
    at X (/tmp/vscode-unpacked/vscode-intelephense-client-1.1.4.vsix/extension/node_modules/intelephense/lib/intelephense.js:53:10077)
    at Object.<anonymous> (/tmp/vscode-unpacked/vscode-intelephense-client-1.1.4.vsix/extension/node_modules/intelephense/lib/intelephense.js:53:13127)
    at Generator.next (<anonymous>)
    at o (/tmp/vscode-unpacked/vscode-intelephense-client-1.1.4.vsix/extension/node_modules/intelephense/lib/intelephense.js:53:6813)
(node:31346) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:31346) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

After this failure, there is no hovers/content assist return by the LS.

The only version which works on both theia master and che-7.0.0 branches is v.1.0.14 (probably because it doesn't use workspace configuration that much)

@tsmaeder tsmaeder mentioned this issue Aug 14, 2019
24 tasks
@vrubezhny
Copy link
Contributor Author

The issues created to track 'files' and 'telemetry' workspace configuration properties support: eclipse-theia/theia#5945, eclipse-theia/theia#5944

@theBeautifier
Copy link

It seems like the current version of Intelephense which Che is using isn‘t working anymore.
It starts with the workspace but isn‘t functioning at all. There is just nothing running.

@ghost
Copy link

ghost commented Aug 23, 2019

@theBeautifier I can confirm that, this happens since Intelephense 1.2.0 was released. The Intelephense che plugin endpoint returns only "Upgrade required" now. It would be awesome if 1.2.0 could be supported, especially the new premium version :)

@tsmaeder tsmaeder mentioned this issue Aug 29, 2019
41 tasks
@tsmaeder tsmaeder mentioned this issue Sep 24, 2019
30 tasks
@tsmaeder
Copy link
Contributor

Blocked by eclipse-theia/theia#5945

@tsmaeder tsmaeder added the status/blocked Issue that can’t be moved forward. Must include a comment on the reason for the blockage. label Sep 24, 2019
@tsmaeder tsmaeder mentioned this issue Oct 11, 2019
26 tasks
@tsmaeder tsmaeder mentioned this issue Oct 31, 2019
25 tasks
@mikizdr
Copy link

mikizdr commented Jan 15, 2020

Hello.
I'm using VSC editor and Intelephense v1.3.7 but strange things happens.
In my Laravel project I'm getting this error in api.php file for Route facade: Undefined type "Route" (regardless everything works fine). Or for public function.... it reports error: Unexpected public.

Anyone experienced the same issue.

Thanks

@ericwill
Copy link
Contributor

ericwill commented Jul 2, 2020

Hello.
I'm using VSC editor and Intelephense v1.3.7 but strange things happens.
In my Laravel project I'm getting this error in api.php file for Route facade: Undefined type "Route" (regardless everything works fine). Or for public function.... it reports error: Unexpected public.

Anyone experienced the same issue.

Thanks

Can you try with the latest Che (7.15)? We have vscode-intelephense 1.3.11 now.

@nickboldt nickboldt modified the milestones: 7.1.0, 7.20 Sep 17, 2020
@ericwill
Copy link
Contributor

ericwill commented Oct 1, 2020

No response in awhile and we have Intelephense version 1.5.4 now. If you face an issue against that version of the plugin, please file a new issue.

@ericwill ericwill closed this as completed Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/languages Issues related to Language extensions or plugins integration. status/blocked Issue that can’t be moved forward. Must include a comment on the reason for the blockage.
Projects
None yet
Development

No branches or pull requests

7 participants