This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 121830 - LanguageDefinitionNotFoundException still happens
Summary: LanguageDefinitionNotFoundException still happens
Status: VERIFIED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: languages (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Daniel Prusa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-13 15:45 UTC by Masaki Katakai
Modified: 2008-01-30 05:13 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Masaki Katakai 2007-11-13 15:45:20 UTC
Product Version: NetBeans IDE 6.0 RC1 (Build 200711130000)
Java: 1.5.0_13; Java HotSpot(TM) Client VM 1.5.0_13-b05
System: Windows XP version 5.1 running on x86; MS932; ja_JP (nb)
Userdir: C:\Documents and Settings\katakai\.netbeans\6.0rc1

It seems that bug 113823 is still happening. I got this report from Japanese community.

1. Create Ruby and Rails project
2. Create yaml file
3. Add the following codes.

-------
foo:
  id: 1
  name: <%

-----

If lines are existing after <%, I can not input any characters and the following exception happens.


org.netbeans.api.languages.LanguageDefinitionNotFoundException: Language definition for text/x-ruby not found.
	at org.netbeans.modules.languages.LanguagesManager.getLanguage(LanguagesManager.java:132)
	at org.netbeans.modules.languages.features.BraceCompletionInsertAction.insertString(BraceCompletionInsertAction.java:92)
	at org.netbeans.editor.BaseKit$DefaultKeyTypedAction.actionPerformed(BaseKit.java:1060)
	at org.netbeans.editor.ext.ExtKit$ExtDefaultKeyTypedAction.actionPerformed(ExtKit.java:1000)
Comment 1 Daniel Prusa 2007-11-14 16:04:48 UTC
Reliably reproducible, the exception is thrown each time when a character is typed after <%
It is impossible to edit the embedded Ruby in this case. In general, the problem can occure whenever editing a
non-Schliemann language embeded in a Schliemann language, so, it would be good if we can fix this in nb 6.0

The fix of issue 113823 was incomplete, it is neccessary to ignore (catch and not report)
LanguageDefinitionNotFoundException also in BraceCompletionInsertAction and BraceCompletionDeleteAction, moreover, there
is one more occurence of it in CompletionSupport.

The fix is simple, just to add catch statement and delegate the action to the super class, resp. to remove the call of
ErrorManager.notify() in the third case. There should not be any risk if this is properly tested and we decide to merge
the fix into release60 branch.


Fixed in trunk:

/cvs/languages/engine/src/org/netbeans/modules/languages/features/BraceCompletionInsertAction.java
new revision: 1.10; previous revision: 1.9

/cvs/languages/engine/src/org/netbeans/modules/languages/features/CompletionSupport.java
new revision: 1.16; previous revision: 1.15

/cvs/languages/engine/src/org/netbeans/modules/languages/features/BraceCompletionDeleteAction.java
new revision: 1.8; previous revision: 1.7
Comment 2 Petr Blaha 2007-11-15 10:51:52 UTC
Masaki, can you verify the fix in the latest trunk build? The issue is pretty annoying and we are considering to fix it
in NB 6.0. Thanks
Comment 3 Petr Jiricka 2007-11-15 11:02:46 UTC
Indeed a really nasty problem, changing priority to P1.
Comment 4 Jan Jancura 2007-11-15 11:10:57 UTC
Reviewed.
Comment 5 Jiri Skrivanek 2007-11-16 13:50:11 UTC
Verified in trunk.
Comment 6 Martin Schovanek 2007-11-16 14:48:24 UTC
Verified in trunk by QE.
Comment 7 Daniel Prusa 2007-11-16 15:49:14 UTC
Fix merged into release60 branch.

Checking in BraceCompletionInsertAction.java;
/cvs/languages/engine/src/org/netbeans/modules/languages/features/BraceCompletionInsertAction.java,v  <-- 
BraceCompletionInsertAction.java
new revision: 1.8.4.1; previous revision: 1.8
Checking in CompletionSupport.java;
/cvs/languages/engine/src/org/netbeans/modules/languages/features/CompletionSupport.java,v  <--  CompletionSupport.java
new revision: 1.14.4.1; previous revision: 1.14
Checking in BraceCompletionDeleteAction.java;
/cvs/languages/engine/src/org/netbeans/modules/languages/features/BraceCompletionDeleteAction.java,v  <-- 
BraceCompletionDeleteAction.java
new revision: 1.7.4.1; previous revision: 1.7
Comment 8 Jiri Skrivanek 2007-11-19 12:06:35 UTC
Verified in 6.0.