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 178887 - No code completion in JS embedded in JSP
Summary: No code completion in JS embedded in JSP
Status: VERIFIED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
: 211068 213880 214984 217023 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-12-19 12:02 UTC by pradyutb
Modified: 2013-04-19 13:37 UTC (History)
7 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 pradyutb 2009-12-19 12:02:10 UTC
var dataString = 'content='+ boxval;
    dataString = dataString.replace("this", "another");


dataString.replace 

the replace function does not come up in the code completion.
I was editing inside a .jsp file.

thanks
Pradyut
Comment 1 Petr Hejl 2012-09-14 16:03:06 UTC
Still valid. Petre ca we do something about it?
Comment 2 Petr Hejl 2012-09-15 20:25:23 UTC
Issue #217023 might be duplicate of this one.
Comment 3 Martin Fousek 2012-09-17 22:30:10 UTC
It required a long time of debugging to figure out something which is mentioned at the beginning of the JsEmbeddingProvider class and we overlook that. :/

Anyway, this is finally fixed by one line fix in web-main #3b0570ca2b15.

CCing Tomas since I did change in their module. BTW Tomasi, one idea crossed my mind about sorting tasks in SourceCache#createTasks() according to SchedulerTask#getPriority()? But it's probably not suitable due to perf. troubles or another side effects, right?
Comment 4 Martin Fousek 2012-09-17 22:30:21 UTC
*** Bug 217023 has been marked as a duplicate of this bug. ***
Comment 5 Tomas Zezula 2012-09-18 09:05:14 UTC
Martine, I've already forgot the reason why the hack was added into SourceCache.
It was done by Marek,  hopefully he still knows the reason.
Anyway I can try the reported problem and try to remove the hack.
Comment 6 Martin Fousek 2012-09-18 11:56:52 UTC
(In reply to comment #5)
> Martine, I've already forgot the reason why the hack was added into
> SourceCache.
> It was done by Marek,  hopefully he still knows the reason.
> Anyway I can try the reported problem and try to remove the hack.

I think that the problem is that when you have two embedding for the same piece of code, you are probably not able to prioritize one of them?

So in our case ResultIterator#getParserResult() got first suitable embedding and returned ParserResult for it. We get somewhere in the GsfCompletionProvider HtmlParserResult instead of JsParserResult since there are two various embedding providers for HTML. But I'm probably missing the reason why is sometimes the embedding for css taken now - I'll talk to you offline, to explain it better.
Comment 7 Martin Fousek 2012-09-18 12:08:37 UTC
*** Bug 214984 has been marked as a duplicate of this bug. ***
Comment 8 Petr Hejl 2012-09-18 13:23:01 UTC
*** Bug 211068 has been marked as a duplicate of this bug. ***
Comment 9 Tomas Zezula 2012-09-18 16:00:51 UTC
I have a fix which removes the need of the .getClass().getName().equals() hack in the infrastructure.
It orders the EmbeddingProviders. While it seems good it causes CachingTest.testPreservesEmbeddingOrder to fail.
Comment 10 Quality Engineering 2012-09-19 03:02:15 UTC
Integrated into 'main-golden', will be available in build *201209190001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/3b0570ca2b15
User: Martin Fousek <marfous@netbeans.org>
Log: #178887 - No code completion in JS embedded in JSP
Comment 11 Tomas Zezula 2012-09-19 07:43:33 UTC
I will remove the hack.
Comment 12 Martin Fousek 2012-09-19 07:47:28 UTC
(In reply to comment #11)
> I will remove the hack.

I think that you have full support from us. ;) Sorry that I don't comment about "CachingTest.testPreservesEmbeddingOrder" but I think that I'm not able to detect possible risk of change of that test.
Comment 13 Tomas Zezula 2012-09-19 07:54:48 UTC
Fixed jet-main d161b061a759
Comment 14 Martin Fousek 2012-09-19 07:57:50 UTC
(In reply to comment #13)
> Fixed jet-main d161b061a759

Thank you Tomas.
Comment 15 Quality Engineering 2012-09-20 02:24:44 UTC
Integrated into 'main-golden', will be available in build *201209200001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/d161b061a759
User: Tomas Zezula <tzezula@netbeans.org>
Log: #178887:No code completion in JS embedded in JSP
Comment 16 Vladimir Riha 2012-09-20 10:57:54 UTC
Seems to be fine, code sample from issue 217023 is working in JSP/PHP/HTML. The snippet from description is working if you remove 

 dataString = dataString.replace("this", "another");

because return type is probably not recognized (issue 215764)


Product Version: NetBeans IDE Dev (Build 201209200001)
Java: 1.7.0_07; Java HotSpot(TM) Client VM 23.3-b01
System: Linux version 3.2.0-30-generic-pae running on i386; UTF-8; en_US (nb)
Comment 17 Martin Fousek 2012-09-26 13:58:12 UTC
*** Bug 213880 has been marked as a duplicate of this bug. ***