Giter Club home page Giter Club logo

yaegassy / coc-intelephense Goto Github PK

View Code? Open in Web Editor NEW
92.0 92.0 4.0 675 KB

intelephense (PHP language server) extension for coc.nvim. intelephense’s various LSP features and this extension's additional features are available.

Home Page: https://www.npmjs.com/package/@yaegassy/coc-intelephense

License: MIT License

JavaScript 2.28% TypeScript 94.75% PHP 2.96%
artisan coc coc-extensions coc-nvim composer intelephense laravel lsp neovim pest php phpunit vim

coc-intelephense's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

coc-intelephense's Issues

How to use this package with coposer created project. ?

I know this can be silly to ask but necessary.

AS VIM user can start editing any system file from the tabedit *.php file from any location.
So here i am facing issue that autocomplete not fetching library class , method or any variable of it. So how to deal with it

i tried folllowing things.

(1) got to project root and start vim , Result :- only work with imported autoload file only
(2) go to different file where there is no autoload included then it will failed to work

Please guide me how to work in both cases. Thanks in advance. @yaegassy

CocUpdate failed @types/node version not found

 verbose cwd /Users/beke/.config/coc/extensions/node_modules/@yaegassy_coc-intelephense-8b155473-dacf-48a9-af59- 
d63de268
 verbose Darwin 22.3.0
 verbose node v19.8.0
 verbose npm  v9.5.1
 error code ETARGET
 error notarget No matching version found for @types/node@^18.15.5.
 error notarget In most cases you or one of your dependencies are requesting
 error notarget a package version that doesn't exist.
 verbose exit 1
 timing npm Completed in 3515ms
 verbose unfinished npm timer reify 1679997523418
 verbose unfinished npm timer reify:loadTrees 1679997523421

npm list -g

/usr/local/lib
├── @bchatard/[email protected]
├── @prettier/[email protected]
├── @types/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]

coc-intelephense reindex every files at each lauch

I'm used to work on php project with coc-phpls extension and, after discovering coc-intelephense, tried to switch on this extension. I noticed a different behaviour concerning the indexing:

With coc-phpls extension, when launching vim in a projet for the first time it take a long time for intelephense to index every file but afterward when closing and launching again vim, intelephense only reindex files with a timestamp more recent than then cached file.
But when using coc-intelephense, each time I launch vim on a project, every files got scanned like if the cached index was not used.

here are the output of :CocCommand workspace.showOutput :

vim with coc-phpls launch on a project for the first time or with coc-phpls-data deleted (indexed in 7s)

[Info  - 13:42:43.235] Initialising intelephense 1.9.5
[Info  - 13:42:43.244] Reading state from /home/shad/.config/coc/extensions/coc-phpls-data/268c77a5.
[Info  - 13:42:43.257] Initialised in 25 ms
[Info  - 13:42:43.388] Environment changed. Refreshing 1 in memory documents.
[Info  - 13:42:43.433] Searching file:///home/shad/.config/coc/extensions/node_modules/coc-phpls/node_modules/intelephense/lib/stub for files to index.
[Info  - 13:42:43.516] Searching file:///home/shad/Work/test for files to index.
[Info  - 13:42:43.981] Indexing started.
[Info  - 13:42:51.585] Indexing ended. 3789 files indexed in 7s.
[Info  - 13:42:51.586] Writing state to /home/shad/.config/coc/extensions/coc-phpls-data/268c77a5.
[Info  - 13:42:52.087] Wrote state in 0.5s.

vim with coc-phpls launch on the same project for the second time without modifying any file (indexed in 753ms)

Info  - 13:41:51.233] Initialising intelephense 1.9.5
[Info  - 13:41:51.239] Reading state from /home/shad/.config/coc/extensions/coc-phpls-data/268c77a5.
[Info  - 13:41:51.983] Initialised in 753 ms
[Info  - 13:41:52.141] Searching file:///home/shad/.config/coc/extensions/node_modules/coc-phpls/node_modules/intelephense/lib/stub for files to index.
[Info  - 13:41:52.230] Searching file:///home/shad/Work/test for files to index.

