Skip to content

Commit 6cb6ada

Browse files
committed
feat(v1.2.0): release
1 parent ab96ae2 commit 6cb6ada

13 files changed

+309
-149
lines changed

.github/ISSUE_TEMPLATE/issue-bug.yml

+25-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
name: Bug Report
1+
name: Bug
22
description: File a bug report
33
title: "Bug report"
44
labels: ["bug"]
55
assignees:
66
- hinell
77
body:
8+
- type: checkboxes
9+
id: issue-trouble-is-read
10+
attributes:
11+
label: I've read TROUBLESHOOTING instructions
12+
options:
13+
- label: "Yes"
14+
required: true
815
- type: textarea
916
id: issue-summary
1017
attributes:
@@ -30,3 +37,20 @@ body:
3037
LuaJIT 2.1.0-beta3
3138
validations:
3239
required: false
40+
- type: dropdown
41+
id: OS
42+
attributes:
43+
label: Specify operating system/environment
44+
options:
45+
- Linux/Debian/Ubuntu
46+
- Linux/Debian/Kubuntu
47+
- Linux / Other
48+
- Archlinux
49+
- NixOS
50+
- MacOS
51+
- Windows
52+
- Windows WSL
53+
- Docker
54+
- Other
55+
validations:
56+
required: true

.github/ISSUE_TEMPLATE/issue-feature.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
2-
name: Feature request
3-
description: "Feature requests aren't expected, but you can try"
2+
name: Feature
3+
description: "File a feature request; they are aren't expected, but you can try"
44
labels: ["enhancement"]
55
assignees:
66
- hinell

CONTRIBUTING.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
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 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.
3+
This project is open-source, meaning you can make as many copies of it as you want and do whatever you want with the code as long as you are not trying to commercialize it, but it does NOT encourage 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 or code that is hard to maintain, the project does not accept patches from people who have not submitted an affidavit dedicating their contribution to the author of this project or public domain.
44

5-
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.
5+
All of the code have been written specifically for use by it; NO code has been copied from unknown sources on the internet unless explicitly specified.
66

