marlonfan / coc-phpls

🐭 php language server for coc.nvim
MIT License
212 stars 16 forks source link

Premium intelephense features not working with key #40

Closed elle-the-dev closed 4 years ago

elle-the-dev commented 4 years ago

Premium intelephense features are resulting in provider not found for current document when using intelephense version 1.3.2.

The key is my only config setting

{
    "intelephense.licenceKey": "[key is here]"
}

The features are working in vscode, so I know it's no the licence key itself.

Here is my :CocInfo

## versions

vim version: NVIM v0.4.3
node version: v10.15.3
coc.nvim version: 0.0.74-d83536aa4e
term: xterm
platform: linux

## Messages[coc.nvim] Rename provider not found for current document
[coc.nvim] Type definition provider not found for current document
[coc.nvim] Implementation provider not found for current document

## Output channel: phpls
[Info  - 1:35:58 PM] Initialising intelephense 1.3.2
[Info  - 1:35:58 PM] Reading state from /home/derek/.config/coc/extensions/coc-phpls-data/1938e530.
[Info  - 1:35:59 PM] Initialised in 1375 ms
[Info  - 1:35:59 PM] Intelephense 1.2.3

I am using version 2.1.2 of coc-phpls according to ~/.config/coc/extensions/node_modules/coc-phpls/package.json.

marlonfan commented 4 years ago

@derekhamilton please add to your coc-settings.json file

Norbytus commented 4 years ago

I have similar problem, in coc-setings.json i write my key

elle-the-dev commented 4 years ago

if you mean include my coc-settings.json that's this

{
    "intelephense.licenceKey": "[key is here]"
}

Key redacted for obvious reasons. No other information in there. If I set intelephense to v1.3.1 it will work, but with 1.3.2 it doesn't.

Norbytus commented 4 years ago

I have intelephense v1.3.3

marlonfan commented 4 years ago

@derekhamilton @Norbytus Please give me time to check

marlonfan commented 4 years ago

https://github.com/bmewburn/intelephense-docs/issues/12

I think it has something to do with that.

I will fix it.

cprn commented 4 years ago

@derekhamilton @Norbytus How do you bump Intelephense version?

elle-the-dev commented 4 years ago

@cprn The intelephense install exists on Linux under

~/.config/coc/extensions/node_modules/coc-phpls/node_modules/intelephense

At time of writing phpls has in its package.json intelephense in the dependencies as "intelephense": "^1.2.3" meaning if the packages are updated it'll update to the latest minor version (1.3.3)

I have my package.json set to "intelephense": "1.3.1" for now while this gets patched.

cprn commented 4 years ago

@derekhamilton I modified package.json but calling :CocUpdateSync in vim doesn't bump the package. :CocInfo still says it initialised Intelephense 1.2.3.

Sorry, I didn't mean to hijack the thread. I thought it was a single comment question.

elle-the-dev commented 4 years ago

@cprn I'm not completely sure about updating from within vim. If using vim-plug, :PlugUpdate might do it (haven't tested), but you can run npm update intelephense inside ~/.config/coc/extensions/node_modules/coc-phpls/node_modules/intelephense to make it update.

marlonfan commented 4 years ago

New version released, Is it possible to solve your problem?

marlonfan commented 4 years ago

@derekhamilton You seem to have two LSP servers?

[Info  - 1:35:58 PM] Initialising intelephense 1.3.2
[Info  - 1:35:58 PM] Reading state from /home/derek/.config/coc/extensions/coc-phpls-data/1938e530.
[Info  - 1:35:59 PM] Initialised in 1375 ms
[Info  - 1:35:59 PM] Intelephense 1.2.3
Norbytus commented 4 years ago

## versions

vim version: NVIM v0.5.0-dev
node version: v13.3.0
coc.nvim version: 0.0.74-d83536aa4e
term: xterm-256color
platform: linux

## Messages[coc.nvim] intelephense indexing ...
[coc.nvim] Indexed php files, times: 195ms
[coc.nvim] Error on 'jumpImplementation': Cannot read property 'start' of undefined

## Output channel: highlight
[Info  - 8:43:29 AM] Highlight server running in node v13.3.0

