Git Product home page Git Product logo

core-plugin's Introduction

PDT Extensions Group / Core Plugin

Build Status

The PDT extension group is a collobaration of PDT plugin maintainers to build a central PDT extension platform and codebase.

Currently the core plugin supports following features:

  • PHP Coding Standard Fixer integration
  • Use-Statement validation (injecting of missing use statements through quick-fixes) - PDT since 5.0 have own implementation
  • Class / Interface dialog - PDT since 5.0 have own dialogs
  • Implementation of missing interface/abstract classes methods - PDT since 5.0 have own implementation
  • Assign to local variable quick-fix - Moved to PDT 4.0
  • Import statements outline filters - PDT since 3.5 have same filters
  • Unused / uninitialized variable validator - Moved to PDT 6.0
  • PHP Refactoring support - PDT since 3.4 have own refactoring support

We are in the process of migrating general functionality of our plugins into the core plugin, and add more core features for other PDT extenders.

Join our mailinglist if you are interested in the discussion or want to help improve the PDT ecosystem.

Contributors

core-plugin's People

Contributors

gossi avatar hslavich avatar iteman avatar kaloyan-raev avatar mandos avatar mepeisen avatar pulse00 avatar redchrome avatar tbl0605 avatar zulus 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

Watchers

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

core-plugin's Issues

Formatter issue with control statements new line for do, try, and else

Strange display issue with the formatter when control statements have new lines on do, try, and else. When showing hidden character the correct number of spaces are there but things aren't lining up properly. I don't think it is font related as I'm using deja vu mono which has proper bold and normal spacing.

Installation of Core-Plugin will overwrite the PDT's code formatter

Code Formatter has been contributed recently to PDT (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=407768).

Please adjust Core-Plugin to make it compatible with new formatter (via contributing to profiles extension point).
At the moment installation of Core-Plugin (as part of Composer or Symfony feature) will overwrite the PDT's formatter and it's profiles.

Current implementation of processing contributions to org.eclipse.php.ui.phpFormatterPrefBlock allows only one extension to contribute to this extension point (see org.eclipse.php.internal.ui.preferences.PHPFormatterPreferencePage.getFormatterPreferencesBlock()). Depending on the order of extensions being processed either Core-Plugin will overwrite PDT's formatter or vice versa.

Rename Refactoring Support

Provides the following refactoring support:

  • Rename Type
  • Rename Method
  • Rename Field
    • Rename Property
    • Rename Static Property
    • Rename Constant
  • Rename Local Variable

Also the following rename refactoring are supported by DLTK:

  • Rename Project
  • Rename Project Fragment
  • Rename Script Folder
  • Rename Source Module

Known Issues

Update references does not work with Rename Static Property or Rename Constant.

SearchEngine.search() does not work properly for static properties or class constants.

No results were found when searching for static property or class constant with DLTKSearchConstants.REFERENCES.

Also when searching for static property or class constant with DLTKSearchConstants.ALL_OCCURRENCES, the declaration and references in the source module where the element is defined were matched. But other references in other soure modules were not matched.

New line before closing parenthesis in object allocation and function calls

I use these settings:

jp.sourceforge.pdt_tools.formatter.insert_new_line_after_opening_brace_in_array_initializer=insert
jp.sourceforge.pdt_tools.formatter.insert_new_line_before_closing_brace_in_array_initializer=insert

to have arrays formatted like this:

$array = array(
  0 => $first,
  1 => $second,
  2 => $third
);

And I'd like to have the same format for function calls and object allocations, e.g.

$object = new stdClass(
  $first,
  $second,
  new stdClass(
    $third,
    $fourth
  ),
  $last
);

instead I get:

$object = new stdClass(
  $first,
  $second,
  new stdClass(
    $third,
    $fourth), // <- I'd like new line before the closing parenthesis
  $last); // <- also here

The same applies for function calls. Would it be possible?

Getters/setters generation for doc properties

The editor already shows the dialog to generate getters/setters of properties in the class/interface doc, but if at least one attribute isn't declared with the same name of the property in doc the getters/setters code is not added.

