summaryrefslogtreecommitdiff
path: root/lua/intellij_to_vscode/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/intellij_to_vscode/init.lua')
-rw-r--r--lua/intellij_to_vscode/init.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/lua/intellij_to_vscode/init.lua b/lua/intellij_to_vscode/init.lua
new file mode 100644
index 0000000..8ff5251
--- /dev/null
+++ b/lua/intellij_to_vscode/init.lua
@@ -0,0 +1,21 @@
+local M = {}
+local converter = require("intellij_to_vscode.converter")
+
+function M.setup(opts)
+ opts = opts or {}
+ M.opts = opts
+ vim.api.nvim_create_user_command("ITVConvert", function()
+ local ok, err = pcall(converter.convert_all, opts)
+ if not ok then
+ vim.notify("ITVConvert failed: " .. tostring(err), vim.log.levels.ERROR)
+ else
+ vim.notify("Converted IntelliJ run configurations to .vscode/launch.json", vim.log.levels.INFO)
+ end
+ end, {})
+end
+
+function M.convert_all(opts)
+ return converter.convert_all(opts or M.opts)
+end
+
+return M