## Output channel: phpls
[Info  - 8:43:34 AM] Initialising intelephense 1.3.4
[Info  - 8:43:34 AM] Reading state from /home/alex-star/.config/coc/extensions/coc-phpls-data/1c3ad3f6.
[Info  - 8:43:36 AM] Initialised in 1779 ms
[Info  - 8:43:36 AM] Intelephense 1.2.3
[Info  - 8:43:37 AM] Indexing started.
[Info  - 8:43:37 AM] Indexing ended. 2 files indexed in 0s.
[Info  - 8:43:37 AM] Writing state to /home/alex-star/.config/coc/extensions/coc-phpls-data/1c3ad3f6.
[Info  - 8:43:39 AM] Wrote state in 2.0s.

Whene try jump to implementation 'Error on 'jumpImplementation': Cannot read property 'start' of undefined'

marlonfan commented 4 years ago

@Norbytus

Because upstream protocols change frequently.

It has now been repaired.

Norbytus commented 4 years ago

Yes not it's work, thanks

marlonfan commented 4 years ago

@Norbytus Has the version been updated? latest version is 2.1.4

Norbytus commented 4 years ago

Yes

Norbytus commented 4 years ago

All works

cprn commented 4 years ago

This is kind of weird. I reinstalled nvim from scratch with coc and coc-phpls... and it looks like there are two intelephense instances with different versions running.

CocInfo:

## versions

vim version: NVIM v0.3.8
node version: v12.13.0
coc.nvim version: 0.0.74-bc017b02e6
term: screen-256color
platform: linux

## Messages
[coc.nvim] intelephense indexing ...
[coc.nvim] Indexed php files, times: 1509ms
[coc.nvim] intelephense indexing ...
[coc.nvim] Indexed php files, times: 15844ms
## Output channel: snippets

## Output channel: phpls

[Info  - 08:55:42] Initialising intelephense 1.3.4
[Info  - 08:55:42] Reading state from /home/mg/.config/coc/extensions/coc-phpls-data/674614e2.
[Info  - 08:55:42] Initialised in 9 ms
[Info  - 08:55:42] Intelephense 1.2.3
[Info  - 08:55:42] Indexing started.
[Info  - 08:55:43] Indexing ended. 98 files indexed in 1s.
[Info  - 08:55:43] Indexing started.
[Info  - 08:55:59] Indexing ended. 13883 files indexed in 15s.
[Info  - 08:55:59] Writing state to /home/mg/.config/coc/extensions/coc-phpls-data/674614e2.
[Info  - 08:56:01] Wrote state in 1.4s.

CocOpenLogs:

2019-12-13T08:55:41.702 INFO (pid:4582) [plugin] - coc 0.0.74-bc017b02e6 initialized with node: v12.13.0
2019-12-13T08:55:41.710 INFO (pid:4582) [language-client-index] - phpls started with 4631

Is this just a weird output or is that really an issue? I see the correct 1.3.4 versions mentioned in both package files and in the lock file:

$ cat .config/coc/extensions/node_modules/coc-phpls/package.json | grep phense\"
    "intelephense": "^1.3.4",
$ cat .config/coc/extensions/node_modules/coc-phpls/node_modules/intelephense/package.json | grep version
    "version": "1.3.4"
$ cat .config/coc/extensions/node_modules/coc-phpls/package-lock.json | grep intele
    "intelephense": {
        "resolved": "https://registry.npmjs.org/intelephense/-/intelephense-1.3.4.tgz",
marlonfan commented 4 years ago

@cprn Whether you have configured the languageserver option on your coc-setting.json?

Norbytus commented 4 years ago

I don't know why, but phpls index only opened filed instead all project as is was

marlonfan commented 4 years ago

@Norbytus maybe it has cached folder, you can use coc command intelephense.index.workspace to refresh it.

cprn commented 4 years ago

@marlonfan My coc-settings.json is almost empty:

{
    "intelephense.licenceKey": "***",
    "intelephense.files.exclude": ["var"]
}

Double indexing is normal, it's first indexing the current working directory and then the whole project. All the features of 1.3.4 are working fine - I can use typed properties, etc., and Intelephense doens't treat those as errors. I think "Intelephense 1.2.3" is just a bug in the logs. Doesn't it show in your :CocInfo as well?

marlonfan commented 4 years ago

@cprn i can't get this error

cprn commented 4 years ago

I didn't manage to find time to fully analyse it yet but this line:

[Info  - 08:55:42] Intelephense 1.2.3

Comes from lib/index.js:

const VERSION = '1.2.3';
// ...
languageClient.info('Intelephense ' + VERSION);

So neither I nor @derekhamilton have two LSP servers running.

marlonfan commented 4 years ago

@cprn fixed