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 112969 - calling CC in empy file -> exception
Summary: calling CC in empy file -> exception
Status: RESOLVED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: Daniel Prusa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-16 10:40 UTC by Radim Roska
Modified: 2009-02-27 14:26 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
stack trace (2.88 KB, text/plain)
2007-08-16 10:42 UTC, Radim Roska
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Radim Roska 2007-08-16 10:40:57 UTC
Product Version: NetBeans IDE Dev (Build 200708160000) 
Java: 1.6.0_02-ea; Java HotSpot(TM) Client VM 1.6.0_02-ea-b02

steps to reproduce:
1. create js file
2. ctrl + space to invoke CC => exception
Comment 1 Radim Roska 2007-08-16 10:42:56 UTC
Created attachment 46731 [details]
stack trace
Comment 2 Daniel Prusa 2007-08-22 09:40:51 UTC
reproducible
Comment 3 Daniel Prusa 2007-08-22 15:42:29 UTC
ISE exception fixed:

/cvs/languages/engine/src/org/netbeans/modules/languages/features/CompletionProviderImpl.java
new revision: 1.32; previous revision: 1.31

There is still one problem - code completion does not offer anything for empty files.
Comment 4 Daniel Prusa 2007-08-23 12:17:45 UTC
I think, this is P4 now because the list of items offered by code completion is empty only if the source file does not
contain any character, cc works when there are at least some whitespaces. It is a very rare usecase to invoke cc in a
totally empty file.

It cannot be fixed easily, since cc items definitions are based on tokens precedessing the caret position.
Comment 5 Torbjorn Norbye 2008-09-27 01:45:09 UTC
There was no exception anymore, but code completion was empty (because token lookup failed in an empty document, so
completion just returned). I've made it do normal (truncated, empty prefix) completion instead which seems reasonable.
Fixed in changeset 99aa1d857786.