Skip to content

Commit ab96ae2

Browse files
committed
feat(v1.1.0): release
1 parent a60985f commit ab96ae2

17 files changed

+533
-185
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
blank_issues_enabled: false
2-
contact_links:
3-
- name: Contact
4-
url: mailto:al.neodim@gmail.com
5-
about: For any suggestions or questions send email to
2+
- name: Question
3+
url: ../../discussions
4+
about: Please create a GitHub Discussion for general questions

.github/ISSUE_TEMPLATE/issue-bug.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
11
name: Bug Report
22
description: File a bug report
3-
title: "New bug report"
4-
labels: ["untriaged"]
3+
title: "Bug report"
4+
labels: ["bug"]
55
assignees:
66
- hinell
7-
body:
7+
body:
88
- type: textarea
99
id: issue-summary
1010
attributes:
1111
label: Summary
12-
placeholder: "Be brief"
13-
value: "."
12+
placeholder: "Be brief, time is invaluable commodity that only few can afford"
1413
validations:
1514
required: true
1615
- type: textarea
1716
id: issue-repro
1817
attributes:
1918
label: Steps to reproduce
20-
placeholder: Snippet of code
21-
value: "."
19+
placeholder: Specify how to reproduce issue if there are any ways
2220
validations:
2321
required: false
2422
- type: textarea
2523
id: issue-env
2624
attributes:
2725
label: Versions
28-
placeholder: "Specify all relevant VERSIONS"
29-
value: "."
26+
placeholder: |
27+
Specify all relevant VERSIONS and commits, e.g.:
28+
NVIM v0.10.0-dev-ac1c23442f
29+
Build type: MinSizeRel
30+
LuaJIT 2.1.0-beta3
3031
validations:
3132
required: false
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
22
name: Feature request
33
description: "Feature requests aren't expected, but you can try"
4-
title: "New feature request"
5-
labels: ["untriaged"]
4+
labels: ["enhancement"]
65
assignees:
76
- hinell
8-
body:
7+
body:
98
- type: markdown
109
attributes:
11-
value: "Checkout DISCUSSIONS page first and fill this requestion there! See also [CONTRIBUTING.md](./../blob/main/CONTRIBUTING.md)"
10+
value: "Please, see [CONTRIBUTING.md](../blob/main/CONTRIBUTING.md) first, then, checkout [DISCUSSIONS](../discussions)"
1211
- type: textarea
1312
id: feature-summary
1413
attributes:
1514
label: Summary
16-
placeholder: "Be brief"
17-
value: "."
15+
placeholder: "Be brief, time is invaluable commodity that only few can afford"

.github/pull_request_template.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
### LEGAL
2+
- [ ] I've read the [CONTRIBUTING.md](../blob/main/CONTRIBUTING.md) and I'm fully aware of the terms
3+
- [ ] I've read the [LICENSE](../blob/main/LICENSE) and fully accept the terms and waive my rights over this contribution
4+
5+
### SUMMARY
6+
7+
### CONTEXT
8+
- [ ] I've [DISCUSSED](../discussions) this proposal or feature earlier

.luarc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
3-
"runtime": [ "" ],
3+
"runtime": [ "lua/?.lua" ],
44
"workspace.library": [ "/usr/local/share/nvim/runtime/lua" ],
55
"format.enable": false,
66
"workspace.checkThirdParty": false

CONTRIBUTING.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
# CONTRIBUTING
22

