Git Product home page Git Product logo

gedit-phpide's People

Contributors

addiks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

bacluc

gedit-phpide's Issues

Detect imported variable's types from inside anonymous functions

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
        };
    }
}

Replace search function with a better search

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.

Help the user writing use-statements themself

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.

Better separation of gedit-integration and PHP-analyzing-library

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.

Support more than just git as project-root

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.

Cannot show PHP menu in current GNOME Desktop

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.
zrzut ekranu z 2017-06-15 14-38-23

My gedit version : gedit - Version 3.22.0
My Python3 version: Python 3.5.3

Open implementation instead of declaration in interface when using open-declaration

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.

autocompletion issue

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

Automatically replace "mixed" type with determided type

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".

Automated tests

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?)

Cant enable in gedit 3.28.1

Hello, am trying to enable this plugin in gedit 3.28.1 with Ubuntu 18.04 and Python 2.7.15rc1 but every time the plugins goes disabled and show me a red icon next to the plugin entry.

Some1 could help me? thanks
captura de pantalla de 2018-07-17 11-24-13

Ubuntu 17.10 ModuleNotFoundError: No module named 'lxml'

(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'

Detect variable type per code-block using 'instanceof'

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.

Gedit can not activate the plugin

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'

problem with git submodules

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.

Rebuilding PHP-Index hangs

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)

Clear project index of trash-data

Currently when indexing a big project a lot of invalid data can be indexed. We should find out why this wrong data get indexed and prevent it from being added to the index.

bildschirmfoto vom 2018-01-18 23-21-45

Cannot autocomplete methods when using "parent::" in a namespaced class

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::
    }
}

Missing action PhpAction

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
  • Cloned this repo and copied the files to ~/.local/share/gedit/plugins/addiks-phpide/
  • Restarted Gedit and activated plugin
  • Open a .php file and no PHP menu item, only the error message above

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?

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.