This could be a nice functionality also, to add getters/setters to interfaces without declaration of attributes (of course it's an interface) using only the properties in the interface doc.

Tests

well, i guess we'll need to write tests sooner or later ;)

Formatter loading exception

On Mac OS X, since version 0.0.14 I get this error when opening PHP files:

Error creation processor for extension-point org.eclipse.php.ui.phpFormatterProcessor
Plug-in org.pdtextensions.core.ui was unable to load class org.pdtextensions.core.ui.ast.Formatter.
org/pdtextensions/core/ui/ast/Formatter : Unsupported major.minor version 51.0

I'm updated with the latest versions of Eclipse (4.3.0), PDT (3.2.0.201302261714) and Extensions (0.0.15).
The error triggers also on a clean Mac OS X, clean Eclipse (just PDT and Extensions installed), clean workspace.

Wrong indentation for array initializer

I set my preferred array initializer indentation on Preferences > PHP > Code Style > Fromatter > Line Wrapping, but while typing array initializers indentation is wrong:

$arr = array([ENTER]
····[CURSOR])

while I'm expecting:

$arr = array([ENTER]
··[CURSOR]
)

like it happens editing Javascript code. Note that the wrong indentation happens only while typing, whereas an explicit CTRL+SHIFT+F indents array initializers correctly.

PTI Tool with PDT 3.1.2

mepeisen sed that I should add this error here.

PTI (CodeSniffer etc..) its not updated from 2 years, but after last updates I have this error after eclipse start. Its because 4 days ago, org.eclipse.php.internal.debug.core.launching.PHPLaunchUtilities.getCommandLine got new argument String phpVersion.

If this is PDT error, no problem. I'll after a moment try send it to PDT forum. If not, we have a problem because phpsrc is (as I see) is no longer maintained.

How you think, is possible to fork/move this projects into github?

Error:

Errors running builder 'Script Builder' on project 'mow'.

java.lang.NoSuchMethodError: org.eclipse.php.internal.debug.core.launching.PHPLaunchUtilities.getCommandLine(Lorg/eclipse/debug/core/ILaunchConfiguration;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)[Ljava/lang/String;
    at org.phpsrc.eclipse.pti.core.launching.PHPToolExecutableLauncher.launch(PHPToolExecutableLauncher.java:113)
    at org.phpsrc.eclipse.pti.core.launching.PHPToolExecutableLauncher.launch(PHPToolExecutableLauncher.java:60)
    at org.phpsrc.eclipse.pti.core.launching.PHPToolExecutableLauncher.launch(PHPToolExecutableLauncher.java:55)
    at org.phpsrc.eclipse.pti.core.launching.PHPToolLauncher.launch(PHPToolLauncher.java:164)
    at org.phpsrc.eclipse.pti.core.launching.PHPToolLauncher.launch(PHPToolLauncher.java:113)
    at org.phpsrc.eclipse.pti.validators.externalchecker.core.ExternalPHPCheckerDelegate.runValidator(ExternalPHPCheckerDelegate.java:99)
    at org.phpsrc.eclipse.pti.validators.externalchecker.core.ExternalSourceModuleWorker.runValidator(ExternalSourceModuleWorker.java:69)
    at org.eclipse.dltk.validators.core.SourceModuleValidatorWorker.runValidator(SourceModuleValidatorWorker.java:67)
    at org.eclipse.dltk.validators.core.AbstractValidatorWorker.validate(AbstractValidatorWorker.java:148)
    at org.eclipse.dltk.validators.core.AbstractValidatorWorker.doValidate(AbstractValidatorWorker.java:126)
    at org.eclipse.dltk.validators.core.SourceModuleValidatorWorker.validate(SourceModuleValidatorWorker.java:37)
    at org.eclipse.dltk.validators.core.ValidatorRuntime.executeSourceModuleValidators(ValidatorRuntime.java:448)
    at org.eclipse.dltk.validators.internal.core.ValidatorBuilder.build(ValidatorBuilder.java:50)
    at org.eclipse.dltk.internal.core.builder.ScriptBuilder.fullBuild(ScriptBuilder.java:449)
    at org.eclipse.dltk.internal.core.builder.ScriptBuilder.build(ScriptBuilder.java:156)
    at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239)
    at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295)
    at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351)
    at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374)
    at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
    at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

