-
-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat!: lua API feat(api): vscode settings integration - `has_config` - `get_config` - `update_config` * refactor: use `setup` to setup each module * refactor: move fireNvimClient to ActionManager * feat: hook window state changed * refactor: set group for all autocmds Avoid duplicate definitions * feat: flexible parameter `range` * feat: add `vscode.notify` and `vscode.notify_once` * chore(notify): compatible with legacy interfaces * chore: change namespace name for highlight module * chore: remove $ * chore: list `window_state_changed` in comment * chore: remove _G._vscode * refactor!: change `leave_selection` to `restore_selection` * refactor!: remove `notify_once` feat: triggering FocusGained/Lost by default * removed unnecessary hooks: init, window_stated_changed * docs: update API * docs: improved API section * docs: tweaks * docs: ⚡️API * docs: fix heading level * docs: generate toc * fix(actions): fix `update_config` * fix(notify): fallback to show infomation message
- Loading branch information
Showing
22 changed files
with
1,020 additions
and
350 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,31 @@ | ||
local api = require("vscode-neovim.api") | ||
local defaults = require("vscode-neovim.defaults") | ||
local cursor = require("vscode-neovim.cursor") | ||
|
||
require("vscode-neovim.highlight") | ||
require("vscode-neovim.filetype") | ||
|
||
local M = {} | ||
|
||
M.notify = api.notify | ||
M.call = api.call | ||
M.call_range = api.call_range | ||
M.notify_range = api.notify_range | ||
M.call_range_pos = api.call_range_pos | ||
M.notify_range_pos = api.notify_range_pos | ||
local default_optons = require("vscode-neovim.default-options") | ||
local cursor = require("vscode-neovim.cursor") | ||
local highlight = require("vscode-neovim.highlight") | ||
local filetype = require("vscode-neovim.filetype") | ||
local numbers = require("vscode-neovim.numbers") | ||
local autocmds = require("vscode-neovim.autocmds") | ||
|
||
M.setup = function() | ||
defaults.setup() | ||
cursor.setup() | ||
end | ||
default_optons.setup() | ||
cursor.setup() | ||
highlight.setup() | ||
filetype.setup() | ||
numbers.setup() | ||
autocmds.setup() | ||
|
||
vim.api.nvim_create_autocmd("InsertLeave", { | ||
callback = function() | ||
vim.fn.VSCodeNotify("hideSuggestWidget") | ||
vim.fn.VSCodeNotify("closeParameterHints") | ||
vim.fn.VSCodeNotify("editor.action.inlineSuggest.hide") | ||
end, | ||
}) | ||
local vscode = { | ||
-- actions | ||
action = api.action, | ||
call = api.call, | ||
-- hooks | ||
on = api.on, | ||
-- vscode settings | ||
has_config = api.has_config, | ||
get_config = api.get_config, | ||
update_config = api.update_config, | ||
-- notifications | ||
notify = api.notify, | ||
} | ||
|
||
return M | ||
return vscode |
Oops, something went wrong.