3-
This project is open-source, meaning you can make as many copies of it as you want and do whatever you want with those copies as long as you don't trying to commercialize it, but it is NOT open to contribution. In order to keep this library in the public domain and ensure that the code does not become contaminated with proprietary or licensed content, the project does not accept patches from people who have not submitted an affidavit dedicating their contribution into the public domain.
4-
3+
This project is open-source, meaning you can make as many copies of it as you want and do whatever you want with those copies as long as you are not trying to commercialize it, but it does NOT encouraging contributions. In order to keep this library in the public domain and ensure that the code does not become contaminated with proprietary or strictly-licensed content, the project does not accept patches from people who have not submitted an affidavit dedicating their contribution into the public domain.
4+
55
All of the code in it is original, having been written specifically for use by it. No code has been copied from unknown sources on the internet.
6-
7-
> **NOTE**: [SQLite Disclaimer](https://www.sqlite.org/copyright.html)</br>
8-
> **NOTE**: [Open Source is Not About You](https://gist.github.com/richhickey/1563cddea1002958f96e7ba9519972d9)
9-
10-
### [Development](./DEVELOPMENT.md)
6+
7+
If your contribution ever accepted, then:
8+
* You waive your legal rights to any textual or visual contribution you make to this project
9+
* You wholly transfer the said rights to the author of this project
10+
* You admit that the said contribution is subject to change and may be changed beyound recognition
11+
12+
> **REF**: [SQLite Disclaimer](https://www.sqlite.org/copyright.html)</br>
13+
> **REF**: [Open Source is Not About You](https://gist.github.com/richhickey/1563cddea1002958f96e7ba9519972d9)
14+
15+
### [DEVELOPMENT](./DEVELOPMENT.md)
1116

1217
----
1318
September 15, 2023</br>
14-
Copyright © 2023 - Alexander Davronov, et.al.<br>
19+
Copyright © 2023 - Alexander Davronov (a.k.a. github@hinell), et.al.<br>

DEVELOPMENT.md

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,22 @@ This project is developed by using various developer tools. For runtime dependen
88

99
[Neovim]: https://github.com/neovim/neovim
1010

11-
> _See also: .md files in \`src/\` folder._
12-
## GIT WORKFLOW
13-
It's highly likely that this project is going to be
14-
[force-pushed](https://git-scm.com/docs/git-push#Documentation/git-push.txt)
15-
and aggressively [squash-rebased](https://git-scm.com/docs/git-rebase) into specific semver versions.
16-
Take into account this fact when making a PR: it is likely render your
17-
base-commits obsolete.
11+
## GIT WORKLOW & CONVENTIONS
12+
* This project's history is going to be aggressively [force-pushed](https://git-scm.com/docs/git-push#Documentation/git-push.txt) and [squash-rebased](https://git-scm.com/docs/git-rebase) into a specific [semver] versions
13+
* The said versions might be later revised, dropped or removed (unless specific package manager doesn't allow version replacement).
14+
* This implies that any [upstream] commits pulled may become obsolete
15+
16+
#### Tags naming conventions:
17+
* `latest` - latest released version
18+
* `vX.Y.Z` - version, per [semver]
19+
* `nighlty` - testing build
20+
21+
#### Branch naming convention
22+
* `main` - main dev branch
23+
* `release/X.Y.Z` - next release; tightly coupled to `main`
24+
25+
[semver]: https://github.com/semver/semver 'Semantic version'
26+
[upstream]: https://docs.github.com/en/get-started/quickstart/github-glossary#upstream 'Gighub glossary: upstream'
1827

1928
## BUILD
2029
### Dev dependencies

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ doc/tags: doc/$(PROJECT_NAME).txt
88
@$(NVIM) --headless -c "helptags doc/" -c "exit"
99

1010
# ts-vimdoc generate vimhelp from markdown
11+
.SILENT:
1112
.ONESHELL:
1213
doc/$(PROJECT_NAME).txt: doc/index.md
13-
@$(NVIM) --headless -E -c "
14+
$(NVIM) --headless -E -c "
1415
lua require('ts-vimdoc').docgen({
1516
input_file='doc/index.md',
1617
output_file = '$@',
@@ -25,4 +26,5 @@ doc/$(PROJECT_NAME).txt: doc/index.md
2526
> /dev/stderr;
2627
}
2728
test -f $< && unicode-emoji-remove.sh -i $@
28-
sed -E -i -e 's/<\/br>\s*/\n/' $@
29+
# strip <br> tags
30+
sed -i -E -e 's/<\/?br\/?>\s*/\n/g' $@

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
<div align="center">
44
<h1 align="center">🔌 lsp-timeout.nvim</h2>
55
</div>
6-
<img width="100%" src="doc/preview.png" />
76

7+
<!-- <img width="100%" src="doc/preview.png" /> -->
8+
https://github.com/hinell/lsp-timeout.nvim/assets/8136158/92e30089-192f-4c75-8bec-85ca36a2c06c
89

910
<!-- Use badges from https://shields.io/badges/ -->
1011
[![PayPal](https://img.shields.io/badge/-PayPal-880088?style=flat-square&logo=pay&logoColor=white&label=DONATE)](https://www.paypal.me/biteofpie)

doc/RELEASE

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
* chore(lua-lsp): fix config
2+
* docs(*): major update
3+
* feat(lsp-timeout): support for multi-tab mode
4+
* refactor(config): reformat; allow nil values for config
5+
* feat(napi): add cross-runtime functions
6+
* docs(*): update CONTRIBUTING.md DEVELOPMENT.md
7+
* refactor(github): update github templates
8+
* docs(*): note on LspInfo
9+
* refactor(Makefile): Use .SILENT
10+
* refactor(autocmds): refactor autocmds description
11+
* fix(#10): no config added

doc/index.md

Lines changed: 76 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
## OVERVIEW
2-
Nvim plugin for nvim-lspconfig: stop idle servers & restart upon gaining or loosing focus;
3-
keep your RAM usage low;
42

3+
Nvim plugin for nvim-lspconfig: stop idle servers & restart upon gaining focus;
4+
keeps RAM usage low
5+
6+
**Default behavior**:
7+
* Tabpages and windows inside - are traversed & checked for LSPs
8+
* The |'diff'| windows and |'readonly'| buffers are ignored - `lsp-timeout` takes no action
9+
* On focused writable windows (cursor put on) `lsp-timeout` finds and restarts available LSPs
510

611
## INSTALL
7-
Use your favorite package manager (Packer, Plug, Lazy.nvim etc.)
12+
Use your favorite package manager (Packer, Plug, Lazy.nvim etc.); it's advised to use`latest` tag
813

914
```
1015
"hinell/lsp-timeout.nvim"
@@ -13,9 +18,27 @@ Use your favorite package manager (Packer, Plug, Lazy.nvim etc.)
1318
Prerequisites:
1419

1520
* Neovim v0.7.2+
16-
* `"neovim/nvim-lspconfig"`
21+
* nvim-lspconfig: https://github.com/neovim/nvim-lspconfig
22+
23+
24+
Lazy.nvim:
25+
26+
```lua
27+
{
28+
"hinell/lsp-timeout.nvim",
29+
dependencies={ "neovim/nvim-lspconfig" },
30+
init = function()
31+
vim.g["lsp-timeout-config"] = {
32+
--
33+
}
34+
end
35+
}
36+
```
37+
38+
> **WARNING**
39+
> Packer.nvim is archived
1740
18-
E.g. for packer:
41+
Packer:
1942
```lua
2043
-- $HOME/.config/nvim/lua/user/init.lua
2144
-- Don't forget to run :PackerCompile
@@ -32,48 +55,70 @@ packer.setup(function(use)
3255
end)
3356
```
3457

35-
Lazy.nvim:
36-
37-
```lua
38-
{
39-
"hinell/lsp-timeout.nvim",
40-
dependencies={ "neovim/nvim-lspconfig" },
41-
init = function()
42-
vim.g["lsp-timeout-config"] = {
43-
--
44-
}
45-
end
46-
}
47-
```
48-
4958
## UPDATE
5059

51-
You may want to reinstall this plugin manually because of specific dev-approach:
52-
repo of this plugin may be force-pushed & force-rebased,
53-
rendering all previous commits obsolete; read DEVELOPMENT.md for more info
60+
Repo of this plugin may be force-pushed & force-rebased,
61+
rendering all previous commits obsolete so manual updates are advised;
62+
See DEVELOPMENT.md for more info.
5463

5564
<!-- ## API -->
5665
## CONFIGURATION
5766
```lua
5867
vim.g["lsp-timeout-config"] = {
59-
stopTimeout = 1000 * 60 * 5, -- ms, timeout before stopping all LSP servers
60-
startTimeout = 1000 * 10, -- ms, timeout before restart
61-
silent = false -- true to suppress notifications
68+
stopTimeout = 1000 * 60 * 5, -- ms, timeout before stopping all LSPs
69+
startTimeout = 1000 * 10, -- ms, timeout before restart
70+
silent = false -- true to suppress notifications
6271
}
6372
```
6473

74+
```lua
75+
-- Optionally, validate config
76+
local Config = require("lsp-timeout.config").Config
77+
Config:new(vim.g["lsp-timeout-config"]):validate()
78+
```
79+
80+
### Augroups
81+
82+
Plugin setups two augroups:
83+
* `LSPTimeout` - global augroup for various events
84+
* `LSPTimeoutBufferLocal` - buffer-local groups, temporary
85+
6586
### TROUBLESHOOTING
6687

67-
> **Note** IF SOME PLUGIN FAILED BECAUSE OF STOPPED LSP, PLEASE, FILL AN ISSUE IN THE RESPECTIVE PLUGIN REPO
88+
> **Note**
89+
> IF SOME PLUGIN FAILED BECAUSE OF STOPPED LSP, PLEASE, FILL AN ISSUE IN A RESPECTIVE PLUGIN REPO
90+
91+
* Run `LspInfo` to find (in)active LSPs
92+
* Use `map <...>` to check what keymaps are setup/lost upon restart
93+
* If you hook into |LspAttach| and |LspDetach| events, make sure to store & clean up buffer-local variables or keymaps only once per every cycle
6894

69-
* Some LSP servers which don't keep cache on hdd may fail.
70-
* Some plugins that require active LSP servers like those used for signs may also fail:
71-
if they don't hook into |LspAttach| or |LspDetach| events or if they don't use `vim.lsp.get_clients(...)`.
95+
#### TROUBLESHOOTING PLUGINS
96+
* Some plugins that require active LSP servers like ones used for signs may fail if they don't hook into |LspAttach| or |LspDetach| events or `vim.lsp.get_clients(...)` properly
97+
* Some LSP servers may misbehave upon restart if they don't keep cache
98+
* Some LSP plugins may hook into serveral LSPs and fail upon restart
99+
* See also: https://github.com/neovim/nvim-lspconfig#troubleshooting
72100

73-
#### null-ls
101+
Plugins that are known to misbehave:
102+
* **null-ls**: fails to startup, replace by `efm-languageserver` or use workaround,
103+
<br/>see https://github.com/hinell/lsp-timeout.nvim/issues/7#issuecomment-1764402683
74104

75-
Please, see https://github.com/hinell/lsp-timeout.nvim/issues/7#issuecomment-1764402683
105+
* **efm-languageserver**:
106+
<br/>make sure that `filetypes` are specified in the setup config
107+
<br/>see: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#efm
76108

109+
* **barbecue.nvim**:
110+
<br/>**nvim-navic**:
111+
<br/>you have to attach `navic.nvim` to one specific LSP; avoid attaching it to generic (e.g. efmls) LSPs:
112+
<br/>see: https://github.com/utilyre/barbecue.nvim
113+
```lua
114+
require("lspconfig")[serverName].setup({
115+
on_attach = function(client, bufnr)
116+
-- ...
117+
if client.server_capabilities["documentSymbolProvider"] then
118+
require("nvim-navic").attach(client, bufnr)
119+
end
120+
end,
121+
```
77122

78123
<!-- ## EXAMPLES -->
79124
<!-- ## KEYBINDINGS -->

doc/lsp-timeout-demo.mov

679 KB
Binary file not shown.

0 commit comments

Comments
 (0)