7-
If your contribution ever accepted, then:
8-
* You waive your legal rights to any textual or visual contribution you make to this project
7+
If your contribution is ever accepted, then:
8+
* You waive all your legal rights to any textual or visual contribution you make to this project
99
* You wholly transfer the said rights to the author of this project
1010
* You admit that the said contribution is subject to change and may be changed beyound recognition
1111

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)
12+
## SEE ALSO
13+
> [LICENSE](LICENSE)<br/>
14+
> [SQLite Disclaimer](https://www.sqlite.org/copyright.html)<br/>
15+
> [Open Source is Not About You](https://gist.github.com/richhickey/1563cddea1002958f96e7ba9519972d9)
16+
# [DEVELOPMENT](./DEVELOPMENT.md)
1617

1718
----
18-
September 15, 2023</br>
19+
October 26, 2023</br>
1920
Copyright © 2023 - Alexander Davronov (a.k.a. github@hinell), et.al.<br>

README.md

+12-17
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!---->
22

33
<div align="center">
4-
<h1 align="center">🔌 lsp-timeout.nvim</h2>
4+
<h1 align="center">lsp-timeout.nvim<img width="32" src="https://neovim.io/logos/neovim-mark-flat.png" align="right" /></h1>
55
</div>
66

77
<!-- <img width="100%" src="doc/preview.png" /> -->
@@ -33,22 +33,6 @@ automatically upon gaining or loosing window focus, keeping neovim fast.
3333

3434
## 📦 Installation
3535

36-
#### [packer.nvim](https://github.com/wbthomason/packer.nvim)
37-
```lua
38-
-- $HOME/.config/nvim/lua/user/init.lua
39-
packer.setup(function(use)
40-
use({
41-
"hinell/lsp-timeout.nvim",
42-
requires={ "neovim/nvim-lspconfig" },
43-
setup = function()
44-
vim.g["lsp-timeout-config"] = {
45-
-- ...
46-
}
47-
end
48-
})
49-
end)
50-
```
51-
5236
#### [lazy.vim](https://github.com/folke/lazy.nvim)
5337
```lua
5438
require("lazy").setup(
@@ -59,6 +43,17 @@ require("lazy").setup(
5943
)
6044
```
6145

46+
#### [packer.nvim](https://github.com/wbthomason/packer.nvim)
47+
```lua
48+
-- $HOME/.config/nvim/lua/user/init.lua
49+
packer.setup(function(use)
50+
use({
51+
"hinell/lsp-timeout.nvim",
52+
requires={ "neovim/nvim-lspconfig" }
53+
})
54+
end)
55+
```
56+
6257
#### [vim-plug](https://github.com/junegunn/vim-plug)
6358
``` vim
6459
Plug "hinell/lsp-timeout.nvim"

doc/RELEASE

+14-11
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
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
1+
* refactor(plugin): better error message
2+
* feat(plugin): disable lsp-timeout for ignored filetypes
3+
* feat(config): support filetypes.ignore list; Fixes #10
4+
* feat(plugin): deprecate ["lsp-timeout-config"] for lspTimeoutConfig
5+
* feat(plugin): keep track of stopped clients; restart by native lsp
6+
funnctions; honor non-lspconfig servers (e.g. null-ls or none-ls)
7+
previously stopped; force clients to stop & detach; Fixes #13
8+
* docs(readme): nvim icons
9+
* docs(*): remove preview.png
10+
* docs(CONTRIBUTING): fix typo, reword
11+
* docs(*): note on typescript-tools
12+
* docs(*): fix typos; reword
13+
* chore(github): add more fields to issue-bug.yml
14+
* docs(*): typo fixes

doc/index.md

+31-18
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## OVERVIEW
1+
# OVERVIEW
22

33
Nvim plugin for nvim-lspconfig: stop idle servers & restart upon gaining focus;
44
keeps RAM usage low
@@ -15,21 +15,18 @@ Use your favorite package manager (Packer, Plug, Lazy.nvim etc.); it's advised t
1515
"hinell/lsp-timeout.nvim"
1616
```
1717

18-
Prerequisites:
18+
Requirements:
1919

2020
* Neovim v0.7.2+
2121
* nvim-lspconfig: https://github.com/neovim/nvim-lspconfig
2222

23-
24-
Lazy.nvim:
25-
2623
```lua
2724
{
2825
"hinell/lsp-timeout.nvim",
2926
dependencies={ "neovim/nvim-lspconfig" },
3027
init = function()
31-
vim.g["lsp-timeout-config"] = {
32-
--
28+
vim.g.lspTimeoutConfig = {
29+
-- see config below
3330
}
3431
end
3532
}
@@ -47,8 +44,8 @@ packer.setup(function(use)
4744
"hinell/lsp-timeout.nvim",
4845
requires={ "neovim/nvim-lspconfig" },
4946
setup = function()
50-
vim.g["lsp-timeout-config"] = {
51-
--
47+
vim.g.lspTimeoutConfig = {
48+
-- see config belos
5249
}
5350
end
5451
})
@@ -64,17 +61,28 @@ See DEVELOPMENT.md for more info.
6461
<!-- ## API -->
6562
## CONFIGURATION
6663
```lua
67-
vim.g["lsp-timeout-config"] = {
64+
vim.g.lspTimeoutConfig = {
6865
stopTimeout = 1000 * 60 * 5, -- ms, timeout before stopping all LSPs
6966
startTimeout = 1000 * 10, -- ms, timeout before restart
7067
silent = false -- true to suppress notifications
68+
filetypes = {
69+
ignore = { -- filetypes to ignore; empty by default
70+
-- lsp-timeout is disabled completely
71+
} -- for these filetypes
72+
}
73+
}
74+
75+
-- Buffer local configuration; overrides global
76+
bufnr = vim.api.nvim_get_current_buf()
77+
vim.b[bufnr].lspTimeoutConfig = {
78+
-- ..
7179
}
7280
```
7381

7482
```lua
75-
-- Optionally, validate config
83+
-- Optionally, validate the config
7684
local Config = require("lsp-timeout.config").Config
77-
Config:new(vim.g["lsp-timeout-config"]):validate()
85+
Config:new(vim.g.lspTimeoutConfig):validate()
7886
```
7987

8088
### Augroups
@@ -95,20 +103,20 @@ Plugin setups two augroups:
95103
#### TROUBLESHOOTING PLUGINS
96104
* 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
97105
* 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
106+
* Some LSP plugins may hook into serveral LSPs at the same time and fail upon restart
99107
* See also: https://github.com/neovim/nvim-lspconfig#troubleshooting
100108

101109
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
110+
* **null-ls** and **none-ls**:
111+
<br/>as of v1.2.0 should work properly; if didn't, replace by `efm-languageserver` or run `:e` upon focusing or use workaround,
112+
<br/>see: https://github.com/hinell/lsp-timeout.nvim/issues/7#issuecomment-1764402683
104113

105114
* **efm-languageserver**:
106115
<br/>make sure that `filetypes` are specified in the setup config
107116
<br/>see: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#efm
108117

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:
118+
* **barbecue.nvim** and **nvim-navic**:
119+
<br/>you have to attach `navic.nvim` to one specific LSP; avoid attaching it to generic ones (e.g. efmls):
112120
<br/>see: https://github.com/utilyre/barbecue.nvim
113121
```lua
114122
require("lspconfig")[serverName].setup({
@@ -120,6 +128,11 @@ require("lspconfig")[serverName].setup({
120128
end,
121129
```
122130

131+
* **pmizio/typescript-tools.nvim**:
132+
<br/>run `lspconfig["typescript-tools"].setup({ filetypes = })`
133+
<br/>make sure that `filetypes` are specified in the setup config
134+
<br/>see: https://github.com/hinell/lsp-timeout.nvim/issues/12#issuecomment-1779750062
135+
123136
<!-- ## EXAMPLES -->
124137
<!-- ## KEYBINDINGS -->
125138
<!-- ## LEGENDARY -->

doc/lsp-timeout.txt

+36-19
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
*lsp-timeout.txt* Last change: 2023 October 19
1+
*lsp-timeout.txt* Last change: 2023 October 29
22

33
==============================================================================
44
Table of Contents *lsp-timeout-table-of-contents*
55

6-
OVERVIEW .............................................. |lsp-timeout-overview|
76
INSTALL ................................................ |lsp-timeout-install|
87
UPDATE .................................................. |lsp-timeout-update|
98
CONFIGURATION .................................... |lsp-timeout-configuration|
109
Augroups .............................................. |lsp-timeout-augroups|
1110
TROUBLESHOOTING ................................ |lsp-timeout-troubleshooting|
1211
TROUBLESHOOTING PLUGINS ................ |lsp-timeout-troubleshooting-plugins|
1312

14-
------------------------------------------------------------------------------
13+
==============================================================================
1514
OVERVIEW *lsp-timeout-overview*
1615

1716

@@ -36,19 +35,17 @@ to use`latest` tag
3635
>
3736
"hinell/lsp-timeout.nvim"
3837
<
39-
Prerequisites:
38+
Requirements:
4039

4140
* Neovim v0.7.2+
4241
* nvim-lspconfig: https://github.com/neovim/nvim-lspconfig
43-
Lazy.nvim:
44-
4542
>lua
4643
{
4744
"hinell/lsp-timeout.nvim",
4845
dependencies={ "neovim/nvim-lspconfig" },
4946
init = function()
50-
vim.g["lsp-timeout-config"] = {
51-
--
47+
vim.g.lspTimeoutConfig = {
48+
-- see config below
5249
}
5350
end
5451
}
@@ -65,8 +62,8 @@ Packer:
6562
"hinell/lsp-timeout.nvim",
6663
requires={ "neovim/nvim-lspconfig" },
6764
setup = function()
68-
vim.g["lsp-timeout-config"] = {
69-
--
65+
vim.g.lspTimeoutConfig = {
66+
-- see config belos
7067
}
7168
end
7269
})
@@ -87,16 +84,27 @@ CONFIGURATION *lsp-timeout-configuration*
8784

8885

8986
>lua
90-
vim.g["lsp-timeout-config"] = {
87+
vim.g.lspTimeoutConfig = {
9188
stopTimeout = 1000 * 60 * 5, -- ms, timeout before stopping all LSPs
9289
startTimeout = 1000 * 10, -- ms, timeout before restart
9390
silent = false -- true to suppress notifications
91+
filetypes = {
92+
ignore = { -- filetypes to ignore; empty by default
93+
-- lsp-timeout is disabled completely
94+
} -- for these filetypes
95+
}
96+
}
97+
98+
-- Buffer local configuration; overrides global
99+
bufnr = vim.api.nvim_get_current_buf()
100+
vim.b[bufnr].lspTimeoutConfig = {
101+
-- ..
94102
}
95103
<
96104
>lua
97-
-- Optionally, validate config
105+
-- Optionally, validate the config
98106
local Config = require("lsp-timeout.config").Config
99-
Config:new(vim.g["lsp-timeout-config"]):validate()
107+
Config:new(vim.g.lspTimeoutConfig):validate()
100108
<
101109

102110

@@ -125,23 +133,25 @@ TROUBLESHOOTING PLUGINS *lsp-timeout-troubleshooting-plugins*
125133
fail if they don't hook into |LspAttach| or |LspDetach| events or
126134
`vim.lsp.get_clients(...)` properly
127135
* Some LSP servers may misbehave upon restart if they don't keep cache
128-
* Some LSP plugins may hook into serveral LSPs and fail upon restart
136+
* Some LSP plugins may hook into serveral LSPs at the same time and fail upon
137+
restart
129138
* See also: https://github.com/neovim/nvim-lspconfig#troubleshooting
130139
Plugins that are known to misbehave:
131140

132-
* **null-ls**: fails to startup, replace by `efm-languageserver` or use
141+
* **null-ls** and **none-ls**:
142+
as of v1.2.0 should work properly; if
143+
didn't, replace by `efm-languageserver` or run `:e` upon focusing or use
133144
workaround,
134-
see
145+
see:
135146
https://github.com/hinell/lsp-timeout.nvim/issues/7#issuecomment-1764402683
136147
* **efm-languageserver**:
137148
make sure that `filetypes` are specified in the
138149
setup config
139150
see:
140151
https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#efm
141-
* **barbecue.nvim**:
142-
**nvim-navic**:
152+
* **barbecue.nvim** and **nvim-navic**:
143153
you have to attach `navic.nvim`
144-
to one specific LSP; avoid attaching it to generic (e.g. efmls) LSPs:
154+
to one specific LSP; avoid attaching it to generic ones (e.g. efmls):
145155

146156
see: https://github.com/utilyre/barbecue.nvim
147157
>lua
@@ -153,6 +163,13 @@ see: https://github.com/utilyre/barbecue.nvim
153163
end
154164
end,
155165
<
166+
* **pmizio/typescript-tools.nvim**:
167+
run
168+
`lspconfig["typescript-tools"].setup({ filetypes = })`
169+
make sure that
170+
`filetypes` are specified in the setup config
171+
see:
172+
https://github.com/hinell/lsp-timeout.nvim/issues/12#issuecomment-1779750062
156173
September 26, 2023
157174
Copyright - Alexander Davronov, et.al.
158175

doc/preview-2.png

96.5 KB
Loading

doc/preview.png

-108 KB
Binary file not shown.

doc/ts-tools.mov

1.1 MB
Binary file not shown.

0 commit comments

Comments
 (0)