Giter Site home page Giter Site logo

coc-phpls's Introduction

  • An engineer hired by @HUPU
  • Years of development experience with Go.
  • Open source maniac, projects include : coc-phpls
  • Currently working on dubbo-go.

marlon's github stats

coc-phpls's People

Contributors

dependabot[bot] avatar fannheyward avatar jacks0n avatar jaghaimo avatar jonleopard avatar lewissteele avatar marlonfan avatar radmen avatar yaegassy avatar

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

coc-phpls's Issues

renaming feature doesn't save modifications

Hi,
when renaming a variable using
nmap <leader>rn <Plug>(coc-rename)

after renaming the various buffers affected by the changes are not saved.
I can't get evidence of the modification using git (status)

Function text object is including opening brace

Describe the bug

I am not exactly sure whether this is an issue with coc-phpls or intelephense.

I have added the following configuration for enabling the function text object. But when I try to select inside a function with vif, the opening brace is included with the selection.

If the opening brace is on the same line as the function header, then it is working correctly.

" Create mappings for function text object, requires document symbols feature of languageserver.
xmap if <Plug>(coc-funcobj-i)
xmap af <Plug>(coc-funcobj-a)
omap if <Plug>(coc-funcobj-i)
omap af <Plug>(coc-funcobj-a)

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
Screenshot 2020-02-19 at 6 31 41 PM
Screenshot 2020-02-19 at 6 31 20 PM

Desktop (please complete the following information):

  • OS: OSX
  • Version: NVIM v0.4.3

Configure PHP warnings/errors

Hi.

Not sure if I'm right here but I feel like I need to start somewhere: I installed this extension to enable coc for PHP files. Due to the nature of the project, there are a few unused private static properties in the classes. Is there a way, to configure what to warn or show errors about?

Thanks in advance, appreciate the effort you take.

Reindex on new file creation

Describe the bug
I'm not sure if this is a bug, configurable option, intended behavior, or a planned feature, but it seems like when a new php file is created you have to close and reopen vim in order to get it indexed. Is there a way to autoindex new files, or at least force a reindex with a command?

CocAction timeout after 30 seconds when jumping to definition / finding references, which are in the same buffer

Jump to definition only works after a 30 seconds timeout when jumping to a definition which is defined in the same buffer.

To Reproduce

  1. Create a php file, define class Foo
  2. Defined 2 methods: Foo::caller() and Foo::callee()
  3. Call callee from Foo::caller... i.e. $this->callee()
  4. Place a cursor on callee inside Foo::caller method, use coc's goto definition to jump to callee
  5. Experience tranquility for 30 seconds, which results into correct definition jump, btw.
  6. Note, this kind of behaviour only takes effect if a symbol that is being jumped to is in the same buffer.

Expected behavior
Goto definition shouldn't end up in a 30 seconds timeout.

Videos
asciicast

asciicast

Desktop

  • macOS Catalina (10.15.1)
  • iTerm2 (3.3.6)
  • vim (8.2, 2019 Dec 12, compiled Mar 27 2020 12:11:13, Included patches: 1-450, Compiled by Homebrew)
  • node (v12.16.1)
  • intelephense (1.3.11)

coc-settings.json

{
  "list.normalMappings": {
    "<C-c>": "do:exit"
  },
  "list.insertMappings": {
    "<C-c>": "do:exit"
  },
  "intelephense.telemetry.enabled": false
}

~/.config/coc/extensions/package.json contents:

{
  "dependencies": {
    "coc-phpls": ">=2.1.8"
  }
}

Additional information

Using CocActionAsync solves the problem.

When goto definition is triggered for a none-async action, whole vim "freezes" for the duration of 30 seconds before the timeout happens.

:CocOpenLog right after the problem occurs gives:

2020-04-14T14:51:19.757 INFO (pid:16453) [language-client-index] - phpls started with 16468
2020-04-14T14:51:19.769 INFO (pid:16453) [plugin] - coc 0.0.78-fc983ce6dd initialized with node: v12.16.1

Temporary solution:

"nmap <silent> <leader>gd <Plug>(coc-definition)
nmap <silent> <leader>gd :call CocActionAsync('jumpDefinition')<CR>
" nmap <silent> <leader>gr <Plug>(coc-references)
nmap <silent> <leader>gr :call CocActionAsync('jumpReferences')<CR>

Excessive underscores and duplicate backslashes in documenation popup

I see many _ around parameter or namespace names and duplicate \ in my hover or documentation popups:

coc_underscore

Expected

  • app\tasks\Task::__construct
  • @param array $config

Actual

  • __app\\tasks\\Task::\_\_construct__
  • _@param_ array $config

LSP response

[Trace - 11:04:05 AM] Received response 'textDocument/hover - (2)' in 9ms.
Result: {
    "contents": {
        "kind": "markdown",
        "value": "__app\\\\tasks\\\\Task::\\_\\_construct__\n\n```php\n<?php\npublic function __construct($config = []) { }\n```\n\n_@param_ `array $config`  \nobject configuration. The special key 'options' can\ncontain immutable options that will override default options from\n[[options()]]. Options can be fetched from [[getOption()].\n\n_@return_ `void`\n\n_@throws_ `yii\\base\\InvalidConfigException` — if an unknown option is passed"
    },
    "range": {
        "start": {
            "line": 406,
            "character": 20
        },
        "end": {
            "line": 406,
            "character": 31
        }
    }
}

Versions

vim version: NVIM v0.5.0-506-gda6f38ab3
node version: v10.20.1
coc.nvim version: 0.0.78-0033e4e624
term: screen-256color
platform: linux

I don't know if this is a problem of intelephense, coc.nvim or this extension. Any help welcome.

Premium intelephense features not working with key

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.

find implementations feature

i'm using coc.nvim with coc-phpls and when i'm trying to use the find implementation feature on a interface symbol using

nmap <silent> gi <Plug>(coc-implementation)

I receive this message

[coc.nvim] Error on 'jumpImplementation': Cannot read property 'start' of undefined

Add option for configure intelephense

Add option for configure intelephense, like setting maximum file size for indexing, default stubs, file exclude...

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

{
    "intelephense.files.maxSize": {
        "type": "number",
        "default": 1000000,
        "description": "Maximum file size in bytes.",
        "scope": "window"
    },
    "intelephense.files.associations": {
        "type": "array",
        "default": [
            "*.php",
            "*.phtml"
        ],
        "description": "Configure glob patterns to make files available for language server features.",
        "scope": "window"
    },
    "intelephense.files.exclude": {
        "type": "array",
        "default": [],
        "description": "Configure glob patterns to exclude certain files and folders from all language server features.",
        "scope": "window"
    },
    "intelephense.stubs": {
        "type": "array",
        "default": [
            "apache",
            "bcmath",
            "bz2",
            "calendar",
            "com_dotnet",
            "Core",
            "csprng",
            "ctype",
            "curl",
            "date",
            "dba",
            "dom",
            "enchant",
            "exif",
            "fileinfo",
            "filter",
            "fpm",
            "ftp",
            "gd",
            "hash",
            "iconv",
            "imap",
            "interbase",
            "intl",
            "json",
            "ldap",
            "libxml",
            "mbstring",
            "mcrypt",
            "mssql",
            "mysql",
            "mysqli",
            "oci8",
            "odcb",
            "openssl",
            "password",
            "pcntl",
            "pcre",
            "PDO",
            "pdo_ibm",
            "pdo_mysql",
            "pdo_pgsql",
            "pdo_sqlite",
            "pgsql",
            "Phar",
            "posix",
            "pspell",
            "readline",
            "recode",
            "Reflection",
            "regex",
            "session",
            "shmop",
            "SimpleXML",
            "snmp",
            "soap",
            "sockets",
            "sodium",
            "SPL",
            "sqlite3",
            "standard",
            "superglobals",
            "sybase",
            "sysvmsg",
            "sysvsem",
            "sysvshm",
            "tidy",
            "tokenizer",
            "wddx",
            "xml",
            "xmlreader",
            "xmlrpc",
            "xmlwriter",
            "Zend OPcache",
            "zip",
            "zlib"
        ],
        "description": "Configure stub files for built symbols and common extensions. The default includes PHP core and all bundled extensions.",
        "scope": "window"
    },
    "intelephense.completion.insertUseDeclaration": {
        "type": "boolean",
        "default": true,
        "description": "Use declarations will be automatically inserted for namespaced classes, traits interfaces, functions, and constants.",
        "scope": "window"
    },
    "intelephense.completion.fullyQualifyGlobalConstantsAndFunctions": {
        "type": "boolean",
        "default": false,
        "description": "Global namespace constants and functions will be fully qualified (prefixed with a backslash).",
        "scope": "window"
    },
    "intelephense.format.enable": {
        "type": "boolean",
        "default": true,
        "description": "Enables formatting",
        "scope": "window"
    },
    "intelephense.trace.server": {
        "type": "string",
        "enum": [
            "off",
            "messages",
            "verbose"
        ],
        "default": "off",
        "description": "Traces the communication between client and server.",
        "scope": "window"
    }
}

