-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace go to docs intention with external documentation provider
- Loading branch information
Showing
7 changed files
with
34 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
5 changes: 0 additions & 5 deletions
5
AngularJS/resources/intentionDescriptions/OpenAngularJSDocsIntention/description.html
This file was deleted.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
AngularJS/src/org/angularjs/AngularJSDocumentationProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.angularjs; | ||
|
||
import com.intellij.lang.documentation.DocumentationProviderEx; | ||
import com.intellij.lang.javascript.index.AngularDirectivesIndex; | ||
import com.intellij.lang.javascript.index.JSNamedElementProxy; | ||
import com.intellij.openapi.util.text.StringUtil; | ||
import com.intellij.psi.PsiElement; | ||
import org.angularjs.index.AngularIndexUtil; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
/** | ||
* @author Dennis.Ushakov | ||
*/ | ||
public class AngularJSDocumentationProvider extends DocumentationProviderEx { | ||
@Override | ||
public List<String> getUrlFor(PsiElement element, PsiElement originalElement) { | ||
if (element instanceof JSNamedElementProxy) { | ||
final String name = ((JSNamedElementProxy)element).getName(); | ||
if (AngularIndexUtil.resolve(element.getProject(), AngularDirectivesIndex.INDEX_ID, name) != null) { | ||
final String[] words = name.split("-"); | ||
for (int i = 1; i < words.length; i++) { | ||
words[i] = StringUtil.capitalize(words[i]); | ||
} | ||
return Collections.singletonList("http://docs.angularjs.org/api/ng.directive:" + StringUtil.join(words)); | ||
} | ||
} | ||
return null; | ||
} | ||
} |
50 changes: 0 additions & 50 deletions
50
AngularJS/src/org/angularjs/intentions/OpenAngularJSDocsIntention.java
This file was deleted.
Oops, something went wrong.