Injected Template language inline code completion ?

Answered

I inject DjangoTemplate language in yaml file

when editing the injected DjangoTemplate fragment code completion is works,

but inline code editing completion does not work at all(It seem it does NOT invoke my DjangoTemplate code completion contributor).

12 comments
Comment actions Permalink

Hi Val,

Could you please clarify what you mean by editing the injected fragment and inline code editing? It would be great if you also provide screenshots to show the context.

0
Comment actions Permalink

Hi,

Thank you for the recording.

What is your completion contributor pattern definition?

0
Comment actions Permalink
extend(CompletionType.BASIC, PlatformPatterns.psiElement(), TemplateVarCompletionProvider())

Plugin.xml

<completion.contributor language="DjangoTemplate"
implementationClass="xxx.TemplateCompleteContribution"/>
0
Comment actions Permalink

If I change language to "ANY", my completion function will be called properly,

but the passed PSI is host language PSI, not injected language PSI.

Under this case(language=ANY), even I add completion to CompletionResultSet, nothing will popup.

0
Comment actions Permalink

Hi,

I created a primitive completion contributor similar to yours and all works fine. I implemented it in the plugin you shared on GitHub before (I can't see it anymore).

CompletionContributor:

init {
extend(CompletionType.BASIC, PlatformPatterns.psiElement(),
object : CompletionProvider<CompletionParameters>() {
override fun addCompletions(parameters: CompletionParameters,
context: ProcessingContext,
resultSet: CompletionResultSet) {
resultSet.addElement(LookupElementBuilder.create("Hello"))
}
}
)
}

plugin.xml

<extensions defaultExtensionNs="com.intellij">
...
<completion.contributor language="DjangoTemplate"
implementationClass="com.github.valbendan.ansible.completion.TestCompletionContributor"/>
</extensions>

The "Hello" item is shown in both inline and injected fragment editors. It's hard to tell what can be the reason without details. Maybe your injection logic has changed in the meantime and it works in old, but not your current version.

0
Comment actions Permalink

I‘d like share my code with you through email if you can provider your email account.

0
Comment actions Permalink

Please share it then: karol.lewandowski at jetbrains.com.

0
Comment actions Permalink

mail send from: dev at qiyutech.tech

0
Comment actions Permalink

I didn't get your email and sent you back a suggestion to upload a password-protected archive somewhere and share the link.

0
Comment actions Permalink

The mail I sent is rejected by your mail provider.

I have reply to your email with code attached.

0
Comment actions Permalink

It seems google dose not like email from China :(  (google rejected my reply mail)

I have sent you a another email from my private email (outloook.com)

0

Please sign in to leave a comment.