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

PHP code completion doesn't display on Arch Linux. #1542

Closed
JontyNewman opened this Issue Feb 8, 2017 · 40 comments

Comments

Projects
None yet
3 participants
@JontyNewman

JontyNewman commented Feb 8, 2017

If I create a new empty file, save it as test.js, and type doc, the code completion dialog automatically displays document along with a short description of the interface and a link to the MDN Web APIs page.

However, if I create a new empty file, save it as test.php and type <?php followed by the name of a standard PHP function or class (e.g. DateTime), the code completion dialog doesn't display.

More specifically, typing array displays the word completion options array and array_key_exists, but no documentation of the interface to array_key_exists() (i.e. details from the PHP manual).

I am running Arch Linux and I have tried both the AUR package and manually building from source. It seems to apply to versions 10 and above.

@JontyNewman

This comment has been minimized.

Show comment
Hide comment
@JontyNewman

JontyNewman Feb 8, 2017

I have ensured that the PHP plugin is enabled, but I may have not installed the php-docs package (I am away from my Arch Linux machine at the moment so I can't confirm). Would simply installing that package resolve the issue for me?

JontyNewman commented Feb 8, 2017

I have ensured that the PHP plugin is enabled, but I may have not installed the php-docs package (I am away from my Arch Linux machine at the moment so I can't confirm). Would simply installing that package resolve the issue for me?

@eranif

This comment has been minimized.

Show comment
Hide comment
@eranif

eranif Feb 9, 2017

Owner

You must have a workspace to get the PHP code completion to work.
Please read this: http://codelite.org/LiteEditor/PHP

Owner

eranif commented Feb 9, 2017

You must have a workspace to get the PHP code completion to work.
Please read this: http://codelite.org/LiteEditor/PHP

@eranif eranif closed this Feb 9, 2017

@JontyNewman

This comment has been minimized.

Show comment
Hide comment
@JontyNewman

JontyNewman Feb 9, 2017

Thanks for the response eranif. I followed the documentation you linked to and PHP code completion is now working on my Windows machine (will try it on my Arch Linux machine at a later date).

I had made attempts in a PHP workspace in the past and was experiencing the same issue I describe above. However, I think I had omitted specifying the path to the PHP executable. Am I right in thinking that the path to the executable is crucial for PHP code completion to work?

Thanks again for your support regarding this and for the fantastic piece of software that is CodeLite.

JontyNewman commented Feb 9, 2017

Thanks for the response eranif. I followed the documentation you linked to and PHP code completion is now working on my Windows machine (will try it on my Arch Linux machine at a later date).

I had made attempts in a PHP workspace in the past and was experiencing the same issue I describe above. However, I think I had omitted specifying the path to the PHP executable. Am I right in thinking that the path to the executable is crucial for PHP code completion to work?

Thanks again for your support regarding this and for the fantastic piece of software that is CodeLite.

@eranif

This comment has been minimized.

Show comment
Hide comment
@eranif

eranif Feb 9, 2017

Owner

Am I right in thinking that the path to the executable is crucial for PHP code completion to work?

No. The code completion uses a built-in parser which does not use the PHP binary.
The PHP binary is uses for running php lint for grammar check, which has no affect on the PHP.

Owner

eranif commented Feb 9, 2017

Am I right in thinking that the path to the executable is crucial for PHP code completion to work?

No. The code completion uses a built-in parser which does not use the PHP binary.
The PHP binary is uses for running php lint for grammar check, which has no affect on the PHP.

@JontyNewman

This comment has been minimized.

Show comment
Hide comment
@JontyNewman

JontyNewman Feb 9, 2017

I have just tested a new workspace and project on Arch Linux and and the issue is still present. In fact, not even word completion pops up automatically. Should I open a new issue entitled "PHP code completion doesn't display on Arch Linux"?

JontyNewman commented Feb 9, 2017

I have just tested a new workspace and project on Arch Linux and and the issue is still present. In fact, not even word completion pops up automatically. Should I open a new issue entitled "PHP code completion doesn't display on Arch Linux"?

@eranif

This comment has been minimized.

Show comment
Hide comment
@eranif

eranif Feb 9, 2017

Owner

Unless you can reproduce this on Debian or Ubuntu, I won't be able to test this.
There is one issue that I am aware of: if the caret is placed at the last position of the file, the code completion will not work. It needs to be somewhere inside the editor.

Can you upload your project + steps to reproduce so I could test this here?

Owner

eranif commented Feb 9, 2017

Unless you can reproduce this on Debian or Ubuntu, I won't be able to test this.
There is one issue that I am aware of: if the caret is placed at the last position of the file, the code completion will not work. It needs to be somewhere inside the editor.

Can you upload your project + steps to reproduce so I could test this here?

@JontyNewman

This comment has been minimized.

Show comment
Hide comment
@JontyNewman

JontyNewman Feb 10, 2017

Here are the steps I took on Arch Linux:

  1. Create a new workspace via Workspace > New Workspace...
    1. Select PHP
    2. Enter the name as test
  2. Create a new project with in the workspace via Workspace > New Project
    1. Select Create an empty PHP project
    2. Enter the project name test
    3. Continue to use default options until Finish
  3. Create a new file within the test project (via right-click).
    1. Name it test.php
  4. In the editor, enter the following:
<?php

// This comment is to prevent the caret being at the last position in the file.
  1. Save the file.
  2. Now edit the text until it resembles the following:
<?php

array_

// This comment is to prevent the caret being at the last position in the file.

One would expect a code completion dialog to appear containing functions such as array_change_key_case(). Although it works on Windows, nothing is displayed on Arch Linux (not even word completion for array).

It could well be an Arch Linux-specific issue. If the issue does not occur for you on Debian/Ubuntu then I may go ahead an set up a Debian/Ubuntu VM just to confirm.

Cheers.

JontyNewman commented Feb 10, 2017

Here are the steps I took on Arch Linux:

  1. Create a new workspace via Workspace > New Workspace...
    1. Select PHP
    2. Enter the name as test
  2. Create a new project with in the workspace via Workspace > New Project
    1. Select Create an empty PHP project
    2. Enter the project name test
    3. Continue to use default options until Finish
  3. Create a new file within the test project (via right-click).
    1. Name it test.php
  4. In the editor, enter the following:
<?php

// This comment is to prevent the caret being at the last position in the file.
  1. Save the file.
  2. Now edit the text until it resembles the following:
<?php

array_

// This comment is to prevent the caret being at the last position in the file.

One would expect a code completion dialog to appear containing functions such as array_change_key_case(). Although it works on Windows, nothing is displayed on Arch Linux (not even word completion for array).

It could well be an Arch Linux-specific issue. If the issue does not occur for you on Debian/Ubuntu then I may go ahead an set up a Debian/Ubuntu VM just to confirm.

Cheers.

@eranif

This comment has been minimized.

Show comment
Hide comment
@eranif

eranif Feb 10, 2017

Owner

Just tried this on Debian 8 and it works... I get all the array* function as completion options.
Maybe its a simple thing as keyboard binding not working. Did you try it from the menu: Edit->Complete Word?

Owner

eranif commented Feb 10, 2017

Just tried this on Debian 8 and it works... I get all the array* function as completion options.
Maybe its a simple thing as keyboard binding not working. Did you try it from the menu: Edit->Complete Word?

@JontyNewman

This comment has been minimized.

Show comment
Hide comment
@JontyNewman

JontyNewman Feb 10, 2017

I've tried it from the menu (Edit > Complete Word) but no luck. Would you consider re-opening the issue?

JontyNewman commented Feb 10, 2017

I've tried it from the menu (Edit > Complete Word) but no luck. Would you consider re-opening the issue?

@JontyNewman JontyNewman changed the title from PHP code completion doesn't display. to PHP code completion doesn't display on Arch Linux. Feb 10, 2017

@eranif

This comment has been minimized.

Show comment
Hide comment
@eranif

eranif Feb 10, 2017

Owner

I don't have ArchLinux (tried once did not work) - it works on 3 platforms I tested today.
So unless you plan on debugging this...

Owner

eranif commented Feb 10, 2017

I don't have ArchLinux (tried once did not work) - it works on 3 platforms I tested today.
So unless you plan on debugging this...

@eranif

This comment has been minimized.

Show comment
Hide comment
@eranif

eranif Feb 11, 2017

Owner

One more thing that we can try:
What do you get when type this from the command line:
ls -l ~/.codelite/php-plugin/cc/ ?

Owner

eranif commented Feb 11, 2017

One more thing that we can try:
What do you get when type this from the command line:
ls -l ~/.codelite/php-plugin/cc/ ?

@JontyNewman

This comment has been minimized.

Show comment
Hide comment
@JontyNewman

JontyNewman Feb 11, 2017

-rw-r--r-- 1 me me  12863 Feb  8 08:24  apc.php
-rw-r--r-- 1 me me   1622 Feb  8 08:24  basic.php
-rw-r--r-- 1 me me   4586 Feb  8 08:24  bcmath.php
-rw-r--r-- 1 me me   5189 Feb  8 08:24  bz2.php
-rw-r--r-- 1 me me   9744 Feb  8 08:24  calendar.php
-rw-r--r-- 1 me me  40529 Feb  8 08:24  Core.php
-rw-r--r-- 1 me me   3947 Feb  8 08:24  ctype.php
-rw-r--r-- 1 me me  81155 Feb  8 08:24  curl.php
-rw-r--r-- 1 me me  59523 Feb  8 08:24  date.php
-rw-r--r-- 1 me me 144960 Feb  8 08:24  dom.php
-rw-r--r-- 1 me me   7936 Feb  8 08:24  ereg.php
-rw-r--r-- 1 me me   5395 Feb  8 08:24  exif.php
-rw-r--r-- 1 me me   3422 Feb  8 08:24  fileinfo.php
-rw-r--r-- 1 me me  14492 Feb  8 08:24  filter.php
-rw-r--r-- 1 me me  21819 Feb  8 08:24  ftp.php
-rw-r--r-- 1 me me  81364 Feb  8 08:24  gd.php
-rw-r--r-- 1 me me   3465 Feb  8 08:24  gettext.php
-rw-r--r-- 1 me me   8192 Feb  8 08:24  hash.php
-rw-r--r-- 1 me me  14755 Feb  8 08:24  iconv.php
-rw-r--r-- 1 me me  56118 Feb  8 08:24  imap.php
-rw-r--r-- 1 me me 151998 Feb  8 08:24  intl.php
-rw-r--r-- 1 me me   7370 Feb  8 08:24  json.php
-rw-r--r-- 1 me me  37808 Feb  8 08:24  ldap.php
-rw-r--r-- 1 me me   7213 Feb  8 08:24  libxml.php
-rw-r--r-- 1 me me  44738 Feb  8 08:24  mbstring.php
-rw-r--r-- 1 me me  20238 Feb  8 08:24  mcrypt.php
-rw-r--r-- 1 me me  73386 Feb  8 08:24  mysqli.php
-rw-r--r-- 1 me me    212 Feb  8 08:24  mysqlnd.php
-rw-r--r-- 1 me me  29177 Feb  8 08:24  mysql.php
-rw-r--r-- 1 me me  63918 Feb  8 08:24  oci8.php
-rw-r--r-- 1 me me  40409 Feb  8 08:24  openssl.php
-rw-r--r-- 1 me me  16464 Feb  8 08:24  pcre.php
-rw-r--r-- 1 me me     68 Feb  8 08:24  pdo_mysql.php
-rw-r--r-- 1 me me     68 Feb  8 08:24  pdo_pgsql.php
-rw-r--r-- 1 me me  27921 Feb  8 08:24  PDO.php
-rw-r--r-- 1 me me     70 Feb  8 08:24  pdo_sqlite.php
-rw-r--r-- 1 me me  78624 Feb  8 08:24  pgsql.php
-rw-r--r-- 1 me me  73000 Feb  8 08:24  Phar.php
-rw-r--r-- 1 me me  22236 Feb  8 08:24  posix.php
-rw-r--r-- 1 me me   4320 Feb  8 08:24  readline.php
-rw-r--r-- 1 me me  68002 Feb  8 08:24  Reflection.php
-rw-r--r-- 1 me me  15292 Feb  8 08:24  session.php
-rw-r--r-- 1 me me  17672 Feb  8 08:24  SimpleXML.php
-rw-r--r-- 1 me me  15624 Feb  8 08:24  soap.php
-rw-r--r-- 1 me me  60350 Feb  8 08:24  sockets.php
-rw-r--r-- 1 me me 212083 Feb  8 08:24  SPL.php
-rw-r--r-- 1 me me  16121 Feb  8 08:24  sqlite3.php
-rw-r--r-- 1 me me  28560 Feb  8 08:24  SQLite.php
-rw-r--r-- 1 me me 403304 Feb  8 08:24  standard.php
-rw-r--r-- 1 me me    260 Feb  8 08:24  superglobals.php
-rw-r--r-- 1 me me   3439 Feb  8 08:24  SuperGlobals.php
-rw-r--r-- 1 me me  19207 Feb  8 08:24  tidy.php
-rw-r--r-- 1 me me   4627 Feb  8 08:24  tokenizer.php
-rw-r--r-- 1 me me   1569 Feb  8 08:24  xdebug.php
-rw-r--r-- 1 me me  21261 Feb  8 08:24  xml.php
-rw-r--r-- 1 me me   8998 Feb  8 08:24  xmlreader.php
-rw-r--r-- 1 me me  19052 Feb  8 08:24  xmlwriter.php
-rw-r--r-- 1 me me   5275 Feb  8 08:24  xsl.php
-rw-r--r-- 1 me me   1211 Feb  8 08:24 'Zend Code Tracing.php'
-rw-r--r-- 1 me me   1207 Feb  8 08:24  ZendCodeTracing.php
-rw-r--r-- 1 me me    557 Feb  8 08:24 'Zend Data Cache.php'
-rw-r--r-- 1 me me    373 Feb  8 08:24  ZendDataCache.php
-rw-r--r-- 1 me me    415 Feb  8 08:24 'Zend Debugger.php'
-rw-r--r-- 1 me me   3766 Feb  8 08:24 'Zend Job Queue.php'
-rw-r--r-- 1 me me   3565 Feb  8 08:24  ZendJobQueue.php
-rw-r--r-- 1 me me   5080 Feb  8 08:24 'Zend Monitor.php'
-rw-r--r-- 1 me me   4754 Feb  8 08:24  ZendMonitor.php
-rw-r--r-- 1 me me   2404 Feb  8 08:24 'Zend OPcache.php'
-rw-r--r-- 1 me me    250 Feb  8 08:24  ZendOptimizerPlus.php
-rw-r--r-- 1 me me    443 Feb  8 08:24 'Zend Page Cache.php'
-rw-r--r-- 1 me me    265 Feb  8 08:24  ZendPageCache.php
-rw-r--r-- 1 me me    634 Feb  8 08:24 'Zend Server Z-Ray.php'
-rw-r--r-- 1 me me    945 Feb  8 08:24  ZendSessionClustering.php
-rw-r--r-- 1 me me   3814 Feb  8 08:24 'Zend Utils.php'
-rw-r--r-- 1 me me    503 Feb  8 08:24  ZendUtils.php
-rw-r--r-- 1 me me  23152 Feb  8 08:24  zip.php
-rw-r--r-- 1 me me  13347 Feb  8 08:24  zlib.php

It's a shame that the issue won't be re-opened, as I really enjoy using CodeLite, partly because it's advertised as a cross-platform PHP IDE. However, if the code completion doesn't work on my main/preferred platform, I may have to migrate to something else.

I wouldn't mind debugging the issue, but I would imagine you are a much more competent C++ programmer and you have a much more intimate understanding of what the issue could be relating to.

I may have a go at investigating this if I find the time.

JontyNewman commented Feb 11, 2017

-rw-r--r-- 1 me me  12863 Feb  8 08:24  apc.php
-rw-r--r-- 1 me me   1622 Feb  8 08:24  basic.php
-rw-r--r-- 1 me me   4586 Feb  8 08:24  bcmath.php
-rw-r--r-- 1 me me   5189 Feb  8 08:24  bz2.php
-rw-r--r-- 1 me me   9744 Feb  8 08:24  calendar.php
-rw-r--r-- 1 me me  40529 Feb  8 08:24  Core.php
-rw-r--r-- 1 me me   3947 Feb  8 08:24  ctype.php
-rw-r--r-- 1 me me  81155 Feb  8 08:24  curl.php
-rw-r--r-- 1 me me  59523 Feb  8 08:24  date.php
-rw-r--r-- 1 me me 144960 Feb  8 08:24  dom.php
-rw-r--r-- 1 me me   7936 Feb  8 08:24  ereg.php
-rw-r--r-- 1 me me   5395 Feb  8 08:24  exif.php
-rw-r--r-- 1 me me   3422 Feb  8 08:24  fileinfo.php
-rw-r--r-- 1 me me  14492 Feb  8 08:24  filter.php
-rw-r--r-- 1 me me  21819 Feb  8 08:24  ftp.php
-rw-r--r-- 1 me me  81364 Feb  8 08:24  gd.php
-rw-r--r-- 1 me me   3465 Feb  8 08:24  gettext.php
-rw-r--r-- 1 me me   8192 Feb  8 08:24  hash.php
-rw-r--r-- 1 me me  14755 Feb  8 08:24  iconv.php
-rw-r--r-- 1 me me  56118 Feb  8 08:24  imap.php
-rw-r--r-- 1 me me 151998 Feb  8 08:24  intl.php
-rw-r--r-- 1 me me   7370 Feb  8 08:24  json.php
-rw-r--r-- 1 me me  37808 Feb  8 08:24  ldap.php
-rw-r--r-- 1 me me   7213 Feb  8 08:24  libxml.php
-rw-r--r-- 1 me me  44738 Feb  8 08:24  mbstring.php
-rw-r--r-- 1 me me  20238 Feb  8 08:24  mcrypt.php
-rw-r--r-- 1 me me  73386 Feb  8 08:24  mysqli.php
-rw-r--r-- 1 me me    212 Feb  8 08:24  mysqlnd.php
-rw-r--r-- 1 me me  29177 Feb  8 08:24  mysql.php
-rw-r--r-- 1 me me  63918 Feb  8 08:24  oci8.php
-rw-r--r-- 1 me me  40409 Feb  8 08:24  openssl.php
-rw-r--r-- 1 me me  16464 Feb  8 08:24  pcre.php
-rw-r--r-- 1 me me     68 Feb  8 08:24  pdo_mysql.php
-rw-r--r-- 1 me me     68 Feb  8 08:24  pdo_pgsql.php
-rw-r--r-- 1 me me  27921 Feb  8 08:24  PDO.php
-rw-r--r-- 1 me me     70 Feb  8 08:24  pdo_sqlite.php
-rw-r--r-- 1 me me  78624 Feb  8 08:24  pgsql.php
-rw-r--r-- 1 me me  73000 Feb  8 08:24  Phar.php
-rw-r--r-- 1 me me  22236 Feb  8 08:24  posix.php
-rw-r--r-- 1 me me   4320 Feb  8 08:24  readline.php
-rw-r--r-- 1 me me  68002 Feb  8 08:24  Reflection.php
-rw-r--r-- 1 me me  15292 Feb  8 08:24  session.php
-rw-r--r-- 1 me me  17672 Feb  8 08:24  SimpleXML.php
-rw-r--r-- 1 me me  15624 Feb  8 08:24  soap.php
-rw-r--r-- 1 me me  60350 Feb  8 08:24  sockets.php
-rw-r--r-- 1 me me 212083 Feb  8 08:24  SPL.php
-rw-r--r-- 1 me me  16121 Feb  8 08:24  sqlite3.php
-rw-r--r-- 1 me me  28560 Feb  8 08:24  SQLite.php
-rw-r--r-- 1 me me 403304 Feb  8 08:24  standard.php
-rw-r--r-- 1 me me    260 Feb  8 08:24  superglobals.php
-rw-r--r-- 1 me me   3439 Feb  8 08:24  SuperGlobals.php
-rw-r--r-- 1 me me  19207 Feb  8 08:24  tidy.php
-rw-r--r-- 1 me me   4627 Feb  8 08:24  tokenizer.php
-rw-r--r-- 1 me me   1569 Feb  8 08:24  xdebug.php
-rw-r--r-- 1 me me  21261 Feb  8 08:24  xml.php
-rw-r--r-- 1 me me   8998 Feb  8 08:24  xmlreader.php
-rw-r--r-- 1 me me  19052 Feb  8 08:24  xmlwriter.php
-rw-r--r-- 1 me me   5275 Feb  8 08:24  xsl.php
-rw-r--r-- 1 me me   1211 Feb  8 08:24 'Zend Code Tracing.php'
-rw-r--r-- 1 me me   1207 Feb  8 08:24  ZendCodeTracing.php
-rw-r--r-- 1 me me    557 Feb  8 08:24 'Zend Data Cache.php'
-rw-r--r-- 1 me me    373 Feb  8 08:24  ZendDataCache.php
-rw-r--r-- 1 me me    415 Feb  8 08:24 'Zend Debugger.php'
-rw-r--r-- 1 me me   3766 Feb  8 08:24 'Zend Job Queue.php'
-rw-r--r-- 1 me me   3565 Feb  8 08:24  ZendJobQueue.php
-rw-r--r-- 1 me me   5080 Feb  8 08:24 'Zend Monitor.php'
-rw-r--r-- 1 me me   4754 Feb  8 08:24  ZendMonitor.php
-rw-r--r-- 1 me me   2404 Feb  8 08:24 'Zend OPcache.php'
-rw-r--r-- 1 me me    250 Feb  8 08:24  ZendOptimizerPlus.php
-rw-r--r-- 1 me me    443 Feb  8 08:24 'Zend Page Cache.php'
-rw-r--r-- 1 me me    265 Feb  8 08:24  ZendPageCache.php
-rw-r--r-- 1 me me    634 Feb  8 08:24 'Zend Server Z-Ray.php'
-rw-r--r-- 1 me me    945 Feb  8 08:24  ZendSessionClustering.php
-rw-r--r-- 1 me me   3814 Feb  8 08:24 'Zend Utils.php'
-rw-r--r-- 1 me me    503 Feb  8 08:24  ZendUtils.php
-rw-r--r-- 1 me me  23152 Feb  8 08:24  zip.php
-rw-r--r-- 1 me me  13347 Feb  8 08:24  zlib.php

It's a shame that the issue won't be re-opened, as I really enjoy using CodeLite, partly because it's advertised as a cross-platform PHP IDE. However, if the code completion doesn't work on my main/preferred platform, I may have to migrate to something else.

I wouldn't mind debugging the issue, but I would imagine you are a much more competent C++ programmer and you have a much more intimate understanding of what the issue could be relating to.

I may have a go at investigating this if I find the time.

@JontyNewman

This comment has been minimized.

Show comment
Hide comment
@JontyNewman

JontyNewman Feb 11, 2017

It couldn't be some dependency that's pre-installed on Debian / Ubuntu but is optional on Arch could it? I'm running Xfce4 as my desktop environment if that's any use.

JontyNewman commented Feb 11, 2017

It couldn't be some dependency that's pre-installed on Debian / Ubuntu but is optional on Arch could it? I'm running Xfce4 as my desktop environment if that's any use.

@eranif

This comment has been minimized.

Show comment
Hide comment
@eranif

eranif Feb 11, 2017

Owner
  • Enable CodeLite log file, from: settings->preferences->misc->Log->codelite log file verbosity and set it to Debug
  • In a terminal, type: tail -f ~/.codelite/codelite.log&
  • Try to code complete something (the default key binding is Ctrl+SPACE)
  • What do you get in the log file?

Also, run: Workspace->Parse workspace -> what do you get in the log file?

Owner

eranif commented Feb 11, 2017

  • Enable CodeLite log file, from: settings->preferences->misc->Log->codelite log file verbosity and set it to Debug
  • In a terminal, type: tail -f ~/.codelite/codelite.log&
  • Try to code complete something (the default key binding is Ctrl+SPACE)
  • What do you get in the log file?

Also, run: Workspace->Parse workspace -> what do you get in the log file?

@eranif eranif reopened this Feb 11, 2017

@eranif

This comment has been minimized.

Show comment
Hide comment
@eranif

eranif Feb 11, 2017

Owner

Also, what values do you have in:
PHP->Settings->Code Completion

Owner

eranif commented Feb 11, 2017

Also, what values do you have in:
PHP->Settings->Code Completion

@JontyNewman

This comment has been minimized.

Show comment
Hide comment
@JontyNewman

JontyNewman Feb 11, 2017

I'm currently testing the following:

<?php

new \Ex

// A comment.

Triggering code completion (Ctrl + Space and Edit > Complete Word) appends nothing to the log file. However, saving triggers the following to be appended:

[08:54:00:389 DBG] PHP: running lint: /usr/bin/php -l /home/me/test/test.php
[08:54:00:395 WRN] PHP: database image is corrupted
[08:54:00:403 DBG] ContinuousBuild::OnFileSaved
[08:54:00:403 DBG] ContinuousBuild is disabled
[08:54:00:432 DBG] PHPLint: process terminated. output: PHP Parse error:  syntax error, unexpected end of file in /home/me/test/test.php on line 6
Errors parsing /home/me/test/test.php
[08:54:00:433 DBG] PHPLint: searching editor for file: /home/me/test/test.php
[08:54:00:434 DBG] PHPLint: adding error marker @5

And parsing the workspace appends the following:

[08:57:38:764 WRN] PHP: database image is corrupted
[08:57:43:420 DBG] PHP: parsed 78 in 4637 milliseconds

Could the corrupted database image be the issue? Is there anything I can do to reset it?

I'll check my code completion settings now too.

JontyNewman commented Feb 11, 2017

I'm currently testing the following:

<?php

new \Ex

// A comment.

Triggering code completion (Ctrl + Space and Edit > Complete Word) appends nothing to the log file. However, saving triggers the following to be appended:

[08:54:00:389 DBG] PHP: running lint: /usr/bin/php -l /home/me/test/test.php
[08:54:00:395 WRN] PHP: database image is corrupted
[08:54:00:403 DBG] ContinuousBuild::OnFileSaved
[08:54:00:403 DBG] ContinuousBuild is disabled
[08:54:00:432 DBG] PHPLint: process terminated. output: PHP Parse error:  syntax error, unexpected end of file in /home/me/test/test.php on line 6
Errors parsing /home/me/test/test.php
[08:54:00:433 DBG] PHPLint: searching editor for file: /home/me/test/test.php
[08:54:00:434 DBG] PHPLint: adding error marker @5

And parsing the workspace appends the following:

[08:57:38:764 WRN] PHP: database image is corrupted
[08:57:43:420 DBG] PHP: parsed 78 in 4637 milliseconds

Could the corrupted database image be the issue? Is there anything I can do to reset it?

I'll check my code completion settings now too.

@eranif

This comment has been minimized.

Show comment
Hide comment
@eranif

eranif Feb 11, 2017

Owner

Remove the file <WORKSPACE-PATH>/.codelite/phpsymbols.db and reparse the workspace

Owner

eranif commented Feb 11, 2017

Remove the file <WORKSPACE-PATH>/.codelite/phpsymbols.db and reparse the workspace

@JontyNewman

This comment has been minimized.

Show comment
Hide comment
@JontyNewman

JontyNewman Feb 11, 2017

Reparsing the workspace after removing phpsymbols.db consistently produces a PHP: database image is corrupted warning as soon as the reparse is triggered, even after multiple attempts.

One debug entry I noticed when reloading the workspace was Failed to find library ecma5/6. Installing the libvterm package stops the entry appearing in the logs but does not resolve this issue.

JontyNewman commented Feb 11, 2017

Reparsing the workspace after removing phpsymbols.db consistently produces a PHP: database image is corrupted warning as soon as the reparse is triggered, even after multiple attempts.

One debug entry I noticed when reloading the workspace was Failed to find library ecma5/6. Installing the libvterm package stops the entry appearing in the logs but does not resolve this issue.

@JontyNewman

This comment has been minimized.

Show comment
Hide comment
@JontyNewman

JontyNewman Feb 11, 2017

I have the following code completion options enabled:

  • Number of items to display in completion box: 500
  • Display function calltip
  • Display completion box for language keyboards
  • Scan all included files to locate using namespace statements
  • Auto display code completion box when typing
  • Minimum chars to type: 3

All other options (apart from some under the Colouring tab) are unchecked.

Although minimum chars is 3, typing new \Exc or reducing the value to 1 does not resolve the issue.

JontyNewman commented Feb 11, 2017

I have the following code completion options enabled:

  • Number of items to display in completion box: 500
  • Display function calltip
  • Display completion box for language keyboards
  • Scan all included files to locate using namespace statements
  • Auto display code completion box when typing
  • Minimum chars to type: 3

All other options (apart from some under the Colouring tab) are unchecked.

Although minimum chars is 3, typing new \Exc or reducing the value to 1 does not resolve the issue.

@eranif

This comment has been minimized.

Show comment
Hide comment
@eranif

eranif Feb 11, 2017

Owner

The problem is with the database, nothing else. Try closing CodeLite and then remove the file (otherwise the handle is still opened and not actually deleted).

Is there a chance that the disk is on a network drive?

Owner

eranif commented Feb 11, 2017

The problem is with the database, nothing else. Try closing CodeLite and then remove the file (otherwise the handle is still opened and not actually deleted).

Is there a chance that the disk is on a network drive?

@JontyNewman

This comment has been minimized.

Show comment
Hide comment
@JontyNewman

JontyNewman Feb 11, 2017

Reopening CodeLite and reparsing the workspace still reports corruption.

Let me try in a completely new workspace...

JontyNewman commented Feb 11, 2017

Reopening CodeLite and reparsing the workspace still reports corruption.

Let me try in a completely new workspace...

@JontyNewman

This comment has been minimized.

Show comment
Hide comment
@JontyNewman

JontyNewman Feb 11, 2017

Even a completely new workspace reports corruption. It's as if CodeLite is populating the database in a format it can't understand.

JontyNewman commented Feb 11, 2017

Even a completely new workspace reports corruption. It's as if CodeLite is populating the database in a format it can't understand.

@eranif

This comment has been minimized.

Show comment
Hide comment
@eranif

eranif Feb 11, 2017

Owner

It's a simple SQLite file.
There is something wrong with the disk or sqlite library. Note that this only happens on one machine you have. For the rest, it works, so I am not sure why.

Owner

eranif commented Feb 11, 2017

It's a simple SQLite file.
There is something wrong with the disk or sqlite library. Note that this only happens on one machine you have. For the rest, it works, so I am not sure why.

@JontyNewman

This comment has been minimized.

Show comment
Hide comment
@JontyNewman

JontyNewman Feb 11, 2017

Opening the file with sqlite3 and running .schema and .dump work fine.

At least we've pinpointed the issue.

So if we can get CodeLite to read the file successfully the issue should be resolved?

JontyNewman commented Feb 11, 2017

Opening the file with sqlite3 and running .schema and .dump work fine.

At least we've pinpointed the issue.

So if we can get CodeLite to read the file successfully the issue should be resolved?

@eranif

This comment has been minimized.

Show comment
Hide comment
@eranif

eranif Feb 11, 2017

Owner

So if we can get CodeLite to read the file successfully the issue should be resolved?

Yes. The code completion is basically parsing source files in the background and storing them into the sqlite file. Later, when you try to code complete, it simply runs basic SQL queries on it and display the results (in a nutshell)

Owner

eranif commented Feb 11, 2017

So if we can get CodeLite to read the file successfully the issue should be resolved?

Yes. The code completion is basically parsing source files in the background and storing them into the sqlite file. Later, when you try to code complete, it simply runs basic SQL queries on it and display the results (in a nutshell)

@eranif

This comment has been minimized.

Show comment
Hide comment
@eranif

eranif Feb 11, 2017

Owner

To test for file corruption, I use this simple test (which you can run from sqlite3 from the command line):

PRAGMA quick_check and check for integrity_check the result should be ok

Owner

eranif commented Feb 11, 2017

To test for file corruption, I use this simple test (which you can run from sqlite3 from the command line):

PRAGMA quick_check and check for integrity_check the result should be ok

@JontyNewman

This comment has been minimized.

Show comment
Hide comment
@JontyNewman

JontyNewman Feb 11, 2017

sqlite3 phpsymbols.db

sqlite> PRAGMA quick_check;
ok
sqlite> PRAGMA integrity_check;
ok

JontyNewman commented Feb 11, 2017

sqlite3 phpsymbols.db

sqlite> PRAGMA quick_check;
ok
sqlite> PRAGMA integrity_check;
ok
@JontyNewman

This comment has been minimized.

Show comment
Hide comment
@JontyNewman

JontyNewman Feb 11, 2017

I have another Arch Linux machine I can test on. I'll install CodeLite on it via the AUR and see if the issue persists there too. That way we can determine if this is just an issue on my machine or a general Arch Linux issue.

JontyNewman commented Feb 11, 2017

I have another Arch Linux machine I can test on. I'll install CodeLite on it via the AUR and see if the issue persists there too. That way we can determine if this is just an issue on my machine or a general Arch Linux issue.

@JontyNewman

This comment has been minimized.

Show comment
Hide comment
@JontyNewman

JontyNewman Feb 11, 2017

I've just installed CodeLite on another Arch Linux machine and the issue behaves exactly as above (i.e. no log entries when triggering code completion, database image is corrupted on reparse).

JontyNewman commented Feb 11, 2017

I've just installed CodeLite on another Arch Linux machine and the issue behaves exactly as above (i.e. no log entries when triggering code completion, database image is corrupted on reparse).

@eranif

This comment has been minimized.

Show comment
Hide comment
@eranif

eranif Feb 12, 2017

Owner

Can you build CodeLite from sources? its really not hard on Linux...
Once you get a local build, I can do modifications on my end and you could test them on your hand
See this page for how to build CodeLite on Linux:

Owner

eranif commented Feb 12, 2017

Can you build CodeLite from sources? its really not hard on Linux...
Once you get a local build, I can do modifications on my end and you could test them on your hand
See this page for how to build CodeLite on Linux:

@JontyNewman

This comment has been minimized.

Show comment
Hide comment
@JontyNewman

JontyNewman Feb 12, 2017

I have it installed from source on my first Arch Linux machine so I can rebuild from there if you like. Just let me know the modifications/branch to pull in.

JontyNewman commented Feb 12, 2017

I have it installed from source on my first Arch Linux machine so I can rebuild from there if you like. Just let me know the modifications/branch to pull in.

@eranif

This comment has been minimized.

Show comment
Hide comment
@eranif

eranif Feb 12, 2017

Owner

If you build it now, I already committed a fix to the log that ensures that the symbols file is also printed to the log file (i.e the error message PHP: database image is corrupted is now set to PHP: database image is corrupted <FILENAME>)

I am curious to see if the file you connected with sqlite3 from the command line, is the same as the file CodeLite was complaining about

Owner

eranif commented Feb 12, 2017

If you build it now, I already committed a fix to the log that ensures that the symbols file is also printed to the log file (i.e the error message PHP: database image is corrupted is now set to PHP: database image is corrupted <FILENAME>)

I am curious to see if the file you connected with sqlite3 from the command line, is the same as the file CodeLite was complaining about

@JontyNewman

This comment has been minimized.

Show comment
Hide comment
@JontyNewman

JontyNewman Feb 12, 2017

I did git pull, cd build-release, cmake -DCMAKE_BUILD_TYPE=Release .. -DCOPY_WX_LIBS=1, make -j4, and sudo make install.

I then created a new workspace Test followed by a project named TestProject and a file named test.php edited to be similar to those above.

Triggering code completion again appends nothing to log, but saving appends various lines including a PHP: database image is corrupted: /home/me/Test/.codelite/phpsymbols.db

Running sqlite3 /home/me/Test/.codelite/phpsymbols.db followed by PRAGMA quick_check; and PRAGMA integrity_check; both report ok.

JontyNewman commented Feb 12, 2017

I did git pull, cd build-release, cmake -DCMAKE_BUILD_TYPE=Release .. -DCOPY_WX_LIBS=1, make -j4, and sudo make install.

I then created a new workspace Test followed by a project named TestProject and a file named test.php edited to be similar to those above.

Triggering code completion again appends nothing to log, but saving appends various lines including a PHP: database image is corrupted: /home/me/Test/.codelite/phpsymbols.db

Running sqlite3 /home/me/Test/.codelite/phpsymbols.db followed by PRAGMA quick_check; and PRAGMA integrity_check; both report ok.

@eranif

This comment has been minimized.

Show comment
Hide comment
@eranif

eranif Feb 12, 2017

Owner

I just realized that the the function PHPLookupTable::CheckDiskImage() throws an exception and does not really return value from the PRAGMA quick_check command. This may indicate that an older version of libwxsqlite3.so is used on your machine. So I added one more log message that prints the actual error message returned from the libwxsqlite3.so library

Please pull, try again and report back - thanks!

Owner

eranif commented Feb 12, 2017

I just realized that the the function PHPLookupTable::CheckDiskImage() throws an exception and does not really return value from the PRAGMA quick_check command. This may indicate that an older version of libwxsqlite3.so is used on your machine. So I added one more log message that prints the actual error message returned from the libwxsqlite3.so library

Please pull, try again and report back - thanks!

@JontyNewman

This comment has been minimized.

Show comment
Hide comment
@JontyNewman

JontyNewman Feb 12, 2017

Here's the output when saving test.php in the TestProject of Test:

[18:50:55:302 DBG] PHP: running lint: /usr/bin/php -l /home/me/Test/test.php
[18:50:55:305 WRN] PHP: exception caught: WXSQLITE_ERROR[1000]: Invalid field index
[18:50:55:306 WRN] PHP: database image is corrupted: /home/me/Test/.codelite/phpsymbols.db
[18:50:55:316 DBG] ContinuousBuild::OnFileSaved
[18:50:55:317 DBG] ContinuousBuild is disabled
[18:50:55:339 DBG] PHPLint: process terminated. output: PHP Parse error:  syntax error, unexpected end of file in /home/me/Test/test.php on line 6
Errors parsing /home/me/Test/test.php
[18:50:55:341 DBG] PHPLint: searching editor for file: /home/me/Test/test.php
[18:50:55:341 DBG] PHPLint: adding error marker @5

JontyNewman commented Feb 12, 2017

Here's the output when saving test.php in the TestProject of Test:

[18:50:55:302 DBG] PHP: running lint: /usr/bin/php -l /home/me/Test/test.php
[18:50:55:305 WRN] PHP: exception caught: WXSQLITE_ERROR[1000]: Invalid field index
[18:50:55:306 WRN] PHP: database image is corrupted: /home/me/Test/.codelite/phpsymbols.db
[18:50:55:316 DBG] ContinuousBuild::OnFileSaved
[18:50:55:317 DBG] ContinuousBuild is disabled
[18:50:55:339 DBG] PHPLint: process terminated. output: PHP Parse error:  syntax error, unexpected end of file in /home/me/Test/test.php on line 6
Errors parsing /home/me/Test/test.php
[18:50:55:341 DBG] PHPLint: searching editor for file: /home/me/Test/test.php
[18:50:55:341 DBG] PHPLint: adding error marker @5
@eranif

This comment has been minimized.

Show comment
Hide comment
@eranif

eranif Feb 12, 2017

Owner

I added one more log message + one possible fix - please give it a try now

Owner

eranif commented Feb 12, 2017

I added one more log message + one possible fix - please give it a try now

@JontyNewman

This comment has been minimized.

Show comment
Hide comment
@JontyNewman

JontyNewman Feb 12, 2017

Huzzah! PHP code completion is now appearing as it does on my Windows machine!

Here's the output of the log upon save if it's still of interest:

[19:04:01:549 DBG] PHP: running lint: /usr/bin/php -l /home/me/Test/test.php
[19:04:01:553 DBG] ContinuousBuild::OnFileSaved
[19:04:01:553 DBG] ContinuousBuild is disabled
[19:04:01:579 DBG] PHP: 'PRAGMA quick_check' returned: ok
[19:04:01:598 DBG] PHPLint: process terminated. output: PHP Parse error:  syntax error, unexpected end of file in /home/me/Test/test.php on line 6
Errors parsing /home/me/Test/test.php
[19:04:01:599 DBG] PHPLint: searching editor for file: /home/me/Test/test.php
[19:04:01:599 DBG] PHPLint: adding error marker @5

Thanks so much for your effort in resolving this issue eranif. I will certainly be donating to the project as a token of my gratitude. Keep up the great work!

JontyNewman commented Feb 12, 2017

Huzzah! PHP code completion is now appearing as it does on my Windows machine!

Here's the output of the log upon save if it's still of interest:

[19:04:01:549 DBG] PHP: running lint: /usr/bin/php -l /home/me/Test/test.php
[19:04:01:553 DBG] ContinuousBuild::OnFileSaved
[19:04:01:553 DBG] ContinuousBuild is disabled
[19:04:01:579 DBG] PHP: 'PRAGMA quick_check' returned: ok
[19:04:01:598 DBG] PHPLint: process terminated. output: PHP Parse error:  syntax error, unexpected end of file in /home/me/Test/test.php on line 6
Errors parsing /home/me/Test/test.php
[19:04:01:599 DBG] PHPLint: searching editor for file: /home/me/Test/test.php
[19:04:01:599 DBG] PHPLint: adding error marker @5

Thanks so much for your effort in resolving this issue eranif. I will certainly be donating to the project as a token of my gratitude. Keep up the great work!

@eranif

This comment has been minimized.

Show comment
Hide comment
@eranif

eranif Feb 12, 2017

Owner

Finally :) It seems that using "named index" is not possible with the version of libwxsqlite3.so that is shipped with ArchLinux

Owner

eranif commented Feb 12, 2017

Finally :) It seems that using "named index" is not possible with the version of libwxsqlite3.so that is shipped with ArchLinux

