aws-toolkit-jetbrains icon indicating copy to clipboard operation
aws-toolkit-jetbrains copied to clipboard

Allow CodeWhisperer to suggest JS Code inside DjangoTemplates

Open mvinoba opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe. I’ve been using CodeWhisperer for the last week to write Python code in PyCharm, but when I switch tabs to DjangoTemplate HTML files all I get is “DjangoTemplate is currently not supported by CodeWhisperer”.

Describe the solution you'd like Since most of my code in DjangoTemplate is actually JS code inside

Describe alternatives you've considered Meanwhile I have to use other alternatives such as prompting to Bard/GPT, but that's not nearly as useful. I can also create a .js file copying my template code and ask for suggestions, but this is not very handy since {{ }} syntax gets highlighted and I need to copy and paste the suggestions.

mvinoba avatar Oct 28 '23 00:10 mvinoba

@rli any known workaround for this issue?

mvinoba avatar Oct 30 '23 22:10 mvinoba

https://github.com/aws/aws-toolkit-jetbrains/blame/40885d377cafa9835817eed56bd7ed1326798505/jetbrains-core/src/software/aws/toolkits/jetbrains/services/codewhisperer/service/CodeWhispererService.kt#L123

@rli would you mind answering if this the correct line to change if I want it to work building from source? I thought of something like:

if (language === 'DjangoTemplate')
    {language = 'javascript'}

mvinoba avatar Nov 14 '23 17:11 mvinoba