Configurable cache path

I want to have system wide neovim plugins.

Setup

The global config belongs to root.

In /etc/xdg/nvim/init.vim I have

call plug#begin('/etc/xdg/nvim/plugged')    " Use a shared folder
Plug 'neoclide/coc.nvim', {'branch': 'release'}
call plug#end()           " required

" Config directory for CoC plugin
let g:coc_config_home = '/etc/xdg/nvim/coc'
let g:coc_data_home = '/etc/xdg/nvim/coc'

This makes the extension end up in /etc/xdg/nvim/coc/extensions/node_modules/coc-phpls/.

Problem

Only root can now work with coc, because it creates cache files in /etc/xdg/nvim/coc/extensions/coc-phpls-data/. Normal users don't have (and should not have) write permissions there.

# ls -l /etc/xdg/nvim/coc/extensions/coc-phpls-data/597539a9/
insgesamt 1828
-rw-r--r-- 1 root root      82 Mai 14 15:10 intelephense_data_1
-rw-r--r-- 1 root root   13482 Mai 14 15:10 intelephense_data_2
-rw-r--r-- 1 root root 1128647 Mai 14 15:10 intelephense_data_3
-rw-r--r-- 1 root root  710458 Mai 14 15:10 intelephense_data_4
-rw-r--r-- 1 root root    1635 Mai 14 15:10 intelephense_data_5
-rw-r--r-- 1 root root    2400 Mai 14 15:10 intelephense_data_6
-rw-r--r-- 1 root root       0 Mai 14 15:10 intelephense_data_7

Is there a configuration option to make this path configurable?

If not, can such an option be added? In best case this should default somewhere in the users's home directory.

Configurable auto phpdoc creation

A feature of intelephense is "Configurable auto phpdoc creation that infers return types and identifies thrown exceptions." Is there a way to call this via coc.nvim?

upstream bug: Intelephense 1.3.5+ hangs for 2 minutes when activating a license behind proxy

Describe the bug
On initialisation Intelephense fails after 2 minutes when trying to read the workspace state, even though at first it's empty. After timing out it properly re-indexes the project and saves its state. On next open it hangs again and this time doesn't write (probably because there are no changes). I just need a confirmation this isn't vim/coc-phpls related before I open an issue upstream.

To Reproduce
Steps to reproduce the behavior:

  1. Install vim
  2. Install coc.nvim
  3. Install coc-phpls
  4. Open any PHP project

Expected behavior
I expect Intelephense to load quickly, not hang while reading state and then timeout.

Screenshots
Related parts of :CocInfo output:

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

## Output channel: phpls
[Info  - 15:09:55] Initialising intelephense 1.3.5
[Info  - 15:09:55] Reading state from /home/user/.config/coc/extensions/coc-phpls-data/674614e2.
[Warn  - 15:12:06] undefined
[Info  - 15:12:06] Initialised in 130624 ms
[Info  - 15:12:06] Intelephense 1.2.3
[Info  - 15:12:06] Indexing started.
[Info  - 15:12:07] Indexing ended. 98 files indexed in 1s.
[Info  - 15:12:07] Indexing started.
[Info  - 15:12:22] Indexing ended. 10169 files indexed in 14s.
[Info  - 15:12:22] Writing state to /home/user/.config/coc/extensions/coc-phpls-data/674614e2.
[Info  - 15:12:23] Wrote state in 1.7s.

