Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/rolling' into rolling
Browse files Browse the repository at this point in the history
* upstream/rolling: (23 commits)
  feat(cmp): add option to disable friendly-snippets (LunarVim#2660)
  feat: prompt when closing modified/term buffers (LunarVim#2658)
  refactor: remove redundant ftdetects (LunarVim#2651)
  chore: bump plugins version (LunarVim#2607)
  refactor: load the default options once (LunarVim#2592)
  chore(docs): trim trailing white space
  fix: load notify's telescope extension properly (LunarVim#2586)
  chore: update templates (LunarVim#2610)
  chore: bump plugins version (LunarVim#2582)
  fix(autocmds): disable commentstring_calc on cursor-hold (LunarVim#2581)
  feat(codelens): cursorhold is too much intrusive for codelens (LunarVim#2600)
  fix: use correct cache path (LunarVim#2593)
  ref(telescope): don't overwrite default cmd to show hidden files
  fix(autocmds): make sure we are using codelens correctly (LunarVim#2576)
  chore: bump plugins version (LunarVim#2563)
  fix(dap): pause key binding commmand (LunarVim#2573)
  fix(dap): temporarily use dap-buddy dev branch which has older code (LunarVim#2567)
  feat(quit): make sure to ask before discarding changes (LunarVim#2554)
  chore(ci): fix failing plugins-update action
  fix(autocmd): actually use the format wrapper (LunarVim#2560)
  ...
  • Loading branch information
hexsailor committed May 28, 2022
2 parents 517cf06 + 7220f1f commit ccb9c13
Show file tree
Hide file tree
Showing 44 changed files with 658 additions and 458 deletions.
30 changes: 20 additions & 10 deletions .github/ISSUE_TEMPLATE/general-issue-form.yaml
Expand Up @@ -23,7 +23,7 @@ body:
validations:
required: true
- type: input
id: lunar-vim-version
id: version
attributes:
label: LunarVim version
placeholder: |
Expand All @@ -36,26 +36,36 @@ body:
label: Neovim version (>= 0.7)
description: "Output of `nvim --version`"
placeholder: |
NVIM v0.7-dev+209-g0603eba6e
Build type: Release
LuaJIT 2.1.0-beta3
NVIM v0.8.0-dev+199-g2875d45e7
validations:
required: true
- type: input
id: system-version
attributes:
label: "Operating system/version"
placeholder: "macOS 11.5"
validations:
required: true
- type: textarea
id: logs
id: steps
attributes:
label: Relevant log output
label: "Steps to reproduce"
description: "Steps to reproduce using the minimal config."
placeholder: |
:checkhealth
:messages
:e $LUNARVIM_CACHE/DIR/lvim.log
render: shell
1. `nvim -u ~/.local/share/lunarvim/lvim/tests/minimal_lsp.lua`
2. ...
- type: textarea
id: support-info
attributes:
label: support info
description: Information from LspInfo and LvimInfo
placeholder: |
```console
# :LspInfo
```
```console
# :LvimInfo
```
validations:
required: true
- type: textarea
Expand Down
36 changes: 22 additions & 14 deletions .github/ISSUE_TEMPLATE/lsp-issue-form.yaml
Expand Up @@ -17,7 +17,7 @@ body:
validations:
required: true
- type: input
id: lunar-vim-version
id: version
attributes:
label: LunarVim version
placeholder: |
Expand All @@ -30,56 +30,64 @@ body:
label: Neovim version (>= 0.7)
description: "Output of `nvim --version`"
placeholder: |
NVIM v0.7-dev+209-g0603eba6e
Build type: Release
LuaJIT 2.1.0-beta3
NVIM v0.8.0-dev+199-g2875d45e7
validations:
required: true
- type: input
id: system-version
attributes:
label: "Operating system/version"
placeholder: "macOS 11.5"
validations:
required: true
- type: input
id: servers
attributes:
label: "Affected language servers"
description: "If this issue is specific to one or more language servers, list them here. If not, write 'all'."
placeholder: "tsserver"
validations:
required: true
- type: textarea
id: steps
attributes:
label: "Steps to reproduce"
description: "Steps to reproduce using the minimal config."
placeholder: |
1. `nvim -u ~/.local/share/lunarvim/lvim/tests/minimal_lsp.lua`
2. ...
- type: textarea
id: behavior
attributes:
label: "Actual behavior"
description: "Observed behavior."
validations:
required: true
- type: textarea
id: expected-behavior
attributes:
label: "Expected behavior"
description: "A description of the behavior you expected."
- type: textarea
id: logs
id: support-info
attributes:
label: log and support info
label: support info
description: Information from LspInfo and LvimInfo
placeholder: |
:LspInfo
:LvimInfo
:messages
:checkhealth
:e $LUNARVIM_CACHE/DIR/lsp.log
:e $LUNARVIM_CACHE/DIR/lvim.log
:e $LUNARVIM_CACHE/DIR/log
render: shell
```console
# :LspInfo
```
```console
# :LvimInfo
```
validations:
required: true
- type: textarea
id: lsp-logs
attributes:
label: logs
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: console
- type: textarea
id: screenshots
attributes:
Expand Down
24 changes: 12 additions & 12 deletions .github/pull_request_template.md
@@ -1,12 +1,12 @@
<!-- This won't be rendered!
[CHECKLIST]
I prefixed the title with one of the following tags:
- [Feature]: For feature addition / improvements
- [Bugfix]: When fixing a functionality
- [Refactor]: When moving code without adding any functionality
- [Doc]: On documentation updates
- feature: for feature addition / improvements
- fix: when fixing a functionality
- refactor: when moving code without adding any functionality
- doc: on documentation updates
- I read the contributing guide (CONTRIBUTING.md)
- I read the contributing guide [CONTRIBUTING.md](../CONTRIBUTING.md)
- My code follows the style guidelines of this project
- I have performed a self-review of my code
- I have commented on my code, particularly in hard-to-understand areas
Expand All @@ -15,17 +15,17 @@ I prefixed the title with one of the following tags:
-->
# Description

Please include a summary of the change and which issue is fixed. \
List any dependencies that are required for this change.
summary of the change

Fixes #(issue)
<!--- Please list any dependencies that are required for this change. --->

## How Has This Been Tested?
fixes #(issue)

Please describe the tests that you ran to verify your changes. \
Provide instructions so we can reproduce. \
Please also list any relevant details for your test configuration.
## How Has This Been Tested?

<!--- Please describe the tests that you ran to verify your changes. --->
<!--- Also list any relevant details for your test configuration. --->
<!--- Provide instructions so we can reproduce -->
- Run command `:mycommand`
- Check logs
- ...
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/commitlint.config.js
Expand Up @@ -32,4 +32,15 @@ module.exports = {
],
],
},
/*
add a custom parser to handle exclamation marks in a commit
see: https://github.com/conventional-changelog/commitlint/issues/2226#issuecomment-911749509
*/
parserPreset: {
parserOpts: {
headerPattern: /^(\w*)(?:\((.*)\))?!?: (.*)$/,
referenceActions: null,
issuePrefixes: ['ISS-'],
},
},
};
2 changes: 1 addition & 1 deletion .github/workflows/plugins.yml
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: v0.7
version: v0.7.0

- name: Install LunarVim
timeout-minutes: 4
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Expand Up @@ -67,7 +67,7 @@ shfmt -i 2 -ci -bn -l -d .
│ │ │
│ │ └─> Present tense. 'add something...'(O) vs 'added something...'(X)
│ │ Imperative mood. 'move cursor to...'(O) vs 'moves cursor to...'(X)
│ │ Not capitalized.
│ │ Not capitalized.
│ │ No period at the end.
│ │
│ └─> Commit Scope is optional, but strongly recommended.
Expand All @@ -91,10 +91,10 @@ shfmt -i 2 -ci -bn -l -d .

**Real world examples:**
```
feat(quickfix): add 'q' binding to quit quickfix window when focused
feat(quickfix): add 'q' binding to quit quickfix window when focused
```
```
fix(installer): add missing "HOME" variable
fix(installer): add missing "HOME" variable
```


Expand Down
3 changes: 0 additions & 3 deletions ftdetect/bicep.lua

This file was deleted.

3 changes: 0 additions & 3 deletions ftdetect/fish.lua

This file was deleted.

3 changes: 0 additions & 3 deletions ftdetect/fsautocomplete.lua

This file was deleted.

1 change: 0 additions & 1 deletion ftdetect/julia.lua

This file was deleted.

1 change: 0 additions & 1 deletion ftdetect/nix.lua

This file was deleted.

3 changes: 0 additions & 3 deletions ftdetect/sol.lua

This file was deleted.

1 change: 0 additions & 1 deletion ftdetect/zig.lua
@@ -1,4 +1,3 @@
vim.cmd [[
au BufRead,BufNewFile *.zig set filetype=zig
au BufRead,BufNewFile *.zir set filetype=zir
]]
2 changes: 1 addition & 1 deletion lua/lvim/bootstrap.lua
Expand Up @@ -55,7 +55,7 @@ end
function _G.get_cache_dir()
local lvim_cache_dir = os.getenv "LUNARVIM_CACHE_DIR"
if not lvim_cache_dir then
return vim.call("stdpath", "config")
return vim.call("stdpath", "cache")
end
return lvim_cache_dir
end
Expand Down
2 changes: 2 additions & 0 deletions lua/lvim/config/defaults.lua
Expand Up @@ -7,6 +7,8 @@ return {
pattern = "*",
---@usage timeout number timeout in ms for the format request (Default: 1000)
timeout = 1000,
---@usage filter func to select client
filter = require("lvim.lsp.handlers").format_filter,
},
keys = {},

Expand Down
41 changes: 20 additions & 21 deletions lua/lvim/config/init.lua
Expand Up @@ -5,40 +5,29 @@ local M = {}
local user_config_dir = get_config_dir()
local user_config_file = utils.join_paths(user_config_dir, "config.lua")

local function apply_defaults(configs, defaults)
configs = configs or {}
return vim.tbl_deep_extend("keep", configs, defaults)
end

---Get the full path to the user configuration file
---@return string
function M:get_user_config_path()
return user_config_file
end

--- Initialize lvim default configuration
-- Define lvim global variable
--- Initialize lvim default configuration and variables
function M:init()
if vim.tbl_isempty(lvim or {}) then
lvim = vim.deepcopy(require "lvim.config.defaults")
local home_dir = vim.loop.os_homedir()
lvim.vsnip_dir = utils.join_paths(home_dir, ".config", "snippets")
lvim.database = { save_location = utils.join_paths(home_dir, ".config", "lunarvim_db"), auto_execute = 1 }
end
lvim = vim.deepcopy(require "lvim.config.defaults")

require("lvim.keymappings").load_defaults()

local builtins = require "lvim.core.builtins"
builtins.config { user_config_file = user_config_file }

local settings = require "lvim.config.settings"
settings.load_options()
settings.load_defaults()

local autocmds = require "lvim.core.autocmds"
lvim.autocommands = apply_defaults(lvim.autocommands, autocmds.load_augroups())
autocmds.load_defaults()

local lvim_lsp_config = require "lvim.lsp.config"
lvim.lsp = apply_defaults(lvim.lsp, vim.deepcopy(lvim_lsp_config))
lvim.lsp = vim.deepcopy(lvim_lsp_config)

---@deprecated replaced with lvim.builtin.alpha
lvim.builtin.dashboard = {
Expand All @@ -52,7 +41,11 @@ function M:init()
footer = {},
}

require("lvim.lsp.manager").init_defaults()
lvim.builtin.luasnip = {
sources = {
friendly_snippets = true,
},
}
end

local function handle_deprecated_settings()
Expand Down Expand Up @@ -99,25 +92,32 @@ local function handle_deprecated_settings()
if lvim.builtin.dashboard.active then
deprecation_notice("lvim.builtin.dashboard", "Use `lvim.builtin.alpha` instead. See LunarVim#1906")
end

if lvim.autocommands.custom_groups then
deprecation_notice(
"lvim.autocommands.custom_groups",
"Use vim.api.nvim_create_autocmd instead or check LunarVim#2592 to learn about the new syntax"
)
end
end

--- Override the configuration with a user provided one
-- @param config_path The path to the configuration overrides
function M:load(config_path)
local autocmds = require "lvim.core.autocmds"
config_path = config_path or self.get_user_config_path()
config_path = config_path or self:get_user_config_path()
local ok, err = pcall(dofile, config_path)
if not ok then
if utils.is_file(user_config_file) then
Log:warn("Invalid configuration: " .. err)
else
Log:warn(string.format("Unable to find configuration file [%s]", config_path))
vim.notify_once(string.format("Unable to find configuration file [%s]", config_path), vim.log.levels.WARN)
end
end

handle_deprecated_settings()

autocmds.define_augroups(lvim.autocommands)
autocmds.define_autocmds(lvim.autocommands)

vim.g.mapleader = (lvim.leader == "space" and " ") or lvim.leader

Expand All @@ -134,7 +134,6 @@ function M:reload()
vim.schedule(function()
require_clean("lvim.utils.hooks").run_pre_reload()

M:init()
M:load()

require("lvim.core.autocmds").configure_format_on_save()
Expand Down

0 comments on commit ccb9c13

Please sign in to comment.