Menu

#99 NPE when using code completion on an external file

open
nobody
None
5
2007-12-05
2007-12-05
No

1. Open an external C# file with File > Open File...
2. Put your cursor within a method.
3. Type 'this.'
4. NPE is thrown.

Discussion

  • Dominik Ertl

    Dominik Ertl - 2007-12-06

    Logged In: YES
    user_id=1858080
    Originator: NO

    Interestingly, I am not able to open an external c# file => instead of a file a tab with the message "error" is opened (like it is a file)

     
  • Dominik Ertl

    Dominik Ertl - 2007-12-06

    Logged In: YES
    user_id=1858080
    Originator: NO

    seems to relate to [ 1833784 ] NPE thrown when using content assist on non-built files, a closed bug

     
  • Dominik Ertl

    Dominik Ertl - 2007-12-06

    Logged In: YES
    user_id=1858080
    Originator: NO

    Caused by: java.lang.NullPointerException
    at org.emonic.base.InfoStructure.CodeInformator.getAllRelevantRoots(CodeInformator.java:219)
    at org.emonic.base.InfoStructure.CodeInformator.getElementsCompletionForKeywordThis(CodeInformator.java:478)
    at org.emonic.base.editors.CSharpCompletionProcessor.thisCompletion(CSharpCompletionProcessor.java:258)
    at org.emonic.base.editors.CSharpCompletionProcessor.computeCompletionProposals(CSharpCompletionProcessor.java:96)
    is the error
    So you see on line 219, we call editorFile.getProject(), on an external C# file, the editor isn't editing an IFile, so it is null
    what is the error you are getting?
    --
    this method calls are necessary, to get the project settings which src dirs are set
    to get the base classes for distinct objects
    hm, this is coupled to project settings at the moment, the basis for code completion
    an option would be, to decouple e.g. the gac from projects and let the project add additional source files

     
  • Remy Chi Jian Suen

    Logged In: YES
    user_id=1299552
    Originator: YES

    > Interestingly, I am not able to open an external c# file => instead of a
    > file a tab with the message "error" is opened (like it is a file)

    Dominik, you might want to look at the OpenExternalFileAction class and see why you can't open external C# files. That bug should have been fixed in 0.3.

     
  • Remy Chi Jian Suen

    Logged In: YES
    user_id=1299552
    Originator: YES

    Dominik, are you still unable to open external C# files?

     
  • Dominik Ertl

    Dominik Ertl - 2008-01-15

    Logged In: YES
    user_id=1858080
    Originator: NO

    Unfortunately not; I am using a Target Platform pointing at 3.3.1.1

    [Window > Preferences > Plug-in Development > Target Platform]

     
  • Remy Chi Jian Suen

    Logged In: YES
    user_id=1299552
    Originator: YES

    External C# files should now be openable on 3.3.1.1.

     

Log in to post a comment.

MongoDB Logo MongoDB