Sorry for my english ;)

Newline between Function doc and function start

I have the problem that if i format my code there is a empty line generated between the function documentation/variable decleration and the function/variable itself. I have checked the formation options menu but I haven't found any config how I can change this (originally reported by @fkrauthan )

<?php

    protected $foo;
    /**
     * @return integer
     */
    public function aha()
    {
        return 10;
    }

should get formatted as

<?php

    protected $foo;

    /**
     * @return integer
     */
    public function aha()
    {
        return 10;
    }

Unused use statements

It would be useful if use statements would be marked as warnings if they are unused inside a php class.

Do not format single-element arrays

Request for formatter plugin option(s) to bypass formatting/wrapping arrays with only one member, inside and outside parameters, such as the following:

array('stuff')
array('key' => 'val')
someFunction(array('key' => 'val'));

In other words, a sibling option to:

Line Wrapping

Settings for array initializers

Force split, even if line shorter than maximum line width.

Thanks!

Exception during startup on latest build

Plug-in org.pdtextensions.core.ui was unable to load class org.pdtextensions.core.ui.Starter.

org.eclipse.core.runtime.CoreException: Plug-in org.pdtextensions.core.ui was unable to load class org.pdtextensions.core.ui.Starter.
    at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
    at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:176)
    at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
    at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
    at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
    at org.eclipse.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugin.java:282)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:52)
    at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:278)
    at org.eclipse.ui.internal.EarlyStartupRunnable.getExecutableExtension(EarlyStartupRunnable.java:117)
    at org.eclipse.ui.internal.EarlyStartupRunnable.run(EarlyStartupRunnable.java:66)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.ui.internal.Workbench$55.run(Workbench.java:2552)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.lang.ClassNotFoundException: org.pdtextensions.core.ui.Starter cannot be found by org.pdtextensions.core.ui_0.16.0.201305191231
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:340)
    at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1212)
    at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
    ... 11 more

Generate getters and setters with fluent interface

In the Getters and Setters command dialog there is a checkbox for generating fluent interface for the getters/setters. The checkbox is checked by default. But when the command is executed, it does not generate methods with fluent interface.
But if I uncheck it first and then check it again the get/set methods get created correctly with fluent interface.

Error when generating Getter / Setter for properties starting with underscore

<?php

class AchDetail {
    protected $_transaction_code;
}

Stack trace

