mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix javadoc completion for field links
This commit is contained in:
+4
-1
@@ -230,10 +230,13 @@ public class JavaDocCompletionContributor extends CompletionContributor {
|
||||
document.insertString(startOffset - sharpLength, link);
|
||||
document.insertString(context.getTailOffset(), "}");
|
||||
context.setTailOffset(context.getTailOffset() - 1);
|
||||
context.getOffsetMap().addOffset(CompletionInitializationContext.START_OFFSET, startOffset + link.length() + sharpLength);
|
||||
context.getOffsetMap().addOffset(CompletionInitializationContext.START_OFFSET, startOffset + link.length());
|
||||
|
||||
context.commitDocument();
|
||||
delegate.handleInsert(context, item);
|
||||
if (item.getObject() instanceof PsiField) {
|
||||
context.getEditor().getCaretModel().moveToOffset(context.getTailOffset() + 1);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+7
@@ -616,6 +616,13 @@ class Foo {
|
||||
myFixture.checkResult "/** a. {@link #foo(int)}<caret> */ interface Foo { void foo(int a); }}"
|
||||
}
|
||||
|
||||
public void "test insert link to field"() {
|
||||
myFixture.configureByText 'a.java', "/** a. #fo<caret> */ interface Foo { int foo; }}"
|
||||
myFixture.completeBasic()
|
||||
myFixture.type('\n')
|
||||
myFixture.checkResult "/** a. {@link #foo}<caret> */ interface Foo { int foo; }}"
|
||||
}
|
||||
|
||||
public void "test wrap null into code tag"() {
|
||||
myFixture.configureByText 'a.java', "/** nul<caret> */"
|
||||
myFixture.completeBasic()
|
||||
|
||||
Reference in New Issue
Block a user