coc-settings.json:

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

Desktop (please complete the following information):

  • OS: Linux Ubuntu 18.04.3 4.15.0-72-generic
  • Version: coc-phpls: 2.1.4, Intelephense: 1.3.5

duplication in hover show docs and autocompletion

Describe the bug
Duplication in all information that showed from coc-phpls

nvim config:

"" PHP
call coc#add_extension('coc-phpls')
let g:coc_filetypes += ['php']

coc-settings.json:

{
  "languageserver": {
    "ccls": {
      "command": "ccls",
      "filetypes": ["c", "cpp", "objc", "objcpp"],
      "rootPatterns": [
        ".ccls",
        "compile_commands.json",
        ".vim/",
        ".git/",
        ".hg/"
      ],
      "initializationOptions": {
        "cacheDirectory": "/tmp/ccls"
      }
    },
    "intelephense": {
      "command": "intelephense",
      "args": ["--stdio"],
      "filetypes": ["php"],
      "initializationOptions": {
        "storagePath": "/tmp/intelephense"
      }
    }
  }
}

To Reproduce
Steps to reproduce the behavior:

  1. Install coc
  2. Install coc-phpls
  3. Install intelephense (npm i intelephense -g)
  4. try to autocomplete and/or show docs

Screenshots

image

Desktop (please complete the following information):

  • nvim 0.4.0
  • Mac OS X
  • coc.nvim version: 0.0.67
  • intelephense 1.0.14

Additional context
coc-go, coc-rls, and coc-python works well.

Start creates intelephense folder

When phpls starts, it creates a folder in $HOME directory named "intelephense".

Steps to reproduce the behavior:

  1. Open php file with nvim and coc-phpls extension activated.
  2. See new folder in your $HOME directory

Expected behavior
No new folder in $HOME directory, or an option to configure directory creation.

Desktop:

  • OS: Arch Linux
  • Version 2.0.7

Comments
Thank you for your work I love this extension and want to improve it but I don't know how to do it.

Index on workspace change

Hey!

I have a new problem, when I'm in vim and install php package with composer i must to restart vim, or restart language server with CocRestart for index package, but the problem is that every time everything is over indexing... It would be nice if this were resolved and some one added caching system. Thanks!

Again sorry for my very bad English... :D

Implement workspaceFilesIncludeGlob for watchman

Output channel: watchman

[Info - 2:19:30 PM] watchman watching project: /var/www/html
[Info - 2:19:30 PM] subscribing "{}" in /var/www/html
[Info - 2:19:30 PM] subscribing "**/*.{php,phtml}" in /var/www/html

  • Watchman only watch root directory of project no folders like vendor?

Error: Unhandled method indexWorkspace

Describe the bug
With the latest version of this extension, PHP workspaces are no longer being indexed.

To Reproduce
Steps to reproduce the behavior:

  1. Install latest version of coc.nvim and coc-phpls.
  2. Run intelephense.index.workspace through :CocCommand
  3. The error Error: Unhandled method indexWorkspace is shown

Expected behavior
Messages regarding workspace being indexed are shown.

Additional context
Running :CocOpenLog reveals (home directory path snipped):

2019-08-14T16:45:38.988 INFO (pid:33693) [services] - registed service "phpls"
2019-08-14T16:45:38.990 INFO (pid:33693) [services] - PHP Language Server state change: stopped => starting
2019-08-14T16:45:39.001 INFO (pid:33693) [language-client-index] - phpls started with 33696
2019-08-14T16:45:39.009 INFO (pid:33693) [plugin] - coc 0.0.73-e9ef666cb5 initialized with node: v12.6.0
2019-08-14T16:45:39.769 INFO (pid:33693) [services] - PHP Language Server state change: starting => running
2019-08-14T16:45:39.775 INFO (pid:33693) [services] - service phpls started
2019-08-14T16:45:45.315 ERROR (pid:33693) [commands] - Error: Unhandled method indexWorkspace
    at handleResponse (../nvim/plugged/coc.nvim/build/index.js:38047:48)
    at processMessageQueue (../nvim/plugged/coc.nvim/build/index.js:37874:17)
    at Immediate.<anonymous> (../nvim/plugged/coc.nvim/build/index.js:37858:13)
    at processImmediate (internal/timers.js:439:21)

