addiks / gedit-phpide Goto Github PK
View Code? Open in Web Editor NEWPHP-IDE functionalities for gedit
License: GNU General Public License v3.0
PHP-IDE functionalities for gedit
License: GNU General Public License v3.0
At the moment the plugin cannot detect the type of a variable inside an anonymous function if it was declared outside the anonymous function and then imported in the "use" part of the function.
Code to reproduce:
<?php
use DateTime;
class TypesInClosures
{
public function foo()
{
$foo = new DateTime();
$foo-> # <= Autocomplete works here
$bar = function () use ($foo) {
$foo-> # <= Autocomplete does NOT work here, but it should
};
}
}
Currently the project-index-search is slow. That is because it just executes a sequence of SQL select statements performing full-text-searches on several columns of the raw tables of the project-index.
There should be a dedicated data-structure for the project-search to improve the runtime-performance of the search. This new data-structure should also allow a more fuzzy search for a more misspell-tolerant search.
Currently the plugin does not provide any help when writing the use-statement manually. The planned workflow is that the plugin will add the whole use-statement automatically when auto-completing a class-name in the code. This is problematic for new users because they often do not know this planned workflow, try to write the use-statements manually and get frustrated at the plugin because it does not help the user at that point.
To fix that the plugin should detect when a user wants to write a use-statement manually and provide helpful auto-completion for that.
There should be a clear separation between the part that integrates with the gedit-API, the PHP analyzing library and the connecting logic between these two. The PHP library should be put into it's own git-repository to be able to re-use it other projects.
When the user add's a new interface to the set of interfaces a class implements the plugin should automaticly add template-methods for the methods that the interface defines (if they do not already exist).
Currently it is to be expected to use git to manage the projects as the project-index will be put into the ".git" folder. If the project does not have such a folder because it does not use git (or even has the repository in a different, maybe outside, folder) then this plugin can currently not be used with that project.
It should be possible to use other software (like svn, etc) as a project root and as a fallback just ask the user where to put the index for this project or just use it's own hidden folder.
Hi i have problem with your plugin. Im just installed it like it was written in your instruction, i was create catalog with local git repo and one index.php
file.
When i open file in gedit i have this message in terminal, and i thing it is problem with current version of gedit.
My gedit version : gedit - Version 3.22.0
My Python3 version: Python 3.5.3
When the user currently uses the open-declaration function on the method of an interface the method-declaration in that interface will be opened. Most of the time that is not what the user actually intends. What the user actually intends is to open the implementation of that method.
The plugin should detect the case when the user uses open-declaration with the method of an interface and instead looks for implementations of that interface-method. If it finds only one implementation it should open that implementation. If it finds multiple implementations, it should ask the user in a new window what implementation (including the declaration in the interface) it should open.
If the user actually intends to open the method-declaration in the interface and the implementation opens instead, he can still uses open-declaration on the interface-name in the implementing class.
i successfully build the index, but when i try autocompletion, i get the exception
Traceback (most recent call last):
File "/home/lucius/.local/share/gedit/plugins/gedit-phpide-master/AutocompleteProvider.py", line 196, in do_populate
hasIter, textIter = context.get_iter()
TypeError: 'TextIter' object is not iterable
There are a lot occurrences of a undetermined type declaration expressed as type "mixed". This plugin can determine the actual types of these declarations and replace the "mixed" type declaration with the actual type.
The most occurring example of this is the currently auto-generated type-declaration of local variables that currently will always be declared as "mixed".
For better stability and to prevent regression-bugs there should be a set of automated tests to run before each new version to verify that important functions do work as intended.
For one we need to find out how to do automated (unit- & integration-tests) in python, and for another we need to find out how to test the integration with the gedit-API (Mock it?)
(gedit:31692): Gtk-WARNING **: Allocating size to GtkOverlay 0x55bcc8a80cb0 without calling gtk_widget_get_preferred_width/height(). How does the code know the size to allocate?
(gedit:31692): libpeas-WARNING **: Error importing plugin 'addiks-phpide':
Traceback (most recent call last):
File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/mre/.local/share/gedit/plugins/gedit-phpide/addiks-phpide.py", line 17, in <module>
from addiks_phpide.AddiksPHPIDEApp import AddiksPHPIDEApp
File "/home/mre/.local/share/gedit/plugins/gedit-phpide/addiks_phpide/AddiksPHPIDEApp.py", line 23, in <module>
from .AddiksPhpGladeHandler import AddiksPhpGladeHandler
File "/home/mre/.local/share/gedit/plugins/gedit-phpide/addiks_phpide/AddiksPhpGladeHandler.py", line 27, in <module>
from .PHP.GraphMLExporter import GraphMLExporter
File "/home/mre/.local/share/gedit/plugins/gedit-phpide/addiks_phpide/PHP/GraphMLExporter.py", line 19, in <module>
from lxml import etree as xml
ModuleNotFoundError: No module named 'lxml'
(gedit:31692): libpeas-WARNING **: Error loading plugin 'addiks-phpide'
Currently every variable has one hard type per executed routine. This type is determined by the first type-declaration of this variable. Often this is not enough as a variable that was declared as a general type will be tested as a specific type (using "instanceof") and if true will be treated as this specific type. This plugin cannot yet reflect this "type-specialisation".
In the future the plugin should first try to detect the type of a variable at the place where the type was asked. For example it should look for occurrences of "instanceof" in or on the execution-branch that the place to analyze is in.
I'm using Ubuntu 22.04 and tried to use the Plugin for PHP Development.
Gedit is hanging, when I try to activate the plugin in the Settings.
Command Line tells me:
Traceback (most recent call last):
File "/home/wolfgang/.local/share/gedit/plugins/gedit-phpide/addiks_phpide/AddiksPHPIDEView.py", line 80, in __on_document_insert
if document.get_location() != None and insertedText in ['\n', ';', '=', '}']:
AttributeError: 'Document' object has no attribute 'get_location'
Traceback (most recent call last):
File "/home/wolfgang/.local/share/gedit/plugins/gedit-phpide/addiks_phpide/AddiksPHPIDEView.py", line 144, in __on_document_changed
if document.get_location() != None:
AttributeError: 'Document' object has no attribute 'get_location'
When running your plugin in a git submodule, there is a .git file, but no git path.
This is not checked and the storage Layer tries to create an index in
newGryfiPage/concrete5/packages/bacluc_event_package/.git/addiks.phpindex.sqlite3
, but should check that newGryfiPage/concrete5/packages/bacluc_event_package/.git is a file and the git folder is in newGryfiPage/.git
tried to fix it, but the nice function get_git_directory is never called before creating the index.
When I start the build index process in a project with 2222 php files to be indexed, it hangs at 1118th file, with the following error in terminal:
Unhandled exception in thread started by <bound method PhpIndex.build of <addiks_phpide.PHP.PhpIndex.PhpIndex object at 0x7fa37200a9e8>> Traceback (most recent call last): File "/home/mauro/.local/share/gedit/plugins/addiks_phpide/addiks_phpide/PHP/PhpIndex.py", line 67, in build self._index_directory(work_dir) File "/home/mauro/.local/share/gedit/plugins/addiks_phpide/addiks_phpide/PHP/PhpIndex.py", line 194, in _index_directory self._index_directory(entryPath) File "/home/mauro/.local/share/gedit/plugins/addiks_phpide/addiks_phpide/PHP/PhpIndex.py", line 194, in _index_directory self._index_directory(entryPath) File "/home/mauro/.local/share/gedit/plugins/addiks_phpide/addiks_phpide/PHP/PhpIndex.py", line 194, in _index_directory self._index_directory(entryPath) File "/home/mauro/.local/share/gedit/plugins/addiks_phpide/addiks_phpide/PHP/PhpIndex.py", line 200, in _index_directory self._index_phpfile(entryPath) File "/home/mauro/.local/share/gedit/plugins/addiks_phpide/addiks_phpide/PHP/PhpIndex.py", line 246, in _index_phpfile blocks, namespace, use_statements, use_statement_index, constants = parse_php_tokens(tokens) File "/home/mauro/.local/share/gedit/plugins/addiks_phpide/addiks_phpide/PHP/phptokenparser.py", line 33, in parse_php_tokens blocks, classes, classconstants, variables, constants, functions, namespace, use_statements, use_statement_index, uses, traitUses = __find_blocks_classes_functions(tokens) File "/home/mauro/.local/share/gedit/plugins/addiks_phpide/addiks_phpide/PHP/phptokenparser.py", line 124, in __find_blocks_classes_functions raise Exception("Invalid '}' (in '"+str(token[2])+'|'+str(token[3])+"'#"+str(tokenIndex)+")") Exception: Invalid '}' (in '248|13'#637)
Currently it seems that autocompleting methods from a parent class using the prefix "parent::" does not work inside a namespace.
<?php
namespace Addiks;
class Bar
{
public function baz()
{
}
public static function lorem()
{
}
}
class Foo extends Bar
{
public function baz()
{
parent::
Bar::
}
}
Thanks for the plugin. I'm migrating to trusty Gedit for a lighter development environment. I assume I'm missing something basic, but phpide is not working for me.
Running from the terminal in Lubuntu 14.04 I get the following error:
Gtk-WARNING **: PhpMenu: missing action PhpAction
I notice there is no mention of PhpAction
in the rest of the plugin code. Is this perhaps a call to a function in a dependency package I'm missing?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.