mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-01 21:35:40 +02:00
Cosmetics.
This commit is contained in:
parent
08293b3f58
commit
c9909363f9
2 changed files with 5 additions and 23 deletions
|
@ -31,14 +31,14 @@ public abstract class DeclarationGenerator {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new {@link IASTDeclSpecifier}DeclSpecifier for a given {@link IType}.
|
* Creates a new {@link IASTDeclSpecifier} for a given {@link IType}.
|
||||||
* @param type the type to describe
|
* @param type the type to describe
|
||||||
* @return the generated declaration specifier
|
* @return the generated declaration specifier
|
||||||
*/
|
*/
|
||||||
public abstract IASTDeclSpecifier createDeclSpecFromType(IType type);
|
public abstract IASTDeclSpecifier createDeclSpecFromType(IType type);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new {@link IASTDeclarator}Declarator for a given {@link IType}.
|
* Creates a new {@link IASTDeclarator} for a given {@link IType}.
|
||||||
* @param type the type to describe
|
* @param type the type to describe
|
||||||
* @param name the name for the declarator
|
* @param name the name for the declarator
|
||||||
* @return the generated declarator
|
* @return the generated declarator
|
||||||
|
|
|
@ -150,9 +150,6 @@ public class CSourceHover extends AbstractCEditorTextHover {
|
||||||
fSource= null;
|
fSource= null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* @see org.eclipse.cdt.internal.core.model.ASTCache.ASTRunnable#runOnAST(IASTTranslationUnit)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public IStatus runOnAST(ILanguage lang, IASTTranslationUnit ast) {
|
public IStatus runOnAST(ILanguage lang, IASTTranslationUnit ast) {
|
||||||
if (ast != null) {
|
if (ast != null) {
|
||||||
|
@ -389,10 +386,8 @@ public class CSourceHover extends AbstractCEditorTextHover {
|
||||||
}
|
}
|
||||||
String source= buffer.getDocument().get(sourceStart, sourceEnd - sourceStart);
|
String source= buffer.getDocument().get(sourceStart, sourceEnd - sourceStart);
|
||||||
return source;
|
return source;
|
||||||
|
|
||||||
} catch (BadLocationException e) {
|
} catch (BadLocationException e) {
|
||||||
// Ignore - should not happen anyway
|
CUIPlugin.log(e);
|
||||||
if (DEBUG) e.printStackTrace();
|
|
||||||
} finally {
|
} finally {
|
||||||
mgr.disconnect(location, LocationKind.LOCATION, fMonitor);
|
mgr.disconnect(location, LocationKind.LOCATION, fMonitor);
|
||||||
}
|
}
|
||||||
|
@ -408,12 +403,10 @@ public class CSourceHover extends AbstractCEditorTextHover {
|
||||||
* otherwise {@code null}.
|
* otherwise {@code null}.
|
||||||
*/
|
*/
|
||||||
private String computeHoverForDeclaration(IASTName name) {
|
private String computeHoverForDeclaration(IASTName name) {
|
||||||
ICPPASTDeclarator declarator =
|
ICPPASTDeclarator declarator = CPPVisitor.findAncestorWithType(name, ICPPASTDeclarator.class);
|
||||||
CPPVisitor.findAncestorWithType(name, ICPPASTDeclarator.class);
|
|
||||||
if (declarator == null)
|
if (declarator == null)
|
||||||
return null;
|
return null;
|
||||||
IASTDeclaration declaration =
|
IASTDeclaration declaration = CPPVisitor.findAncestorWithType(declarator, IASTDeclaration.class);
|
||||||
CPPVisitor.findAncestorWithType(declarator, IASTDeclaration.class);
|
|
||||||
IASTDeclSpecifier declSpec = null;
|
IASTDeclSpecifier declSpec = null;
|
||||||
if (declaration instanceof IASTSimpleDeclaration) {
|
if (declaration instanceof IASTSimpleDeclaration) {
|
||||||
declSpec = ((IASTSimpleDeclaration) declaration).getDeclSpecifier();
|
declSpec = ((IASTSimpleDeclaration) declaration).getDeclSpecifier();
|
||||||
|
@ -672,9 +665,6 @@ public class CSourceHover extends AbstractCEditorTextHover {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* @see ITextHover#getHoverInfo(ITextViewer, IRegion)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
|
public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
|
||||||
IEditorPart editor = getEditor();
|
IEditorPart editor = getEditor();
|
||||||
|
@ -862,10 +852,6 @@ public class CSourceHover extends AbstractCEditorTextHover {
|
||||||
return keywords.contains(name);
|
return keywords.contains(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* @see org.eclipse.jface.text.ITextHoverExtension#getHoverControlCreator()
|
|
||||||
* @since 3.0
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public IInformationControlCreator getHoverControlCreator() {
|
public IInformationControlCreator getHoverControlCreator() {
|
||||||
return new IInformationControlCreator() {
|
return new IInformationControlCreator() {
|
||||||
|
@ -881,10 +867,6 @@ public class CSourceHover extends AbstractCEditorTextHover {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* @see IInformationProviderExtension2#getInformationPresenterControlCreator()
|
|
||||||
* @since 3.0
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public IInformationControlCreator getInformationPresenterControlCreator() {
|
public IInformationControlCreator getInformationPresenterControlCreator() {
|
||||||
return new IInformationControlCreator() {
|
return new IInformationControlCreator() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue