remove NPE if JSDT not setup on project + cont. completion invoked.
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistant.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistant.java index b33358e..2eac279 100644 --- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistant.java +++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTContentAssistant.java
@@ -48,6 +48,8 @@ /* add end script tag if needed */ /* --------- Content Assistant --------- */ + if(theCollector==null) return new ICompletionProposal[0]; + getContentAssistProcessor().setProposalCollector(theCollector); completionProposals = getContentAssistProcessor().computeCompletionProposals(viewer, documentPosition); proposals.addAll(Arrays.asList(completionProposals)); @@ -98,6 +100,7 @@ protected JSDTProposalCollector getProposalCollector(ITextViewer viewer, int offset) { IJsTranslation tran = getJSPTranslation(viewer, offset); + if(tran==null) return null; return new JSDTProposalCollector(tran); }
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTHtmlCompletionProcessor.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTHtmlCompletionProcessor.java index b8742fa..61fe161 100644 --- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTHtmlCompletionProcessor.java +++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTHtmlCompletionProcessor.java
@@ -48,6 +48,8 @@ /* add </script if necisary */ IJsTranslation tran = getJSPTranslation(viewer); + if(tran==null) return null; + int missingAtOffset = tran.getMissingTagStart(); if(offset>=missingAtOffset&& missingAtOffset>-1) {
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTProposalCollector.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTProposalCollector.java index 51aa534..0027576 100644 --- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTProposalCollector.java +++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/contentassist/JSDTProposalCollector.java
@@ -47,7 +47,7 @@ // return fGeneratedFunctionNames; // } public JSDTProposalCollector(IJsTranslation translation) { - super(translation.getCompilationUnit()); + super(translation!=null?translation.getCompilationUnit():null); if (translation == null) { throw new IllegalArgumentException("JSPTranslation cannot be null"); //$NON-NLS-1$ }