Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dynamic Languages Toolkit (DLTK) » Tabs in texteditor do not indent
Tabs in texteditor do not indent [message #527615] Thu, 15 April 2010 18:16 Go to next message
Eclipse UserFriend
Originally posted by: agranov.allmail.net

Hi!

Why would texteditor do not tabulate at all - zero space is added on
existing or added tab cahracters - if we turn on "show whitespace
characters" - the tab character overlays with text that was added after
the tab.

The text editor in question is DLTK extension of eclipse texteditor.

We had it once in 3.4 - we removed workspace and it did not happen again.

in 3.5 we have it all the time!

Any suspects :)

Thank you very much!

Gennady
Re: Tabs in texteditor do not indent [message #527644 is a reply to message #527615] Thu, 15 April 2010 21:55 Go to previous messageGo to next message
Walter Harley is currently offline Walter HarleyFriend
Messages: 847
Registered: July 2009
Senior Member
Gennady Agranov wrote:
> Hi!
>
> Why would texteditor do not tabulate at all - zero space is added on
> existing or added tab cahracters - if we turn on "show whitespace
> characters" - the tab character overlays with text that was added after
> the tab.
>
> The text editor in question is DLTK extension of eclipse texteditor.
>
> We had it once in 3.4 - we removed workspace and it did not happen again.
>
> in 3.5 we have it all the time!
>
> Any suspects :)
>
> Thank you very much!
>
> Gennady


