mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-09-13 20:32:09 +02:00
Compare commits
11 Commits
2e8f0da0e4
...
customized
Author | SHA1 | Date | |
---|---|---|---|
ff7e6bf053
|
|||
f19ce34311
|
|||
8bcb0d116d
|
|||
d9ae9fa40d
|
|||
c19f88e5c0
|
|||
03f4fb288d
|
|||
ef27579277
|
|||
a8a822b58e
|
|||
9752bd5bbb
|
|||
240d9e0be4
|
|||
328442544d
|
@@ -11,11 +11,13 @@
|
|||||||
ideaVersion=2023.2.1
|
ideaVersion=2023.2.1
|
||||||
downloadIdeaSources=true
|
downloadIdeaSources=true
|
||||||
instrumentPluginCode=true
|
instrumentPluginCode=true
|
||||||
version=chylex-16
|
version=chylex-17
|
||||||
javaVersion=17
|
javaVersion=17
|
||||||
remoteRobotVersion=0.11.17
|
remoteRobotVersion=0.11.17
|
||||||
antlrVersion=4.10.1
|
antlrVersion=4.10.1
|
||||||
|
|
||||||
|
kotlin.incremental.useClasspathSnapshot=false
|
||||||
|
|
||||||
# Please don't forget to update kotlin version in buildscript section
|
# Please don't forget to update kotlin version in buildscript section
|
||||||
kotlinVersion=1.8.21
|
kotlinVersion=1.8.21
|
||||||
publishToken=token
|
publishToken=token
|
||||||
|
@@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
package com.maddyhome.idea.vim.vimscript.model.functions.handlers
|
package com.maddyhome.idea.vim.vimscript.model.functions.handlers
|
||||||
|
|
||||||
|
import com.intellij.openapi.util.SystemInfoRt
|
||||||
|
import com.intellij.util.system.CpuArch
|
||||||
import com.intellij.vim.annotations.VimscriptFunction
|
import com.intellij.vim.annotations.VimscriptFunction
|
||||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||||
import com.maddyhome.idea.vim.api.VimEditor
|
import com.maddyhome.idea.vim.api.VimEditor
|
||||||
@@ -23,7 +25,7 @@ internal class HasFunctionHandler : FunctionHandler() {
|
|||||||
override val minimumNumberOfArguments = 1
|
override val minimumNumberOfArguments = 1
|
||||||
override val maximumNumberOfArguments = 2
|
override val maximumNumberOfArguments = 2
|
||||||
|
|
||||||
private val supportedFeatures = setOf("ide")
|
private val supportedFeatures = Features.discover()
|
||||||
|
|
||||||
override fun doFunction(
|
override fun doFunction(
|
||||||
argumentValues: List<Expression>,
|
argumentValues: List<Expression>,
|
||||||
@@ -41,4 +43,40 @@ internal class HasFunctionHandler : FunctionHandler() {
|
|||||||
VimInt.ZERO
|
VimInt.ZERO
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private object Features {
|
||||||
|
fun discover(): Set<String> {
|
||||||
|
val features = mutableSetOf("ide")
|
||||||
|
collectOperatingSystemType(features)
|
||||||
|
return features
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun collectOperatingSystemType(target: MutableSet<String>) {
|
||||||
|
if (SystemInfoRt.isWindows) {
|
||||||
|
target.add("win32")
|
||||||
|
if (CpuArch.CURRENT.width == 64) {
|
||||||
|
target.add("win64")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (SystemInfoRt.isLinux) {
|
||||||
|
target.add("linux")
|
||||||
|
}
|
||||||
|
else if (SystemInfoRt.isMac) {
|
||||||
|
target.add("mac")
|
||||||
|
target.add("macunix")
|
||||||
|
target.add("osx")
|
||||||
|
target.add("osxdarwin")
|
||||||
|
}
|
||||||
|
else if (SystemInfoRt.isFreeBSD) {
|
||||||
|
target.add("bsd")
|
||||||
|
}
|
||||||
|
else if (SystemInfoRt.isSolaris) {
|
||||||
|
target.add("sun")
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SystemInfoRt.isUnix) {
|
||||||
|
target.add("unix")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user