vim with coc-phpls launch on the same project for the second time after changing the timestamp of one php file in the project (indexed in 0s)

[Info  - 14:02:15.731] Reading state from /home/shad/.config/coc/extensions/coc-phpls-data/268c77a5.
[Info  - 14:02:16.304] Initialised in 586 ms
[Info  - 14:02:16.415] Searching file:///home/shad/.config/coc/extensions/node_modules/coc-phpls/node_modules/intelephense/lib/stub for files to index.
[Info  - 14:02:16.469] Searching file:///home/shad/Work/test for files to index.
[Info  - 14:02:16.973] Indexing started.
[Info  - 14:02:17.167] Indexing ended. 1 files indexed in 0s.
[Info  - 14:02:17.168] Writing state to /home/shad/.config/coc/extensions/coc-phpls-data/268c77a5.
[Info  - 14:02:17.666] Wrote state in 0.5s.

vim with coc-intelephense launch on a project for the first time or with @yaegassy/coc-intelephense-data deleted (indexed in 8s)

[Info  - 13:46:04.543] Initialising intelephense 1.9.5
[Info  - 13:46:04.557] Initialised in 17 ms
[Info  - 13:46:04.650] Environment changed. Refreshing 1 in memory documents.
[Info  - 13:46:04.675] Searching file:///home/shad/.config/coc/extensions/node_modules/%40yaegassy/coc-intelephense/node_modules/intelephense/lib/stub for files to index.
[Info  - 13:46:04.738] Searching file:///home/shad/Work/test for files to index.
[Info  - 13:46:05.198] Indexing started.
[Info  - 13:46:13.285] Indexing ended. 3789 files indexed in 8s.
[Info  - 13:46:13.287] Writing state to /home/shad/.config/coc/extensions/@yaegassy/coc-intelephense-data/d491580.
[Info  - 13:46:13.797] Wrote state in 0.5s.

vim with coc-intelephense launch on the same project for the second time without modifying any file or changing timestamp of only one php file (indexed in 7s)

[Info  - 13:40:32.849] Initialising intelephense 1.9.5
[Info  - 13:40:32.866] Initialised in 21 ms
[Info  - 13:40:32.958] Environment changed. Refreshing 1 in memory documents.
[Info  - 13:40:32.990] Searching file:///home/shad/.config/coc/extensions/node_modules/%40yaegassy/coc-intelephense/node_modules/intelephense/lib/stub for files to index.
[Info  - 13:40:33.057] Searching file:///home/shad/Work/test for files to index.
[Info  - 13:40:33.519] Indexing started.
[Info  - 13:40:40.772] Indexing ended. 3789 files indexed in 7s.
[Info  - 13:40:40.775] Writing state to /home/shad/.config/coc/extensions/@yaegassy/coc-intelephense-data/d491580.
[Info  - 13:40:41.279] Wrote state in 0.5s.

The rename symbol feature loads modified buffers but doesn't show them.

After I renamed a class, a popup dialog asked me '2 documents on disk would be loaded for change, confirm? (y/n)?'

When I pressed y, I could see that 2 modified buffers were loaded in the background, but they were not shown in any tabs or split windows. If I quit vim, it will ask me to confirm whether to save these buffers.

But I want to check whether those changes are correct before saving, this behavior makes it difficult to do that.

Can the modified buffers be opened in new tabs?

Help on snippets / autocompletion

First of all I like to give you a big applause for making all the magic possible. You've made my life so much easier!!!

I've noticed that there are some snippets available within this plugin. But I couldn't find a way to customize these.
E.G. I want to add some of my own without grabbing another snippet plugin.
Can you push me in the right direction?
Big thanks

How to confirm change rename action in different file (not loaded in buffer)?

Hi thanks for making the plugin, I enjoy it a lot.
I ran into 1 issue however. Renaming methods of classes that are already used in other files AND are not currently loaded into a buffer seems to not work.

