public void accept(ICompilationUnit sourceUnit, AccessRestriction accessRestriction) { if (!CharOperation.equals(sourceUnit.getMainTypeName(), TypeConstants.PACKAGE_INFO_NAME)) { // do not accept package-info.java as a type for completion engine // because it contains no extra info that will help in completion // https://bugs.eclipse.org/bugs/show_bug.cgi?id=343865 // Required after the fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=337868 // because now we get a type corresponding to the package-info.java from the java model. super.accept(sourceUnit, accessRestriction); } }
protected ASTNode parseBlockStatements(CompilationUnitDeclaration unit, int position) { int length = unit.types.length; for (int i = 0; i < length; i++) { TypeDeclaration type = unit.types[i]; if (type.declarationSourceStart < position && type.declarationSourceEnd >= position) { getParser().scanner.setSource(unit.compilationResult); return parseBlockStatements(type, unit, position); } } return null; }
public void initializeImportCaches() { if (this.currentPackageName == null) { initializePackageCache();
protected void reset() { super.reset(false); this.knownPkgs = new HashtableOfObject(10); this.knownTypes = new HashtableOfObject(10); if (this.noCacheNameEnvironment != null) { this.noCacheNameEnvironment.cleanup(); this.noCacheNameEnvironment = null; JavaModelManager.getJavaModelManager().flushZipFiles(this); } }
/** * Add an additional compilation unit. */ public void accept(ICompilationUnit sourceUnit, AccessRestriction accessRestriction) { CompilationResult result = new CompilationResult(sourceUnit, 1, 1, this.compilerOptions.maxProblemsPerUnit); AssistParser assistParser = getParser(); Object parserState = assistParser.becomeSimpleParser(); CompilationUnitDeclaration parsedUnit = assistParser.dietParse(sourceUnit, result); assistParser.restoreAssistParser(parserState); this.lookupEnvironment.buildTypeBindings(parsedUnit, accessRestriction); this.lookupEnvironment.completeTypeBindings(parsedUnit, true); }
protected void reset() { super.reset(false); this.validPackageNames = new SimpleSetOfCharArray(10); this.invalidPackageNames = new SimpleSetOfCharArray(1); this.knownPkgs = new HashtableOfObject(10); this.knownTypes = new HashtableOfObject(10); if (this.noCacheNameEnvironment != null) { this.noCacheNameEnvironment.cleanup(); this.noCacheNameEnvironment = null; JavaModelManager.getJavaModelManager().flushZipFiles(this); } }
/** * Add an additional compilation unit. */ public void accept(ICompilationUnit sourceUnit, AccessRestriction accessRestriction) { CompilationResult result = new CompilationResult(sourceUnit, 1, 1, this.compilerOptions.maxProblemsPerUnit); AssistParser assistParser = getParser(); Object parserState = assistParser.becomeSimpleParser(); CompilationUnitDeclaration parsedUnit = assistParser.dietParse(sourceUnit, result); assistParser.restoreAssistParser(parserState); this.lookupEnvironment.buildTypeBindings(parsedUnit, accessRestriction); this.lookupEnvironment.completeTypeBindings(parsedUnit, true); }
protected ASTNode parseBlockStatements(CompilationUnitDeclaration unit, int position) { int length = unit.types.length; for (int i = 0; i < length; i++) { TypeDeclaration type = unit.types[i]; if (type.declarationSourceStart < position && type.declarationSourceEnd >= position) { getParser().scanner.setSource(unit.compilationResult); return parseBlockStatements(type, unit, position); } } return null; }
protected void reset() { super.reset(false); this.validPackageNames = new SimpleSetOfCharArray(10); this.invalidPackageNames = new SimpleSetOfCharArray(1); this.knownPkgs = new HashtableOfObject(10); this.knownTypes = new HashtableOfObject(10); if (this.noCacheNameEnvironment != null) { this.noCacheNameEnvironment.cleanup(); this.noCacheNameEnvironment = null; JavaModelManager.getJavaModelManager().flushZipFiles(this); } }
@Override public void accept(ICompilationUnit sourceUnit, AccessRestriction accessRestriction) { if (!CharOperation.equals(sourceUnit.getMainTypeName(), TypeConstants.PACKAGE_INFO_NAME)) { // do not accept package-info.java as a type for completion engine // because it contains no extra info that will help in completion // https://bugs.eclipse.org/bugs/show_bug.cgi?id=343865 // Required after the fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=337868 // because now we get a type corresponding to the package-info.java from the java model. super.accept(sourceUnit, accessRestriction); } }
/** * Add an additional compilation unit. */ public void accept(ICompilationUnit sourceUnit, AccessRestriction accessRestriction) { CompilationResult result = new CompilationResult(sourceUnit, 1, 1, this.compilerOptions.maxProblemsPerUnit); AssistParser assistParser = getParser(); Object parserState = assistParser.becomeSimpleParser(); CompilationUnitDeclaration parsedUnit = assistParser.dietParse(sourceUnit, result); assistParser.restoreAssistParser(parserState); this.lookupEnvironment.buildTypeBindings(parsedUnit, accessRestriction); this.lookupEnvironment.completeTypeBindings(parsedUnit, true); }
public void initializeImportCaches() { if (this.currentPackageName == null) { initializePackageCache();
protected ASTNode parseBlockStatements(CompilationUnitDeclaration unit, int position) { int length = unit.types.length; for (int i = 0; i < length; i++) { TypeDeclaration type = unit.types[i]; if (type.declarationSourceStart < position && type.declarationSourceEnd >= position) { getParser().scanner.setSource(unit.compilationResult); return parseBlockStatements(type, unit, position); } } return null; }
protected void reset() { super.reset(false); this.validPackageNames = new SimpleSetOfCharArray(10); this.invalidPackageNames = new SimpleSetOfCharArray(1); this.knownPkgs = new HashtableOfObject(10); this.knownTypes = new HashtableOfObject(10); if (this.noCacheNameEnvironment != null) { this.noCacheNameEnvironment.cleanup(); this.noCacheNameEnvironment = null; JavaModelManager.getJavaModelManager().flushZipFiles(this); } }
public void accept(ICompilationUnit sourceUnit, AccessRestriction accessRestriction) { if (!CharOperation.equals(sourceUnit.getMainTypeName(), TypeConstants.PACKAGE_INFO_NAME)) { // do not accept package-info.java as a type for completion engine // because it contains no extra info that will help in completion // https://bugs.eclipse.org/bugs/show_bug.cgi?id=343865 // Required after the fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=337868 // because now we get a type corresponding to the package-info.java from the java model. super.accept(sourceUnit, accessRestriction); } }
/** * Add an additional compilation unit. */ public void accept(ICompilationUnit sourceUnit, AccessRestriction accessRestriction) { CompilationResult result = new CompilationResult(sourceUnit, 1, 1, this.compilerOptions.maxProblemsPerUnit); AssistParser assistParser = getParser(); Object parserState = assistParser.becomeSimpleParser(); CompilationUnitDeclaration parsedUnit = assistParser.dietParse(sourceUnit, result); assistParser.restoreAssistParser(parserState); this.lookupEnvironment.buildTypeBindings(parsedUnit, accessRestriction); this.lookupEnvironment.completeTypeBindings(parsedUnit, true); }
public void initializeImportCaches() { if (this.currentPackageName == null) { initializePackageCache();