Replies: 4 comments 3 replies
-
Hi! Nope, there is no such functionality currently. If you decide to create a PR to add the isPluginEnabled() function, you are very welcome to do so; it's a great idea. P.S. It's not a good idea to have an if statement with two mappings inside, because the if in your config will be executed only once (during IDE startup). If you disable Copilot after the IDE starts, the mapping will not be aware of it. A better approach might be something like:
|
Beta Was this translation helpful? Give feedback.
-
I appreciate the reply. I did realize that after I made my post while messing around with it some more. What I was attempting to do a while later was: # -- jb_plugin_check.sh
#!/bin/bash
PLUGIN_NAME="com.github.copilot"
is_plugin_disabled=$(grep -c "^$PLUGIN_NAME\$" ~/.config/JetBrains/Rider2024.1/disabled_plugins.txt)
if [[ $is_plugin_disabled -eq 1 ]]; then
echo 1
else
echo 0
fi function! CoPilotDisabled()
let check_script="/home/mosthated/_dev/languages/sh/apps/jetbrains/jb_plugin_check.sh"
let result=system(check_script)
if result == 0
:action copilot.requestCompletions<cr>
else
:action AIAssistant.Editor.CompleteCodeWithAI<cr>
endif
endfunction
imap <A-\> :call CoPilotDisabled()<CR> I was not able to get that working properly yet before I decided to just continue on with my work. I know I did something wrong, just wasn't sure yet what it was but after seeing your example, I may have another go at it later/tomorrow. |
Beta Was this translation helpful? Give feedback.
-
I was honestly going to give it a go, but I don't use java often and have never used kotlin or gradle, and as such I have spent the last hour or two trying to install sdkman, get it working with intellij, but can't get past either this: A problem occurred configuring root project 'IdeaVIM'.
> Failed to query the value of task ':runIde' property 'ideDir'.
> Could not resolve all dependencies for configuration ':z90_intellij'.
> Failed to calculate the value of task ':compileTestJava' property 'javaCompiler'.
> No matching toolchains found for requested specification: {languageVersion=17, vendor=any, implementation=vendor-specific} for LINUX on x86_64.
> No locally installed toolchains match and toolchain download repositories have not been configured.
* Try:
> Learn more about toolchain auto-detection at https://docs.gradle.org/8.5/userguide/toolchains.html#sec:auto_detection.
> Learn more about toolchain repositories at https://docs.gradle.org/8.5/userguide/toolchains.html#sub:download_repositories.
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org. or it telling me I am not using a supported version. I am just frustrated now, and going to continue on with my day. |
Beta Was this translation helpful? Give feedback.
-
I see. That did seem to work. I checked all over the contributors document, and I don't recall seeing a version of 17 listed. How is one supposed to know? I realize that PR's are a good thing, but I don't think you would want them from someone who knows nothing about the language or it's best practices, let alone how to even set up the ide. That said, I may have a go at it tomorrow, after I look over a bunch of additional plugin examples and see if I can familiarize myself on a smaller scale first. |
Beta Was this translation helpful? Give feedback.
-
Hey there, I was wondering if there exist a way to determine if an IDE plugin exists and/or is enabled?
Reason being, sometimes I switch between Copilot and JB AI completions and I would like to be able to detect which one is enabled/active via conditional so that my keybind can call the right action.
Ex. A way to accomplish something like this:
Thanks,
-MH
Beta Was this translation helpful? Give feedback.
All reactions