Undefined functions, types, etc.

Describe the bug
It seems that the plugin is not able to find the definitions. I get all kind of undefined ... errors.
However the Intelephense plugin for VS Code works just fine. See screenshots.

To Reproduce
Steps to reproduce the behavior:

  1. Install Neovim and use my config and my coc-settings
  2. Install a regular Laravel Project and install and run barryvdh/laravel-ide-helper
  3. (optional) Install some other Packages (GraphQL or whatever you want)
  4. Use some stuff from the vendor folder, or even use some laravel functions like abort or app
  5. See the undefined messages

Expected behavior
I'd expect the functions and classes to be found ^^

Screenshots
Bildschirmfoto 2020-02-16 um 15 51 59
Bildschirmfoto 2020-02-16 um 15 52 41

Desktop

  • OS: macOS 10.15.3 / Linux Manjaro 18
  • NVIM v0.4.2

Bildschirmfoto 2020-02-16 um 16 10 34

内存泄漏 风扇不停转

versions

vim version: NVIM v0.4.3
node version: v13.5.0
coc.nvim version: 0.0.74-cd348f4905
term: iTerm.app
platform: darwin

Messages

[coc.nvim] Your Intelephense licence key has been activated.
[phpls] Undefined function 'main\array_slice'. [E]

[phpls] Undefined function 'main\array_slice'. [E]
[phpls] Undefined function 'main\array_slice'. [E]
[phpls] Undefined function 'main\array_slice'. [E]
[phpls] Undefined function 'main\array_slice'. [E]

Output channel: phpls

[Info - 6:43:12 PM] Initialising intelephense 1.3.6
[Info - 6:43:12 PM] Reading state from /Users/mrsong/.config/coc/extensions/coc-phpls-data/3c2c6bd6.
[Info - 6:43:13 PM] Initialised in 972 ms
[Info - 6:43:13 PM] Intelephense 1.2.3

<--- Last few GCs --->

[13253:0x104900000] 84371 ms: Mark-sweep 1950.8 (2067.2) -> 1937.2 (2063.9) MB, 618.9 / 0.0 ms (average mu = 0.243, current mu = 0.198) allocation failure scavenge might not succeed
[13253:0x104900000] 84429 ms: Scavenge 1951.1 (2063.9) -> 1938.8 (2065.4) MB, 5.0 / 0.0 ms (average mu = 0.243, current mu = 0.198) allocation failure
[13253:0x104900000] 84481 ms: Scavenge 1952.8 (2065.4) -> 1940.5 (2066.9) MB, 4.1 / 0.0 ms (average mu = 0.243, current mu = 0.198) allocation failure

<--- JS stacktrace --->

==== JS stack trace =========================================

0: ExitFrame [pc: 0x10074e5f9]