java.lang.StringIndexOutOfBoundsException: String index out of range: 1
at java.lang.String.substring(String.java:1946)
at com.dubture.pdt.core.util.Inflector.camelCase(Inflector.java:145)
at com.dubture.pdt.ui.util.GetterSetterUtil.prepareField(GetterSetterUtil.java:138)
at com.dubture.pdt.ui.util.GetterSetterUtil.getSetterName(GetterSetterUtil.java:116)
at com.dubture.pdt.ui.actions.GenerateGettersHandler$GetterSetterEntry.getIdentifier(GenerateGettersHandler.java:511)
at com.dubture.pdt.ui.actions.GenerateGettersHandler$GetterSetterEntry.getName(GenerateGettersHandler.java:539)
at com.dubture.pdt.ui.actions.GenerateGettersHandler$GetterSetterLabelProvider.getText(GenerateGettersHandler.java:173)
at org.eclipse.jface.viewers.WrappedViewerLabelProvider.getText(WrappedViewerLabelProvider.java:108)
at org.eclipse.jface.viewers.WrappedViewerLabelProvider.update(WrappedViewerLabelProvider.java:164)`

(originally reported by @jromero)

Interface implemented by trait

The class Phone must implement the inherited abstract method

interface ToArrayInterface
{
   public function toArray();
}

trait ToArrayTrait
{
  public function toArray()
  {
    return get_object_vars($this);
  }
}

class Phone implements ToArrayInterface
{
  use ToArrayTrait;
}

note: this error can exists, because I not see included methods on outline.

Add "Organize Imports" feature

In Java editor we have this feature in [ >] Source > Organize Imports, with the keyboard shortcut Ctrl+Shift+O. PHP editor misses it, and this extension could kindly implements it :p

(Original issue created by @Dentxinho )

Migrate SemantiAnalysis validator from WTP to DLTK

Currently Core-Plugin uses WTP Validator V2 framework and it works but have some problems:

  • Many times it run before dltk build will complete and we have invalid markers
  • After create not existed class I have to rerun whole validation process

My propose is it ino dltk validator like php external scritpt validator or by dltk ScriptBuilder extension points.

Dependency issue

Hi,

Today when I wanted upgrade DLTK 5 I got this issue:

Cannot complete the install because of a conflicting dependency.
  Software being installed: Dynamic Languages Toolkit - Core Frameworks 5.0.0.201304162111 (org.eclipse.dltk.core.feature.group 5.0.0.201304162111)
  Software currently installed: Composer 1.0.2.201304151710 (com.dubture.composer.feature.feature.group 1.0.2.201304151710)
  Only one of the following can be installed at once: 
    Dynamic Languages Toolkit Core 4.0.0.201206120848 (org.eclipse.dltk.core 4.0.0.201206120848)
    Dynamic Languages Toolkit Core 5.0.0.201304051211 (org.eclipse.dltk.core 5.0.0.201304051211)
    org.eclipse.dltk.core 5.0.0.201304162111
  Cannot satisfy dependency:
    From: Composer 1.0.2.201304151710 (com.dubture.composer.feature.feature.group 1.0.2.201304151710)
    To: org.pdtextensions.feature.feature.group 0.16.0
  Cannot satisfy dependency:
    From: Dynamic Languages Toolkit - Core Frameworks 5.0.0.201304162111 (org.eclipse.dltk.core.feature.group 5.0.0.201304162111)
    To: org.eclipse.dltk.core [5.0.0.201304162111]
  Cannot satisfy dependency:
    From: PDT Extensions 0.16.0.201304151622 (org.pdtextensions.feature.feature.group 0.16.0.201304151622)
    To: org.pdtextensions.server.ui [0.16.0.201304151622]
  Cannot satisfy dependency:
    From: PDT Extensions Server UI Plugin 0.16.0.201304151622 (org.pdtextensions.server.ui 0.16.0.201304151622)
    To: package org.eclipse.dltk.core 0.0.0

Space before parenthesis in anonymous functions

I see no option to avoid the space after function and use keywords in anonymous function declaration, like in:

$server->on('request', function ($request) use ($dispatcher) {
  $response = $dispatcher->dispatch($request);
  $this->send($response);
});

It would be useful since Formatter adds spaces even if there are none before formatting.

NPE in PEXValidator

Just working on the composer-plugin. I got this on my stacktrace:

!ENTRY org.eclipse.wst.validation 4 0 2013-04-01 01:40:44.859
!MESSAGE 
!STACK 0
java.lang.NullPointerException
    at org.pdtextensions.core.validation.PEXValidator.validateFile(PEXValidator.java:113)
    at org.pdtextensions.core.validation.PEXValidator.validate(PEXValidator.java:94)
    at org.eclipse.wst.validation.Validator$V2.validate(Validator.java:1159)
    at org.eclipse.wst.validation.internal.ValManager.validate(ValManager.java:704)
    at org.eclipse.wst.validation.internal.ValManager$1.visit(ValManager.java:665)
    at org.eclipse.wst.validation.internal.ValManager.accept(ValManager.java:810)
    at org.eclipse.wst.validation.internal.ValManager.validate(ValManager.java:669)
    at org.eclipse.wst.validation.internal.ValBuilderJob$Visitor.visit(ValBuilderJob.java:299)
    at org.eclipse.core.internal.resources.Resource$2.visit(Resource.java:126)
    at org.eclipse.core.internal.resources.Resource$1.visitElement(Resource.java:85)
    at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:82)
    at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
    at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
    at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
    at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
    at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
    at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
    at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
    at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
    at org.eclipse.core.internal.watson.ElementTreeIterator.doIteration(ElementTreeIterator.java:86)
    at org.eclipse.core.internal.watson.ElementTreeIterator.iterate(ElementTreeIterator.java:127)
    at org.eclipse.core.internal.resources.Resource.accept(Resource.java:95)
    at org.eclipse.core.internal.resources.Resource.accept(Resource.java:52)
    at org.eclipse.core.internal.resources.Resource.accept(Resource.java:124)
    at org.eclipse.core.internal.resources.Resource.accept(Resource.java:108)
    at org.eclipse.wst.validation.internal.ValBuilderJob.fullBuild(ValBuilderJob.java:219)
    at org.eclipse.wst.validation.internal.ValBuilderJob.run(ValBuilderJob.java:178)
    at org.eclipse.wst.validation.internal.ValBuilderJob.runInWorkspace(ValBuilderJob.java:126)
    at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

Generate magic methods dialog

A dialog listing/generating all unimplemented magic methods - similar to the "Generate delegate methods..." in JDT.

PHP 5.4 array syntax formatting

I would expect the same indentation between legacy and new array syntax:

$array = array(
    "foo" => "bar",
    "bar" => "foo"
);

$array = [
    "foo" => "bar",
    "bar" => "foo"
];

but instead I get:

$array = array(
    "foo" => "bar",
    "bar" => "foo"
);

$array =
    ["foo" => "bar",
    "bar" => "foo"];

Improve autocompletion (based on comments)

It would be interesting if PDT could resolve type of elements in arrays based on “[]” in PHPDoc blocks for method of classes.

For example, with PDT 3.1.1, we have autocompletion for getName() in such example:

class Employee {
    public function getName() {}
    public function getSalary() {}
}

class Company {

    /**
     * @return Employee[]
     */
    public function getListOfEmployees() {
    }
}

$company = new Company();
$employees = $company->getListOfEmployees();
$employees[0]->getName();

But we don't have it in the following case:

class Company {

    /**
     * @var Employee[]
     */
    private $employees = null;

    public function setEmployees(array $employees) {
        $this->employees = $employees;
    }

    public function getEmployees() {
        return $this->employees;
    }
}

$company = new Company();
$employees = $company->getEmployees();
$employees[0]->getName(); // We don't have autocompletion here

In the following case the autocompletion doesn't works too:

class Company {

    /**
     * @param Employee[] $employees
     */
    public function addEmployees(array $employees) {
        $employees[0]->getName(); // We don't have autocompletion here
    }
}

Add missing feature from original plugin maintainer

The formatter plugin here

location: http://sourceforge.jp/users/atlanto/pf/eclipse/files

filename: pdt_tools.formatter_1.5.0.v20120929.zip

contains an additional option group:

New lines

Function/Method call

This option is missing from the plugin available from this repo.

Problem with "Inject missing use statement"

The "Inject missing use statement" feature doesn't work correctly because the missing statements don't get inserted in the right place.

For instance i have an object where the use statement for the EntityRepository is not imported:

namespace Xyz\Repository;

use Xyz\Entity\ProgramExecution;

/**
*. ProgramExecutionRepository
*/
class ProgramExecutionRepository extends EntityRepository

But when the missing use statement gets inserted via the "Inject missing use statement" feature, it looks like this:

namespace Xyz\Repository;

use Xyz\Entity\ProgramExecution;

/**
*. ProgramExecutionRepository
*/

use Doctrine\ORM\EntityRepository;

class ProgramExecutionRepository extends EntityRepository

As you can see it gets inserted between the comment and the class definition, but it should be inserted between the Xyz\Entity\ProgramExecution statement and the beginning of the comment.

Codeassist for superclass methods

This is already available by triggering codeassist in an inherited class, but it would be better to provide an explicit entry in the Source / Refactor entry of the right-click context menu.

'Building workspace' has encountered a problem.

Hi,

Each time I save a .php file, an error pops up:

Errors occurred during the build.
Errors running builder 'Script Builder' on project 'Niloo Design 2'.
org.eclipse.php.internal.core.compiler.ast.parser.PHPSourceParserFactory.parse([C[CLorg/eclipse/dltk/compiler/problem/IProblemReporter;)Lorg/eclipse/dltk/ast/declarations/ModuleDeclaration;

This is very anoying because it pops at all time...

Ps : If you disable "Build automatically" in the preferences, then a pop up saying "Saving failed" pops...

Code Formatter wrap line bug

3x4 spaces indent


            $this->_writeDescriptions($aObjectToWrite, $this->_config->tables->description->table);
            $this->_writeDescriptions($aObjectToWrite->getAdjusted(), $this->_config->tables->adjustedDescription->table);

code formatter produce with:

  • Maximum line width: 115
  • Default indantion for wrapped lines: 2

            $this->_writeDescriptions($aObjectToWrite, $this->_config->tables->description->table);
            $this
                    ->_writeDescriptions($aObjectToWrite->getAdjusted(),
                            $this->_config->tables->adjustedDescription->table);

(originally reported by @fwilly)

String index out of range: 1

Note:
I'm using the OLD stable version from p2.dubture.com

When I tried to generate setters & getters, it reported two same errors: "string index out of range:1"

Here's the minimal source code file that can reproduce these errors:

<?php
class MyClass {
private $_client = null;
}

Here's eclipse error log:

!ENTRY org.eclipse.ui 4 4 2013-04-15 14:40:45.771
!MESSAGE Conflicting handlers for org.eclipse.wst.sse.ui.toggle.comment: {org.eclipse.php.internal.ui.actions.PHPToggleLineCommentHandler@6c592ddc} vs {org.eclipse.wst.sse.ui.internal.handlers.ToggleLineCommentHandler@52d1fe16}

!ENTRY org.eclipse.jface 4 2 2013-04-15 14:40:47.203
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface".
!STACK 0
java.lang.StringIndexOutOfBoundsException: String index out of range: 1
    at java.lang.String.substring(String.java:1907)
    at com.dubture.pdt.core.util.Inflector.camelCase(Inflector.java:145)
    at com.dubture.pdt.ui.util.GetterSetterUtil.prepareField(GetterSetterUtil.java:138)
    at com.dubture.pdt.ui.util.GetterSetterUtil.getGetterName(GetterSetterUtil.java:124)
    at com.dubture.pdt.ui.actions.GenerateGettersHandler$GetterSetterEntry.getIdentifier(GenerateGettersHandler.java:510)
    at com.dubture.pdt.ui.actions.GenerateGettersHandler$GetterSetterEntry.getName(GenerateGettersHandler.java:530)
    at com.dubture.pdt.ui.actions.GenerateGettersHandler$GetterSetterLabelProvider.getText(GenerateGettersHandler.java:173)
    at org.eclipse.jface.viewers.WrappedViewerLabelProvider.getText(WrappedViewerLabelProvider.java:108)
    at org.eclipse.jface.viewers.WrappedViewerLabelProvider.update(WrappedViewerLabelProvider.java:164)
    at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:152)
    at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:953)
    at org.eclipse.jface.viewers.CheckboxTreeViewer.doUpdateItem(CheckboxTreeViewer.java:120)
    at org.eclipse.jface.viewers.AbstractTreeViewer$UpdateItemSafeRunnable.run(AbstractTreeViewer.java:113)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
    at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:1033)
    at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:485)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
    at org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:2167)
    at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:848)
    at org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractTreeViewer.java:823)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:797)
    at org.eclipse.jface.viewers.TreeViewer.createChildren(TreeViewer.java:644)
    at org.eclipse.jface.viewers.AbstractTreeViewer.internalExpandToLevel(AbstractTreeViewer.java:1770)
    at org.eclipse.jface.viewers.AbstractTreeViewer.internalExpandToLevel(AbstractTreeViewer.java:1780)
    at org.eclipse.jface.viewers.AbstractTreeViewer.expandToLevel(AbstractTreeViewer.java:1075)
    at org.eclipse.jface.viewers.AbstractTreeViewer.expandToLevel(AbstractTreeViewer.java:1056)
    at org.eclipse.jface.viewers.AbstractTreeViewer.expandAll(AbstractTreeViewer.java:1045)
    at com.dubture.pdt.ui.dialog.GetterSetterDialog.createTreeViewer(GetterSetterDialog.java:236)
    at org.eclipse.ui.dialogs.CheckedTreeSelectionDialog.createDialogArea(CheckedTreeSelectionDialog.java:290)
    at com.dubture.pdt.ui.dialog.GetterSetterDialog.createDialogArea(GetterSetterDialog.java:102)
    at org.eclipse.jface.dialogs.Dialog.createContents(Dialog.java:760)
    at org.eclipse.jface.window.Window.create(Window.java:431)
    at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
    at org.eclipse.ui.dialogs.SelectionStatusDialog.create(SelectionStatusDialog.java:153)
    at org.eclipse.ui.dialogs.CheckedTreeSelectionDialog.access$superCreate(CheckedTreeSelectionDialog.java:247)
    at org.eclipse.ui.dialogs.CheckedTreeSelectionDialog.access$0(CheckedTreeSelectionDialog.java:246)
    at org.eclipse.ui.dialogs.CheckedTreeSelectionDialog$1.run(CheckedTreeSelectionDialog.java:272)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.dialogs.CheckedTreeSelectionDialog.create(CheckedTreeSelectionDialog.java:270)
    at org.eclipse.jface.window.Window.open(Window.java:790)
    at org.eclipse.ui.dialogs.CheckedTreeSelectionDialog.open(CheckedTreeSelectionDialog.java:242)
    at com.dubture.pdt.ui.actions.GenerateGettersHandler.execute(GenerateGettersHandler.java:236)
    at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:290)
    at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:76)
    at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:231)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:212)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:131)
    at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:171)
    at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:831)
    at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.handleWidgetSelection(HandledContributionItem.java:724)
    at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.access$7(HandledContributionItem.java:708)
    at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem$4.handleEvent(HandledContributionItem.java:647)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1053)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:942)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1438)

!ENTRY org.eclipse.jface 4 2 2013-04-15 14:40:47.238
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface".
!STACK 0
java.lang.StringIndexOutOfBoundsException: String index out of range: 1
    at java.lang.String.substring(String.java:1907)
    at com.dubture.pdt.core.util.Inflector.camelCase(Inflector.java:145)
    at com.dubture.pdt.ui.util.GetterSetterUtil.prepareField(GetterSetterUtil.java:138)
    at com.dubture.pdt.ui.util.GetterSetterUtil.getSetterName(GetterSetterUtil.java:116)
    at com.dubture.pdt.ui.actions.GenerateGettersHandler$GetterSetterEntry.getIdentifier(GenerateGettersHandler.java:511)
    at com.dubture.pdt.ui.actions.GenerateGettersHandler$GetterSetterEntry.getName(GenerateGettersHandler.java:539)
    at com.dubture.pdt.ui.actions.GenerateGettersHandler$GetterSetterLabelProvider.getText(GenerateGettersHandler.java:173)
    at org.eclipse.jface.viewers.WrappedViewerLabelProvider.getText(WrappedViewerLabelProvider.java:108)
    at org.eclipse.jface.viewers.WrappedViewerLabelProvider.update(WrappedViewerLabelProvider.java:164)
    at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:152)
    at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:953)
    at org.eclipse.jface.viewers.CheckboxTreeViewer.doUpdateItem(CheckboxTreeViewer.java:120)
    at org.eclipse.jface.viewers.AbstractTreeViewer$UpdateItemSafeRunnable.run(AbstractTreeViewer.java:113)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
    at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:1033)
    at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:485)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
    at org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:2167)
    at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:848)
    at org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractTreeViewer.java:823)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:797)
    at org.eclipse.jface.viewers.TreeViewer.createChildren(TreeViewer.java:644)
    at org.eclipse.jface.viewers.AbstractTreeViewer.internalExpandToLevel(AbstractTreeViewer.java:1770)
    at org.eclipse.jface.viewers.AbstractTreeViewer.internalExpandToLevel(AbstractTreeViewer.java:1780)
    at org.eclipse.jface.viewers.AbstractTreeViewer.expandToLevel(AbstractTreeViewer.java:1075)
    at org.eclipse.jface.viewers.AbstractTreeViewer.expandToLevel(AbstractTreeViewer.java:1056)
    at org.eclipse.jface.viewers.AbstractTreeViewer.expandAll(AbstractTreeViewer.java:1045)
    at com.dubture.pdt.ui.dialog.GetterSetterDialog.createTreeViewer(GetterSetterDialog.java:236)
    at org.eclipse.ui.dialogs.CheckedTreeSelectionDialog.createDialogArea(CheckedTreeSelectionDialog.java:290)
    at com.dubture.pdt.ui.dialog.GetterSetterDialog.createDialogArea(GetterSetterDialog.java:102)
    at org.eclipse.jface.dialogs.Dialog.createContents(Dialog.java:760)
    at org.eclipse.jface.window.Window.create(Window.java:431)
    at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
    at org.eclipse.ui.dialogs.SelectionStatusDialog.create(SelectionStatusDialog.java:153)
    at org.eclipse.ui.dialogs.CheckedTreeSelectionDialog.access$superCreate(CheckedTreeSelectionDialog.java:247)
    at org.eclipse.ui.dialogs.CheckedTreeSelectionDialog.access$0(CheckedTreeSelectionDialog.java:246)
    at org.eclipse.ui.dialogs.CheckedTreeSelectionDialog$1.run(CheckedTreeSelectionDialog.java:272)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.dialogs.CheckedTreeSelectionDialog.create(CheckedTreeSelectionDialog.java:270)
    at org.eclipse.jface.window.Window.open(Window.java:790)
    at org.eclipse.ui.dialogs.CheckedTreeSelectionDialog.open(CheckedTreeSelectionDialog.java:242)
    at com.dubture.pdt.ui.actions.GenerateGettersHandler.execute(GenerateGettersHandler.java:236)
    at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:290)
    at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:76)
    at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:231)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:212)
    at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:131)
    at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:171)
    at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:831)
    at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.handleWidgetSelection(HandledContributionItem.java:724)
    at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.access$7(HandledContributionItem.java:708)
    at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem$4.handleEvent(HandledContributionItem.java:647)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1053)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:942)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1438)

!ENTRY org.eclipse.ui 4 4 2013-04-15 14:40:47.266
!MESSAGE Conflicting handlers for org.eclipse.wst.sse.ui.toggle.comment: {org.eclipse.php.internal.ui.actions.PHPToggleLineCommentHandler@6c592ddc} vs {org.eclipse.wst.sse.ui.internal.handlers.ToggleLineCommentHandler@52d1fe16}

!ENTRY org.eclipse.ui 4 4 2013-04-15 14:40:48.643
!MESSAGE Conflicting handlers for org.eclipse.wst.sse.ui.toggle.comment: {org.eclipse.php.internal.ui.actions.PHPToggleLineCommentHandler@6c592ddc} vs {org.eclipse.wst.sse.ui.internal.handlers.ToggleLineCommentHandler@52d1fe16}

!ENTRY org.eclipse.ui 4 4 2013-04-15 14:40:50.462
!MESSAGE Conflicting handlers for org.eclipse.wst.sse.ui.toggle.comment: {org.eclipse.php.internal.ui.actions.PHPToggleLineCommentHandler@6c592ddc} vs {org.eclipse.wst.sse.ui.internal.handlers.ToggleLineCommentHandler@52d1fe16}

Move a class to a new folder/namespace, update references

If I have a class under name\space\Class and am going to move it to new\name\space\Class. Can all the references (e.g. all use statements, all \name\space\Class statements and the namespace statement in the class itself) updated, according to the new namespace?

Assuming the project follows psr-0.

(originally reported by @gossi)

Keep lines starting with // untouched?

In eclipse I can toggle a bunch of loc with cmd+7 (shift+ctrl+7) and eclipse marks all lines with the double-slash comment at the very beginning of the line. Though the formatter indents them. Well, if you untoggle them, they are wrongly indented, because of the indentation happened when the formatter indented them with the comment in front.

I don't have found the setting to avoid this. Is there one? If not, can there be one to address this?

(originally reported by @gossi)

Vadidation works very slow

Lately I'm experiencing problems with validation of my projects.
It works very slow and freezes few times during validation of a project. At the end it hags completely and throws the following errors:

An internal error occurred during: "Searching for markers".
GC overhead limit exceeded

or;

An internal error occurred during: "Validating xyz".
GC overhead limit exceeded

or:

An internal error occurred during: "Validating xyz".
Java heap space

It seams that the validation is consuming a big amount of memory. I have the default memory settings for eclipse and it worked without problems until a recent update.

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.