image

When I rename this to something else I get this floating text that asks me to confirm, any idea how to do that?

image

intelephense.licenceKey works but licence.txt does not.

I moved the licence key from coc-settings.json to $HOME/intelephense/licence.txt, but the class importing feature was disabled immediately after that. When I recovered the option in coc-settings.json, it works again.

coc-intelephense is the newest version 0.18.2.

How to run diagnostics for the entire project?

Currently, the diagnostics are only run for the opened buffers, I know it is a performance concern. But sometimes it is still needed to run diagnostics for the entire project. Is it possible to have a command for this?

Unable to install WSL2/ Ubuntu 20.04

Ran :CocInstall @yaegassy/coc-intelephense

Using npm from: /usr/local/bin/npm
Get info from https://registry.npmjs.org/
Downloading from https://registry.npmjs.org/@yaegassy/coc-intelephense/-/coc-intelephense-0.9.4.tgz
Download progress 7.0%
Download progress 18.7%
Download progress 30.3%
Download progress 42.0%
Download progress 53.7%
Download progress 65.4%
Download progress 77.1%
Download progress 88.8%
Download progress 100.0%
Extension download at /tmp/nvimFreoHL/@yaegassy-coc-intelephense-t3AmS2
Installing dependencies by: /usr/local/bin/npm install --ignore-scripts --no-lockfile --production --legacy-peer-deps.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN [email protected] requires a peer of @types/[email protected] but none is installed. You must install peer dependencies yourself.

npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path /tmp/nvimFreoHL/@yaegassy-coc-intelephense-t3AmS2/node_modules/lodash
npm ERR! dest /tmp/nvimFreoHL/@yaegassy-coc-intelephense-t3AmS2/node_modules/.lodash.DELETE
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, rename '/tmp/nvimFreoHL/@yaegassy-coc-intelephense-t3AmS2/node_modules/lodash' -> '/tmp/nvimFreoHL/@yaegassy-coc-intelephense-t3AmS2/node_modules/.lodash.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/kris/.npm/_logs/2021-11-04T17_04_06_119Z-debug.log
/usr/local/bin/npm install exited with 254

git init required for laravel projects?

I installed coc-phpls and didn't work (got Undefined types and other errors) then I installed this extension and worked but I noticed that it worked because I initialized my laravel project as a git repo. Then I tried coc-phpls on a project which was also initialized as a git repo and it also worked so this is more of a question rather than an issue. Is it required to have laravel projects initialized as git repos in order for intelephense to "index" or recognize laravel's types, functions, etc?

Also. Nice work! I really like the extension as it seems that other extension have been abandoned. Thanks!

Problems with indexing on larger projects? (Connection to server got closed)

Any idea what could possible go wrong here? Intelephense seems to break on larger projects. When I enter a smaller workspace everything works. But if i enter a project on a higher level it fails after a few second trying to index with: [coc.nvim] Connection to server got closed. Server will not be restarted.

Even after waiting for a few hours it wont stop indexing, I assume it just failed.

image

Could iskeyword dollar be configurable?

I have traced my issue around to lines

await workspace.nvim.command('setlocal iskeyword+=$');

There, the plugin is setting iskeyword dollar sign to +=$, which is exact opposite of what I prefer, I would like it to be -=$ to keep the dollar sign in place.

Is this there because of some other functionality depends on it or is this just an author's preference?

How to disable/override/configure this behavior please?

intelephense.diagnostics.typeErrors does not appear to work

intelephense.diagnostics.typeErrors: Enables diagnostics on type compatibility of arguments, property assignments, and return statements where types have been declared, default: true

In the following sample code no diagnostic error is generated:

    public function test(string $arg): int
    {
        return 'test';
    }

@intelephense-ignore-line does not work

It seems that this feature
#16
does not work for me
When I trigger CocAction I don't see this option, and adding it manually does not really turn the warning off.
I'm using neovim v0.7.0
and
✓ @yaegassy/coc-intelephense Current version 0.18.2 is up to date.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.