Security context: 0x1ee16f440921
1: split [0x1ee16f44d1a1](this=0x1ee172550159 <String[432]: Library/Application Support/Steam/Steam.AppBundle/Steam/Contents/Frameworks/Steam Helper.app/Contents/Frameworks/HTML5App.app/Contents/Frameworks/Steam Helper EH.app/Contents/Frameworks/Steam Helper.app/Contents/Frameworks/Steam Helper EH.app/Contents/Frameworks/HTML5App.app/Contents/Frameworks/Ste...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0x100b9f982 node::Abort() (.cold.1) [/usr/local/Cellar/node/13.5.0/bin/node]
2: 0x100084338 node::FatalError(char const*, char const*) [/usr/local/Cellar/node/13.5.0/bin/node]
3: 0x100084460 node::OnFatalError(char const*, char const*) [/usr/local/Cellar/node/13.5.0/bin/node]
4: 0x10017dfc1 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/Cellar/node/13.5.0/bin/node]
5: 0x10017df6b v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/Cellar/node/13.5.0/bin/node]
6: 0x100297f23 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/usr/local/Cellar/node/13.5.0/bin/node]
7: 0x1002992a8 v8::internal::Heap::MarkCompactPrologue() [/usr/local/Cellar/node/13.5.0/bin/node]
8: 0x100296e76 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/local/Cellar/node/13.5.0/bin/node]
9: 0x100295955 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/Cellar/node/13.5.0/bin/node]
10: 0x10029d2f4 v8::internal::Heap::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/Cellar/node/13.5.0/bin/node]
11: 0x10029d34a v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/Cellar/node/13.5.0/bin/node]
12: 0x10027a04a v8::internal::Factory::New(v8::internal::Handlev8::internal::Map, v8::internal::AllocationType) [/usr/local/Cellar/node/13.5.0/bin/node]
13: 0x10027d9f1 v8::internal::Factory::NewProperSubString(v8::internal::Handlev8::internal::String, int, int) [/usr/local/Cellar/node/13.5.0/bin/node]
14: 0x100501e73 v8::internal::Runtime_StringSplit(int, unsigned long*, v8::internal::Isolate*) [/usr/local/Cellar/node/13.5.0/bin/node]
15: 0x10074e5f9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/usr/local/Cellar/node/13.5.0/bin/node]
16: 0x10073c402 Builtins_StringPrototypeSplit [/usr/local/Cellar/node/13.5.0/bin/node]
[Info - 6:44:37 PM] Connection to server got closed. Server will restart.
[Info - 6:44:37 PM] Initialising intelephense 1.3.6
[Info - 6:44:37 PM] Reading state from /Users/mrsong/.config/coc/extensions/coc-phpls-data/3c2c6bd6.
[Info - 6:44:37 PM] Initialised in 9 ms

wrong completion

hello 🤚

first of all i really ❤️ this project, its such a lightweight PHPLS

but i am struggeling getting it to work in my day-to-day php-fight.

example:

$var = "test";

if i type $va it suggests $var - selecting and confirming it with

changes $va to $$var - and additionally adds a newline sometimes

any ideas how i can get around this?

snippet argument expansion w/placeholders

When I expand a snippet from coc-phpls, I expect it to present argument placeholders like in this demo from the coc.nvim readme:

This seems to work out of the box with coc-tsserver, but with coc-phpls it just completes the function name and gives me an empty ():

phpls

Is this a known limitation of this project, or of intelephense? Or do I have something set up wrong? Thanks!

Info Request

Can you please explain me what is the difference (or benefits) on using this extension instead of using intelephense globally installed via npm.
In the coc.nvim wiki page( language servers sections), I see that for PHP the options are this extension or to use the bmewburn/intelephense-docs (or even php-language-server) but I couldn't understand which one is better and why since both are using intelephense.
Thanks

全局变量提示??

问下,coc-phpls 是否支持显示 $_GET, $_POST, $_FILES 这类全局变量的提示??

Cannot find module 'tslib'

Describe the bug

[coc.nvim]Error on load extension coc-phpls from /home/zdm/.config/coc/extensions/node_modules/coc-phpls/l
ib/index.js: Error: Cannot find module 'tslib'
Require stack:

  • /home/zdm/.config/coc/extensions/node_modules/coc-phpls/lib/index.js
  • /home/zdm/.config/coc/extensions/node_modules/coc-phpls/lib/index.js

Desktop (please complete the following information):

uname -a

Linux ar 5.6.14-arch1-1 #1 SMP PREEMPT Wed, 20 May 2020 20:43:19 +0000 x86_64 GNU/Linux

nvim --version

NVIM v0.4.3
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim/src/build/config -I/build/neovim/src/neovim-0.4.3/src -I/usr/include -I/build/neovim/src/build/src/nvim/auto -I/build/neovim/src/build/include
Compiled by builduser

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Additional context

I install tslib with pacman -S tslib but still have this problem

Problem in accepting completion

Hey!

I have a problem, when accept variable completion i get e.g.

$number = 5;

echo // when accept $number completion i get, $$number, but it should be $number

Sorry for my bad English. Thanks!

Undefine type

Describe the bug
Show error Undefined type 'Route'

To Reproduce
Steps to reproduce the behavior:

  1. Create project laravel : laravel new blog
  2. Open file routes/web.php
  3. Show Error

Expected behavior
Auto show error

Screenshots
image

Desktop (please complete the following information):

  • OS: Ubuntu
  • Version : Laravel 6.9

Additional context
Use coc-phpls in neovim

Configuration options description

Hi,

After the recent update of intelephense there are a lot of issues with undefined symbols, types, failures to find the definition and so forth.

There are extremely few documents on inelephense and coc-phpls. It would really help if you would provide some kind of documentation on how to set up completion for a particular project.

Some points of the docs that would be very appreciated:

  • Per-folder configuration
  • Make intelephense discover symbols
  • Some frameworks still use own loading mechanisms (like Yii2), are there any recommendations for such cases?

Thank you.

Intelephense Premium

Thank you for this extension! I bought intelephense premium to support the author.
Does it make sense to add the licence key like intelephense.licenceKey to the configuration?

coc-rename silently ignores the command

Sorry, I have no minimal test case, since the issue occurs only in a large closed-source project.

In about half of the time, coc-rename command silently terminates without any message and, more importantly, no action. For example, I have an interface with a method and a class implementing the interface. Now I put cursor over the method name in the interface, and press <leader>rn which is mapped as follows:

nmap <leader>rn <Plug>(coc-rename)

After that, a prompt suggesting to enter new name appears. I enter a new name, then press Enter. Then nothing -- no modified buffers, no changes at all. But sometimes, mostly with private and protected members, the same procedure works fine.

Now the question is how do I go about this issue? Should I look at a log file or something?

By the way, similar thing happens when I try to find references of the problematic method using coc-references command. But this command seems to be blocking, since Nvim hangs for about 5 seconds before returning control to me. Then, again, nothing happens -- no references, no messages, nothing. But coc-implementation still finds implementations of the method without any issues.

Thanks.

Load license key from file

Describe the bug
Can you please add an option to load the licenseKey from a file, so that coc-settings.json can be version controlled? Currently I am unable to upload my coc-settings.json to my dotfiles repository on GitHub, since it contains my license key.

Connection to server got closed

After I upgrade coc.nvim to 0.0.64, when I start my vim show the follow message:
[coc.nvim] Error output from phpls: Connection to server got closed. Server will not be restarted.

Telemetry ApplicationInsights error

Great extension, but I'm getting a ApplicationInsights:CorrelationIdManager [ { Error: connect ECONNREFUSED 0.0.0.0:443 every time I edit a php file.
Also initially high CPU.

Steps to reproduce the behavior:

  1. open any php file
  2. :CocInfo

Desktop (please complete the following information):
Kubuntu 18.04
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jun 06 2019 17:31:41)
Included patches: 1-1453

What is the use of Application Insights. Telemetry?
Can it be disabled or removed?

Core functions all shows as "deprecated"

Describe the bug
The intelephense shows all core functions that ships with php as deprecated
Example: [intelephense 1007] [H] 'strtolower' is deprecated.

Desktop (please complete the following information):
vim version: NVIM v0.4.3
node version: v13.3.0
coc.nvim version: 0.0.74-d83536aa4e
term: iTerm.app
platform: darwin

Question: fix gutter?

When the LS has something to say, a gutter appears on the left of the edit area, and when the LS is happy this gutter goes away.

gutter-flash

I find that, especially when writing code quickly this makes it hard to concentrate because the bit you're looking at keeps jumping left and right.

Is it possible to set the gutter to always show to avoid this?

Refactor feature with empty refactor pane

Describe the Problem

coc-refactor opens an empty refactor buffer instead of one I can use to refactor code

To Reproduce
Steps to reproduce the behavior:

  1. Open a php file
  2. Put the cursor on the property
  3. Trigger coc-refactor (in my case <leader>rf)
  4. See empty buffer only containing "Save current buffer to make changes"

Expected behavior
A buffer assisting refactoring should show up (not sure how to call it ...)

Screenshots
screenshot-coc

Desktop (please complete the following information):

  • Xubuntu 19.10, vim 8.1.1401, latest release of coc.nvim