@Contineas

This comment has been minimized.

Show comment
Hide comment
@Contineas

Contineas Mar 28, 2018

Hello! Unfortunately I have same problem on Debian Stretch. I removed phpsymbols.db and reparsed the workspace. But I get "database image is corrupted". Should I build CodeLite from source? Or there is another solution?

P.S. Sorry, if my English is bad. My English teacher was too often distracted by vodka, balalaika and a tame bear.

Contineas commented Mar 28, 2018

Hello! Unfortunately I have same problem on Debian Stretch. I removed phpsymbols.db and reparsed the workspace. But I get "database image is corrupted". Should I build CodeLite from source? Or there is another solution?

P.S. Sorry, if my English is bad. My English teacher was too often distracted by vodka, balalaika and a tame bear.

@JontyNewman

This comment has been minimized.

Show comment
Hide comment
@JontyNewman

JontyNewman Jul 4, 2018

Hi @Contineas,

The issue above seemed to be related the the version of libwxsqlite3.so. I'm not sure which version CodeLite expects. Perhaps @eranif can tell you the version of the library that CodeLite depends on.

JontyNewman commented Jul 4, 2018

Hi @Contineas,

The issue above seemed to be related the the version of libwxsqlite3.so. I'm not sure which version CodeLite expects. Perhaps @eranif can tell you the version of the library that CodeLite depends on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment