1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-05-05 00:34:04 +02:00

Add generated JSON files to gitignore

This commit is contained in:
Filipp Vakhitov 2023-11-10 14:48:58 +02:00
parent 876e16fa9e
commit 93c83f773a
15 changed files with 32 additions and 172 deletions

3
.gitignore vendored
View File

@ -23,6 +23,9 @@
# Generated by gradle task "generateGrammarSource"
src/main/java/com/maddyhome/idea/vim/vimscript/parser/generated
# Generated JSONs for lazy classloading
/vim-engine/src/main/resources/ksp-generated
/src/main/resources/ksp-generated
# Created by github automation
settings.xml

View File

@ -20,6 +20,7 @@ import com.google.devtools.ksp.symbol.KSVisitorVoid
import com.intellij.vim.annotations.CommandOrMotion
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import java.nio.file.Files
import kotlin.io.path.Path
import kotlin.io.path.writeText
@ -31,7 +32,11 @@ class CommandOrMotionProcessor(private val environment: SymbolProcessorEnvironme
override fun process(resolver: Resolver): List<KSAnnotated> {
resolver.getAllFiles().forEach { it.accept(visitor, Unit) }
val filePath = Path(environment.options["generated_directory"]!!, environment.options["commands_file"]!!)
val generatedDirPath = Path(environment.options["generated_directory"]!!)
Files.createDirectories(generatedDirPath)
val filePath = generatedDirPath.resolve(environment.options["commands_file"]!!)
val fileContent = json.encodeToString(commands)
filePath.writeText(fileContent)

View File

@ -20,6 +20,7 @@ import com.google.devtools.ksp.symbol.KSVisitorVoid
import com.intellij.vim.annotations.ExCommand
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import java.nio.file.Files
import kotlin.io.path.Path
import kotlin.io.path.writeText
@ -31,7 +32,11 @@ class ExCommandProcessor(private val environment: SymbolProcessorEnvironment): S
override fun process(resolver: Resolver): List<KSAnnotated> {
resolver.getAllFiles().forEach { it.accept(visitor, Unit) }
val filePath = Path(environment.options["generated_directory"]!!, environment.options["ex_commands_file"]!!)
val generatedDirPath = Path(environment.options["generated_directory"]!!)
Files.createDirectories(generatedDirPath)
val filePath = generatedDirPath.resolve(environment.options["ex_commands_file"]!!)
val fileContent = json.encodeToString(commandToClass)
filePath.writeText(fileContent)

View File

@ -20,6 +20,7 @@ import com.google.devtools.ksp.symbol.KSVisitorVoid
import com.intellij.vim.annotations.VimscriptFunction
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
import java.nio.file.Files
import kotlin.io.path.Path
import kotlin.io.path.writeText
@ -31,7 +32,11 @@ class VimscriptFunctionProcessor(private val environment: SymbolProcessorEnviron
override fun process(resolver: Resolver): List<KSAnnotated> {
resolver.getAllFiles().forEach { it.accept(visitor, Unit) }
val filePath = Path(environment.options["generated_directory"]!!, environment.options["vimscript_functions_file"]!!)
val generatedDirPath = Path(environment.options["generated_directory"]!!)
Files.createDirectories(generatedDirPath)
val filePath = generatedDirPath.resolve(environment.options["vimscript_functions_file"]!!)
val fileContent = json.encodeToString(nameToClass)
filePath.writeText(fileContent)

View File

@ -82,7 +82,7 @@ plugins {
}
ksp {
arg("generated_directory", "$projectDir/src/main/resources")
arg("generated_directory", "$projectDir/src/main/resources/ksp-generated")
arg("vimscript_functions_file", "intellij_vimscript_functions.json")
arg("ex_commands_file", "intellij_ex_commands.json")
arg("commands_file", "intellij_commands.json")

View File

@ -9,5 +9,5 @@
package com.maddyhome.idea.vim.action
public object IntellijCommandProvider : CommandProvider {
override val exCommandListFileName: String = "intellij_commands.json"
override val commandListFileName: String = "intellij_commands.json"
}

View File

@ -1,11 +0,0 @@
{
"actionl[ist]": "com.maddyhome.idea.vim.vimscript.model.commands.ActionListCommand",
"b[uffer]": "com.maddyhome.idea.vim.vimscript.model.commands.BufferCommand",
"ls": "com.maddyhome.idea.vim.vimscript.model.commands.BufferListCommand",
"files": "com.maddyhome.idea.vim.vimscript.model.commands.BufferListCommand",
"buffers": "com.maddyhome.idea.vim.vimscript.model.commands.BufferListCommand",
"!": "com.maddyhome.idea.vim.vimscript.model.commands.CmdFilterCommand",
"g[lobal]": "com.maddyhome.idea.vim.vimscript.model.commands.GlobalCommand",
"v[global]": "com.maddyhome.idea.vim.vimscript.model.commands.GlobalCommand",
"h[elp]": "com.maddyhome.idea.vim.vimscript.model.commands.HelpCommand"
}

View File

@ -1,6 +0,0 @@
{
"line": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.LineFunctionHandler",
"col": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.ColFunctionHandler",
"has": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.HasFunctionHandler",
"submatch": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.SubmatchFunctionHandler"
}

View File

@ -24,7 +24,7 @@ repositories {
}
ksp {
arg("generated_directory", "$projectDir/src/main/resources")
arg("generated_directory", "$projectDir/src/main/resources/ksp-generated")
arg("vimscript_functions_file", "engine_vimscript_functions.json")
arg("ex_commands_file", "engine_ex_commands.json")
arg("commands_file", "engine_commands.json")

View File

@ -18,7 +18,7 @@ import kotlinx.serialization.json.decodeFromStream
import java.io.InputStream
public interface CommandProvider {
public val exCommandListFileName: String
public val commandListFileName: String
@OptIn(ExperimentalSerializationApi::class)
public fun getCommands(): Collection<LazyVimCommand> {
@ -39,8 +39,7 @@ public interface CommandProvider {
}
private fun getFile(): InputStream {
return object {}.javaClass.classLoader.getResourceAsStream(exCommandListFileName)
return object {}.javaClass.classLoader.getResourceAsStream("ksp-generated/$commandListFileName")
?: throw RuntimeException("Failed to fetch ex commands from ${javaClass.name}")
}
}
}

View File

@ -9,5 +9,5 @@
package com.maddyhome.idea.vim.action
public object EngineCommandProvider : CommandProvider {
override val exCommandListFileName: String = "engine_commands.json"
override val commandListFileName: String = "engine_commands.json"
}

View File

@ -24,7 +24,7 @@ public interface ExCommandProvider {
}
private fun getFile(): InputStream {
return object {}.javaClass.classLoader.getResourceAsStream(exCommandsFileName)
return object {}.javaClass.classLoader.getResourceAsStream("ksp-generated/$exCommandsFileName")
?: throw RuntimeException("Failed to fetch ex-commands for ${javaClass.name}")
}
}
}

View File

@ -24,7 +24,7 @@ public interface VimscriptFunctionProvider {
}
private fun getFile(): InputStream {
return object {}.javaClass.classLoader.getResourceAsStream(functionListFileName)
return object {}.javaClass.classLoader.getResourceAsStream("ksp-generated/$functionListFileName")
?: throw RuntimeException("Failed to fetch functions for ${javaClass.name}")
}
}
}

View File

@ -1,126 +0,0 @@
{
"action": "com.maddyhome.idea.vim.vimscript.model.commands.ActionCommand",
"as[cii]": "com.maddyhome.idea.vim.vimscript.model.commands.AsciiCommand",
"bd[elete]": "com.maddyhome.idea.vim.vimscript.model.commands.BufferCloseCommand",
"cal[l]": "com.maddyhome.idea.vim.vimscript.model.commands.CallCommand",
"comc[lear]": "com.maddyhome.idea.vim.vimscript.model.commands.CmdClearCommand",
"com[mand]": "com.maddyhome.idea.vim.vimscript.model.commands.CmdCommand",
"t": "com.maddyhome.idea.vim.vimscript.model.commands.CopyTextCommand",
"co[py]": "com.maddyhome.idea.vim.vimscript.model.commands.CopyTextCommand",
"delc[ommand]": "com.maddyhome.idea.vim.vimscript.model.commands.DelCmdCommand",
"d[elete]": "com.maddyhome.idea.vim.vimscript.model.commands.DeleteLinesCommand",
"delm[arks]": "com.maddyhome.idea.vim.vimscript.model.commands.DeleteMarksCommand",
"delf[unction]": "com.maddyhome.idea.vim.vimscript.model.commands.DelfunctionCommand",
"dig[raphs]": "com.maddyhome.idea.vim.vimscript.model.commands.DigraphCommand",
"ec[ho]": "com.maddyhome.idea.vim.vimscript.model.commands.EchoCommand",
"e[dit]": "com.maddyhome.idea.vim.vimscript.model.commands.EditFileCommand",
"bro[wse]": "com.maddyhome.idea.vim.vimscript.model.commands.EditFileCommand",
"exe[cute]": "com.maddyhome.idea.vim.vimscript.model.commands.ExecuteCommand",
"qa[ll]": "com.maddyhome.idea.vim.vimscript.model.commands.ExitCommand",
"xa[ll]": "com.maddyhome.idea.vim.vimscript.model.commands.ExitCommand",
"wqa[ll]": "com.maddyhome.idea.vim.vimscript.model.commands.ExitCommand",
"quita[ll]": "com.maddyhome.idea.vim.vimscript.model.commands.ExitCommand",
"f[ile]": "com.maddyhome.idea.vim.vimscript.model.commands.FileCommand",
"fin[d]": "com.maddyhome.idea.vim.vimscript.model.commands.FindFileCommand",
"go[to]": "com.maddyhome.idea.vim.vimscript.model.commands.GotoCharacterCommand",
"his[tory]": "com.maddyhome.idea.vim.vimscript.model.commands.HistoryCommand",
"j[oin]": "com.maddyhome.idea.vim.vimscript.model.commands.JoinLinesCommand",
"ju[mps]": "com.maddyhome.idea.vim.vimscript.model.commands.JumpsCommand",
"let": "com.maddyhome.idea.vim.vimscript.model.commands.LetCommand",
"lockv[ar]": "com.maddyhome.idea.vim.vimscript.model.commands.LockVarCommand",
"unlo[ckvar]": "com.maddyhome.idea.vim.vimscript.model.commands.UnlockVarCommand",
"k": "com.maddyhome.idea.vim.vimscript.model.commands.MarkCommand",
"ma[rk]": "com.maddyhome.idea.vim.vimscript.model.commands.MarkCommand",
"marks": "com.maddyhome.idea.vim.vimscript.model.commands.MarksCommand",
"m[ove]": "com.maddyhome.idea.vim.vimscript.model.commands.MoveTextCommand",
"n[ext]": "com.maddyhome.idea.vim.vimscript.model.commands.NextFileCommand",
"bn[ext]": "com.maddyhome.idea.vim.vimscript.model.commands.NextFileCommand",
"tabn[ext]": "com.maddyhome.idea.vim.vimscript.model.commands.NextTabCommand",
"noh[lsearch]": "com.maddyhome.idea.vim.vimscript.model.commands.NoHLSearchCommand",
"norm[al]": "com.maddyhome.idea.vim.vimscript.model.commands.NormalCommand",
"on[ly]": "com.maddyhome.idea.vim.vimscript.model.commands.OnlyCommand",
"pa[ckadd]": "com.maddyhome.idea.vim.vimscript.model.commands.PackaddCommand",
"Plug[in]": "com.maddyhome.idea.vim.vimscript.model.commands.PlugCommand",
"prev[ious]": "com.maddyhome.idea.vim.vimscript.model.commands.PreviousFileCommand",
"bp[revious]": "com.maddyhome.idea.vim.vimscript.model.commands.PreviousFileCommand",
"N[ext]": "com.maddyhome.idea.vim.vimscript.model.commands.PreviousFileCommand",
"tabp[revious]": "com.maddyhome.idea.vim.vimscript.model.commands.PreviousTabCommand",
"tabN[ext]": "com.maddyhome.idea.vim.vimscript.model.commands.PreviousTabCommand",
"p[rint]": "com.maddyhome.idea.vim.vimscript.model.commands.PrintCommand",
"P[rint]": "com.maddyhome.idea.vim.vimscript.model.commands.PrintCommand",
"pu[t]": "com.maddyhome.idea.vim.vimscript.model.commands.PutLinesCommand",
"q[uit]": "com.maddyhome.idea.vim.vimscript.model.commands.QuitCommand",
"clo[se]": "com.maddyhome.idea.vim.vimscript.model.commands.QuitCommand",
"hi[de]": "com.maddyhome.idea.vim.vimscript.model.commands.QuitCommand",
"red[o]": "com.maddyhome.idea.vim.vimscript.model.commands.RedoCommand",
"dis[play]": "com.maddyhome.idea.vim.vimscript.model.commands.RegistersCommand",
"reg[isters]": "com.maddyhome.idea.vim.vimscript.model.commands.RegistersCommand",
"@": "com.maddyhome.idea.vim.vimscript.model.commands.RepeatCommand",
"argu[ment]": "com.maddyhome.idea.vim.vimscript.model.commands.SelectFileCommand",
"fir[st]": "com.maddyhome.idea.vim.vimscript.model.commands.SelectFirstFileCommand",
"la[st]": "com.maddyhome.idea.vim.vimscript.model.commands.SelectLastFileCommand",
"se[t]": "com.maddyhome.idea.vim.vimscript.model.commands.SetCommand",
"setg[lobal]": "com.maddyhome.idea.vim.vimscript.model.commands.SetglobalCommand",
"setl[ocal]": "com.maddyhome.idea.vim.vimscript.model.commands.SetlocalCommand",
"sethandler": "com.maddyhome.idea.vim.vimscript.model.commands.SetHandlerCommand",
"sh[ell]": "com.maddyhome.idea.vim.vimscript.model.commands.ShellCommand",
"<": "com.maddyhome.idea.vim.vimscript.model.commands.ShiftLeftCommand",
">": "com.maddyhome.idea.vim.vimscript.model.commands.ShiftRightCommand",
"sor[t]": "com.maddyhome.idea.vim.vimscript.model.commands.SortCommand",
"so[urce]": "com.maddyhome.idea.vim.vimscript.model.commands.SourceCommand",
"sp[lit]": "com.maddyhome.idea.vim.vimscript.model.commands.SplitCommand",
"vs[plit]": "com.maddyhome.idea.vim.vimscript.model.commands.SplitCommand",
"~": "com.maddyhome.idea.vim.vimscript.model.commands.SubstituteCommand",
"&": "com.maddyhome.idea.vim.vimscript.model.commands.SubstituteCommand",
"s[ubstitute]": "com.maddyhome.idea.vim.vimscript.model.commands.SubstituteCommand",
"tabc[lose]": "com.maddyhome.idea.vim.vimscript.model.commands.TabCloseCommand",
"tabm[ove]": "com.maddyhome.idea.vim.vimscript.model.commands.TabMoveCommand",
"tabo[nly]": "com.maddyhome.idea.vim.vimscript.model.commands.TabOnlyCommand",
"u[ndo]": "com.maddyhome.idea.vim.vimscript.model.commands.UndoCommand",
"wa[ll]": "com.maddyhome.idea.vim.vimscript.model.commands.WriteAllCommand",
"w[rite]": "com.maddyhome.idea.vim.vimscript.model.commands.WriteCommand",
"wn[ext]": "com.maddyhome.idea.vim.vimscript.model.commands.WriteNextFileCommand",
"wp[revious]": "com.maddyhome.idea.vim.vimscript.model.commands.WritePreviousFileCommand",
"wN[ext]": "com.maddyhome.idea.vim.vimscript.model.commands.WritePreviousFileCommand",
"wq": "com.maddyhome.idea.vim.vimscript.model.commands.WriteQuitCommand",
"x[it]": "com.maddyhome.idea.vim.vimscript.model.commands.WriteQuitCommand",
"exi[t]": "com.maddyhome.idea.vim.vimscript.model.commands.WriteQuitCommand",
"y[ank]": "com.maddyhome.idea.vim.vimscript.model.commands.YankLinesCommand",
"mapc[lear]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapClearCommand",
"nmapc[lear]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapClearCommand",
"vmapc[lear]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapClearCommand",
"xmapc[lear]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapClearCommand",
"smapc[lear]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapClearCommand",
"omapc[lear]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapClearCommand",
"imapc[lear]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapClearCommand",
"lmapc[lear]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapClearCommand",
"cmapc[lear]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapClearCommand",
"map": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapCommand",
"nm[ap]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapCommand",
"vm[ap]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapCommand",
"xm[ap]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapCommand",
"smap": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapCommand",
"om[ap]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapCommand",
"im[ap]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapCommand",
"lm[ap]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapCommand",
"cm[ap]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapCommand",
"no[map]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapCommand",
"nn[oremap]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapCommand",
"vn[oremap]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapCommand",
"xn[oremap]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapCommand",
"snor[emap]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapCommand",
"ono[remap]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapCommand",
"no[remap]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapCommand",
"ino[remap]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapCommand",
"ln[oremap]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapCommand",
"cno[remap]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.MapCommand",
"unm[ap]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.UnMapCommand",
"nun[map]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.UnMapCommand",
"vu[nmap]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.UnMapCommand",
"xu[nmap]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.UnMapCommand",
"sunm[ap]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.UnMapCommand",
"ou[nmap]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.UnMapCommand",
"iu[nmap]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.UnMapCommand",
"lu[nmap]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.UnMapCommand",
"cu[nmap]": "com.maddyhome.idea.vim.vimscript.model.commands.mapping.UnMapCommand"
}

View File

@ -1,14 +0,0 @@
{
"abs": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.AbsFunctionHandler",
"empty": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.EmptyFunctionHandler",
"exists": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.ExistsFunctionHandler",
"function": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.FunctionFunctionHandler",
"funcref": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.FuncrefFunctionHandler",
"get": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.GetFunctionHandler",
"join": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.JoinFunctionHandler",
"len": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.LenFunctionHandler",
"sin": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.SinFunctionHandler",
"split": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.SplitFunctionHandler",
"tolower": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.TolowerFunctionHandler",
"toupper": "com.maddyhome.idea.vim.vimscript.model.functions.handlers.ToupperFunctionHandler"
}