Additional context

  • The same feature works with rust rls
  • I bought a license to enable the rename feature of intelephense (the license is also recognized).

Edit: I did not assign this issue to you intentionally, so, sorry about that.

Any way to add stubs for Wordpress?

I'm having a little difficulty figuring out whether or not there's a way to add stubs for Wordpress development?

I noticed this repository mentioned in an issue in the intelephense repo: https://github.com/php-stubs/wordpress-stubs but I'm having trouble figuring out whether or not it's possible to somehow include this in my COC configuration to prevent/stop intelephense errors on Wordpress built-in functions.

Screen Shot 2019-12-08 at 10 00 40 PM

EISDIR error & max file size

Hey,

I am trying to get this working in a small laravel project, but :CocInfo gives me these errors:

## versions

vim version: NVIM v0.3.4
node version: v10.9.0
coc.nvim version: 0.0.64
term: tmux-256color
platform: darwin

## Error messages

## Output channel: watchman
[Info  - 23:04:28] watchman watching project: /Users/t/Sites/test
[Info  - 23:04:29] subscribing "**/*.php" in /Users/t/Sites/test

## Output channel: highlight
[Info  - 23:04:28] Highlight server running in node v10.9.0

## Output channel: php
[Info  - 23:04:29] Initialising
[Info  - 23:04:30] Initialised in 357 ms
[Warn  - 23:04:49] EISDIR: illegal operation on a directory, read
[Warn  - 23:05:06] file:///Users/t/Sites/test/vendor/fzaninotto/faker/src/Faker/Provider/nl_BE/Text.php exceeds max file size.

I ran :CocInstall coc-phpls and set autocmd FileType php setl iskeyword+=$.

Is there something I am doing wrong? Cheers

-> trigger bug?

I have problem with -> trigger

e.g.

<?php
$pdo = new PDO('');

$pdo-> // no completions
$pdo-> // i must start typing something for get a completions for some class

// This problem not appear in vscode
// ccls for C++ have -> trigger and works fine

Sorry for my bad English. Thanks!

How to Rename A Class and All The Reference to that Class?

I can rename A Php filename but when in vim i invoke this key [comma][c] then i type workspace.renameCurrentFile
I can change the Filename but The Current File Class Name is not change and all the Reference to this Class Name.
Is there a way i can rename and intelligently include all the reference to this Classname like in PHP storm???

Wrong error and underline while editing php files

Describe the bug
When I'm editing PHP files, sometimes the editor shows me the error for the correct piece of code. For example when I delete a couple of line of code as the screenshot below. coc/phpls then remove the error after that, but the underline lines remain. This issue happens randomly.

P.S: I don't know if this is the right place to report this bug, but I don't have this bug with tsserver. If it's coc.nvim bug, feel free to close this issue :).

Expected behavior
The underline should be removed with the wrong error.

Screenshots
The wrong errors:

After coc/phpls hide the error:

Desktop (please complete the following information):

  • OS: macOS 10.14.6
  • NVIM v0.4.0-dev Build type: Release

Plug 'neoclide/coc-html', {'do': 'yarn install --frozen-lockfile'} errors

Describe the bug
Context : I like to add my coc extensions inside of my init.vim file with my plugin manager vim-plug.
Plug 'neoclide/coc-html', {'do': 'yarn install --frozen-lockfile'} errors on me

To Reproduce
Steps to reproduce the behavior:

  1. Add Plug 'neoclide/coc-html', {'do': 'yarn install --frozen-lockfile'} to init.vim
    2.. :PlugInstall
  2. error

You can see the actual error by going into the plugged/coc-phpls directory and calling npm install or yarn.

Expected behavior
It should just work

Desktop (please complete the following information):

  • OS: Arch
  • Version 2.1.3

Is there a way to auto inject use statements in php laravel ?

NOT A BUG

I'm using the plugin and loving it with CoC. I am working on Typescript on frontend and Laravel on backend. While autocompletion works perfectly fine on laravel project, I was just wondering if there is a way to auto inject the use statements which is under the cursor? I don't want to install another plugin (phpactor/phpactor) just to add this feature as this plugin (using Intelephense) correctly suggests the auto completion and namespaces. Please help :).

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.