Skip to content
This repository has been archived by the owner on Oct 26, 2023. It is now read-only.

Commit

Permalink
fixed include completion
Browse files Browse the repository at this point in the history
  • Loading branch information
fkorotkov committed Mar 18, 2015
1 parent b3ef6da commit 4022916
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/com/intellij/plugins/thrift/util/ThriftPsiUtil.java
Expand Up @@ -82,7 +82,12 @@ private static FileReferenceSet getReferenceSet(@NotNull ThriftInclude include)
final String path = getPath(include);
return new FileReferenceSet(
path, include, element.getStartOffsetInParent() + 1, null, true, true, new FileType[]{ThriftFileType.INSTANCE}
);
) {
@Override
public boolean isAbsolutePathReference() {
return true;

This comment has been minimized.

Copy link
@groz

groz Dec 11, 2017

Contributor

causes relative resolutions to fail as mentioned in #48

}
};
}

@NotNull
Expand Down
1 change: 1 addition & 0 deletions testData/completion/reference/include/include.thrift
@@ -0,0 +1 @@
include 'foo/b<caret>'
Expand Up @@ -10,14 +10,30 @@ public ThriftReferenceCompletionTest() {
super("completion/reference");
}

public void testInclude() throws Throwable {
public void testInclude1() throws Throwable {
myFixture.addFileToProject("bar.thrift", "");
myFixture.addFileToProject("baz.thrift", "");
myFixture.configureByText(ThriftFileType.INSTANCE, "include 'b<caret>'");
myFixture.completeBasic();
checkCompletion(CheckType.INCLUDES, "bar.thrift", "baz.thrift");
}

public void testInclude2() throws Throwable {
myFixture.addFileToProject("foo/bar.thrift", "");
myFixture.addFileToProject("foo/baz.thrift", "");
myFixture.configureByText(ThriftFileType.INSTANCE, "include 'foo/b<caret>'");
myFixture.completeBasic();
checkCompletion(CheckType.INCLUDES, "bar.thrift", "baz.thrift");
}

public void testInclude3() throws Throwable {
myFixture.addFileToProject("foo/bar.thrift", "");
myFixture.addFileToProject("foo/baz.thrift", "");
myFixture.configureByFile("include/include.thrift");
myFixture.completeBasic();
checkCompletion(CheckType.INCLUDES, "bar.thrift", "baz.thrift");
}

public void testExtends() throws Throwable {
doTest();
}
Expand Down

0 comments on commit 4022916

Please sign in to comment.