How many spaces are your tabs set to show? (Window->Preferences,
General/Editors/Text Editors, Displayed tab width)
Re: Tabs in texteditor do not indent [message #527671 is a reply to message #527615] Fri, 16 April 2010 05:04 Go to previous messageGo to next message
Alex Panchenko is currently offline Alex PanchenkoFriend
Messages: 342
Registered: July 2009
Senior Member
Hi Gennady,

Probably it's a bug in the indentation code.

Could you please provide more details about DLTK version and what
particular language provided by DLTK do you use?

Thank you,
Alex

On 16/04/10 01:16, Gennady Agranov wrote:
> Hi!
>
> Why would texteditor do not tabulate at all - zero space is added on
> existing or added tab cahracters - if we turn on "show whitespace
> characters" - the tab character overlays with text that was added after
> the tab.
>
> The text editor in question is DLTK extension of eclipse texteditor.
>
> We had it once in 3.4 - we removed workspace and it did not happen again.
>
> in 3.5 we have it all the time!
>
> Any suspects :)
>
> Thank you very much!
>
> Gennady
Re: Tabs in texteditor do not indent [message #527825 is a reply to message #527644] Fri, 16 April 2010 14:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: agranov.allmail.net

Thanks!

4

All other texteditors - e.g. java - are fine - just dltk one has this issue

Walter Harley wrote:
> Gennady Agranov wrote:
>> Hi!
>>
>> Why would texteditor do not tabulate at all - zero space is added on
>> existing or added tab cahracters - if we turn on "show whitespace
>> characters" - the tab character overlays with text that was added
>> after the tab.
>>
>> The text editor in question is DLTK extension of eclipse texteditor.
>>
>> We had it once in 3.4 - we removed workspace and it did not happen again.
>>
>> in 3.5 we have it all the time!
>>
>> Any suspects :)
>>
>> Thank you very much!
>>
>> Gennady
>
>
> How many spaces are your tabs set to show? (Window->Preferences,
> General/Editors/Text Editors, Displayed tab width)
Re: Tabs in texteditor do not indent [message #527826 is a reply to message #527644] Fri, 16 April 2010 14:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: agranov.allmail.net

Thanks!

4

All other texteditors - e.g. java - are fine - just dltk one has this issue

Walter Harley wrote:
> Gennady Agranov wrote:
>> Hi!
>>
>> Why would texteditor do not tabulate at all - zero space is added on
>> existing or added tab cahracters - if we turn on "show whitespace
>> characters" - the tab character overlays with text that was added
>> after the tab.
>>
>> The text editor in question is DLTK extension of eclipse texteditor.
>>
>> We had it once in 3.4 - we removed workspace and it did not happen again.
>>
>> in 3.5 we have it all the time!
>>
>> Any suspects :)
>>
>> Thank you very much!
>>
>> Gennady
>
>
> How many spaces are your tabs set to show? (Window->Preferences,
> General/Editors/Text Editors, Displayed tab width)
Re: Tabs in texteditor do not indent [message #527827 is a reply to message #527671] Fri, 16 April 2010 15:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: agranov.allmail.net

1. we use DLTK that came with 352 bundle and we have our own language

2. we do extend DLTK ScriptEditor - just barely - to point to our
preference store and our texttools.

3. Thanks!

installed dltk plugins:

org.eclipse.dltk.console.ui_1.0.0.v20090610-1638.jar
org.eclipse.dltk.console_1.0.0.v20090610-1638.jar
org.eclipse.dltk.core_1.0.2.v20100209-1928.jar
org.eclipse.dltk.debug.ui_1.0.1.v20091111-1837.jar
org.eclipse.dltk.debug_1.0.0.v20090613-1432.jar
org.eclipse.dltk.formatter_1.0.1.v20090903-2153.jar
org.eclipse.dltk.launching_1.0.1.v20090910-1601.jar
org.eclipse.dltk.testing_1.0.0.v20090610-1638.jar
org.eclipse.dltk.ui_1.0.2.v20100209-1928.jar
org.eclipse.dltk.validators.core_1.0.0.v20090610-1638.jar
org.eclipse.dltk.validators.externalchecker_1.0.0.v20090610- 1638.jar
org.eclipse.dltk.validators.ui_1.0.0.v20090610-1638.jar
org.eclipse.dltk_1.0.1.v20090903-2153.jar







Alex Panchenko wrote:
> Hi Gennady,
>
> Probably it's a bug in the indentation code.
>
> Could you please provide more details about DLTK version and what
> particular language provided by DLTK do you use?
>
> Thank you,
> Alex
>
> On 16/04/10 01:16, Gennady Agranov wrote:
>> Hi!
>>
>> Why would texteditor do not tabulate at all - zero space is added on
>> existing or added tab cahracters - if we turn on "show whitespace
>> characters" - the tab character overlays with text that was added after
>> the tab.
>>
>> The text editor in question is DLTK extension of eclipse texteditor.
>>
>> We had it once in 3.4 - we removed workspace and it did not happen again.
>>
>> in 3.5 we have it all the time!
>>
>> Any suspects :)
>>
>> Thank you very much!
>>
>> Gennady
>
Re: Tabs in texteditor do not indent [message #529121 is a reply to message #527827] Fri, 23 April 2010 06:30 Go to previous messageGo to next message
Alex Panchenko is currently offline Alex PanchenkoFriend
Messages: 342
Registered: July 2009
Senior Member
Hi Gennady,

I am not sure what happens in your environment.

You should check that
- your preference store has values for preferences listed in
org.eclipse.dltk.ui.CodeFormatterConstants
- your IAutoEditStrategies/VerifyKeyListeners handle tab key correctly

Or just debug it.

Regards,
Alex


On 16/04/10 22:06, Gennady Agranov wrote:
> 1. we use DLTK that came with 352 bundle and we have our own language
>
> 2. we do extend DLTK ScriptEditor - just barely - to point to our
> preference store and our texttools.
>
> 3. Thanks!
>
> installed dltk plugins:
>
> org.eclipse.dltk.console.ui_1.0.0.v20090610-1638.jar
> org.eclipse.dltk.console_1.0.0.v20090610-1638.jar
> org.eclipse.dltk.core_1.0.2.v20100209-1928.jar
> org.eclipse.dltk.debug.ui_1.0.1.v20091111-1837.jar
> org.eclipse.dltk.debug_1.0.0.v20090613-1432.jar
> org.eclipse.dltk.formatter_1.0.1.v20090903-2153.jar
> org.eclipse.dltk.launching_1.0.1.v20090910-1601.jar
> org.eclipse.dltk.testing_1.0.0.v20090610-1638.jar
> org.eclipse.dltk.ui_1.0.2.v20100209-1928.jar
> org.eclipse.dltk.validators.core_1.0.0.v20090610-1638.jar
> org.eclipse.dltk.validators.externalchecker_1.0.0.v20090610- 1638.jar
> org.eclipse.dltk.validators.ui_1.0.0.v20090610-1638.jar
> org.eclipse.dltk_1.0.1.v20090903-2153.jar
>
>
>
>
>
>
>
> Alex Panchenko wrote:
>> Hi Gennady,
>>
>> Probably it's a bug in the indentation code.
>>
>> Could you please provide more details about DLTK version and what
>> particular language provided by DLTK do you use?
>>
>> Thank you,
>> Alex
>>
>> On 16/04/10 01:16, Gennady Agranov wrote:
>>> Hi!
>>>
>>> Why would texteditor do not tabulate at all - zero space is added on
>>> existing or added tab cahracters - if we turn on "show whitespace
>>> characters" - the tab character overlays with text that was added after
>>> the tab.
>>>
>>> The text editor in question is DLTK extension of eclipse texteditor.
>>>
>>> We had it once in 3.4 - we removed workspace and it did not happen
>>> again.
>>>
>>> in 3.5 we have it all the time!
>>>
>>> Any suspects :)
>>>
>>> Thank you very much!
>>>
>>> Gennady
>>
Re: Tabs in texteditor do not indent [message #532855 is a reply to message #529121] Tue, 11 May 2010 11:32 Go to previous messageGo to next message
Christian Pontesegger is currently offline Christian PonteseggerFriend
Messages: 70
Registered: July 2009
Location: Graz, Austria
Member
Same issue here. I have my own DLTK editor and no tabs are shown.

When a tab is hit the source gets modified, but the modification is not visible. Cursor position remains the same and no indentation is done.

When extending AbstractDLTKUILanguageToolkit I needed to implement a getPreferenceStore() method, which gives me the default IPreferencesStore from AbstracUIPlugin (Activator) - which should be fine.

ScriptEditor (DLTK) calls this from createCombinedPreferenceStore().

I do not think that my local PreferencesStore needs to have some properties regarding tabbing. Should be handled by the base classes, right?

Might be a bug...
Re: Tabs in texteditor do not indent [message #532858 is a reply to message #527615] Tue, 11 May 2010 11:45 Go to previous messageGo to next message
Christian Pontesegger is currently offline Christian PonteseggerFriend
Messages: 70
Registered: July 2009
Location: Graz, Austria
Member
Ran into the same issue just now.

There is a property in the preferences store called

"formatter.tabulation.size", which is set to 0 by default. This means a tab is inserted, but it is 0 spaces in length. Not a very useful default value Sad

Still there is an easy way to fix this:

In your IDLTKUILanguageToolkit implementation there should be a method called

public IPreferenceStore getPreferenceStore()

Wherever you get your preferences from, make sure "formatter.tabulation.size" is set to a useful value like 4.

You can do this by adding

getPreferenceStore().setValue("formatter.tabulation.size", 4);

to your code. Even better provide a preferences page to set this!

regards

Re: Tabs in texteditor do not indent [message #532878 is a reply to message #532858] Tue, 11 May 2010 13:01 Go to previous messageGo to next message
Alex Panchenko is currently offline Alex PanchenkoFriend
Messages: 342
Registered: July 2009
Senior Member
Hi Christian,

The recommended way to initialized preferences is as follows:

public class myUIPreferenceInitializer extends AbstractPreferenceInitializer {
	@Override
	public void initializeDefaultPreferences() {
		IPreferenceStore store = myUI.getDefault().getPreferenceStore();
...
		store.setDefault(CodeFormatterConstants.FORMATTER_TAB_CHAR, CodeFormatterConstants.SPACE);
		store.setDefault(CodeFormatterConstants.FORMATTER_TAB_SIZE, "2");
		store.setDefault(CodeFormatterConstants.FORMATTER_INDENTATION_SIZE, "2");
	}
}


and

<extension point="org.eclipse.core.runtime.preferences">
<initializer class="....myUIPreferenceInitializer"/>
</extension>


Regards,
Alex
Re: Tabs in texteditor do not indent [message #532882 is a reply to message #532878] Tue, 11 May 2010 13:12 Go to previous message
Alex Panchenko is currently offline Alex PanchenkoFriend
Messages: 342
Registered: July 2009
Senior Member
And the preference page:

import org.eclipse.dltk.ui.preferences.AbstractConfigurationBlockPreferencePage;
import org.eclipse.dltk.ui.preferences.EditorConfigurationBlock;
import org.eclipse.dltk.ui.preferences.IPreferenceConfigurationBlock;
import org.eclipse.dltk.ui.preferences.OverlayPreferenceStore;

public class myEditorPreferencesPage extends AbstractConfigurationBlockPreferencePage {

	@Override
	protected void setPreferenceStore() {
		setPreferenceStore(myUI.getDefault().getPreferenceStore());
	}

	@Override
	protected IPreferenceConfigurationBlock createConfigurationBlock(OverlayPreferenceStore overlayPreferenceStore) {
		return new EditorConfigurationBlock(this, overlayPreferenceStore);
	}
}
Previous Topic:[BUILD] S-2.0M7-201005050456
Next Topic:[BUILD] I-I201005130427-201005130427
Goto Forum:
  


Current Time: Sun Dec 21 12:08:20 GMT 2014

Powered by FUDForum. Page generated in 0.06342 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software