mirror of
https://github.com/neovim/neovim
synced 2025-07-30 02:11:52 +00:00
Compare commits
78 Commits
Author | SHA1 | Date | |
---|---|---|---|
ee77d8665f | |||
a09b3cbcb1 | |||
23c99bb78f | |||
fd02e63513 | |||
0547b4cdad | |||
052337ddfc | |||
82283a3d10 | |||
704151c8a2 | |||
e4629f203f | |||
ce3db4648a | |||
f558af8b18 | |||
cda119055a | |||
8399f73574 | |||
faaf83a49e | |||
0493fa00fa | |||
6b38b9e4c6 | |||
047e36695f | |||
e1cc8e8e09 | |||
49469ec6b9 | |||
5e47cf27b4 | |||
dd0a3cd22f | |||
10590e4b20 | |||
b4a10dd9b2 | |||
dd7206af37 | |||
92e80f18a8 | |||
5d41bfccec | |||
641e229132 | |||
f225028a0d | |||
02dae63bf7 | |||
6274f06aba | |||
47bd62c15c | |||
d2730365ef | |||
284b398eb9 | |||
2645669c89 | |||
b5cee56757 | |||
d56f6fed9c | |||
910cdac22c | |||
23a64c95d8 | |||
1b2666cd21 | |||
1bf90bf9d3 | |||
fafd636267 | |||
ef71c89129 | |||
972dd758cb | |||
d379db428b | |||
4c48cf3020 | |||
2cd1ff762e | |||
941dc1b0ca | |||
b99dad7b4c | |||
1def94597b | |||
b678d33dd3 | |||
a012387074 | |||
599ad5d3b8 | |||
924fa143cc | |||
327e8ddb18 | |||
a1f557690f | |||
f2f37712a4 | |||
4f452a6744 | |||
9571a87d3d | |||
3817518ab4 | |||
56d9412999 | |||
ddd3363a42 | |||
d453d2c484 | |||
c5d1b0f3da | |||
e0622b4c65 | |||
b781f2b072 | |||
e63fdf63ba | |||
eef3809067 | |||
43f4955f70 | |||
6f693be1ee | |||
36e2846b49 | |||
60b56ed458 | |||
8250d6795b | |||
38d02d58b2 | |||
7d6aa82b69 | |||
6c65f8f182 | |||
6cb5ffc075 | |||
baa5263b56 | |||
2abdb89522 |
@ -1,40 +0,0 @@
|
||||
image: freebsd/latest
|
||||
|
||||
packages:
|
||||
- cmake
|
||||
- gmake
|
||||
- ninja
|
||||
- libtool
|
||||
- automake
|
||||
- pkgconf
|
||||
- unzip
|
||||
- wget
|
||||
- gettext
|
||||
- python
|
||||
- libffi
|
||||
- gdb
|
||||
|
||||
sources:
|
||||
- https://github.com/neovim/neovim
|
||||
|
||||
environment:
|
||||
SOURCEHUT: 1
|
||||
LANG: en_US.UTF-8
|
||||
CMAKE_EXTRA_FLAGS: -DCI_BUILD=ON -DMIN_LOG_LEVEL=3
|
||||
|
||||
tasks:
|
||||
- build-deps: |
|
||||
cd neovim
|
||||
gmake deps
|
||||
- build: |
|
||||
cd neovim
|
||||
gmake CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="${CMAKE_EXTRA_FLAGS}" nvim
|
||||
- functionaltest: |
|
||||
cd neovim
|
||||
gmake functionaltest
|
||||
- unittest: |
|
||||
cd neovim
|
||||
gmake unittest
|
||||
- oldtest: |
|
||||
cd neovim
|
||||
gmake oldtest
|
@ -1,44 +1,41 @@
|
||||
# sourcehut CI: https://builds.sr.ht/~jmk/neovim
|
||||
|
||||
image: openbsd/latest
|
||||
image: openbsd/6.5
|
||||
|
||||
packages:
|
||||
- autoconf-2.71
|
||||
- automake-1.16.3
|
||||
- autoconf-2.69p2
|
||||
- automake-1.15.1
|
||||
- cmake
|
||||
- gettext-runtime-0.21p1
|
||||
- gettext-tools-0.21p1
|
||||
- gettext-0.19.8.1p3
|
||||
- gettext-tools-0.19.8.1
|
||||
- gmake
|
||||
- libtool
|
||||
- ninja-1.10.2p0
|
||||
- unzip-6.0p14
|
||||
- gdb
|
||||
- ninja-1.8.2p0
|
||||
- unzip-6.0p11
|
||||
|
||||
sources:
|
||||
- https://github.com/neovim/neovim
|
||||
|
||||
environment:
|
||||
SOURCEHUT: 1
|
||||
LC_CTYPE: en_US.UTF-8
|
||||
CMAKE_EXTRA_FLAGS: -DCI_BUILD=ON -DMIN_LOG_LEVEL=3
|
||||
|
||||
tasks:
|
||||
- build-deps: |
|
||||
export AUTOCONF_VERSION=2.71
|
||||
export AUTOMAKE_VERSION=1.16
|
||||
mkdir neovim/.deps
|
||||
cd neovim/.deps
|
||||
cmake -G Ninja ../third-party/
|
||||
cmake --build . --config RelWithDebInfo
|
||||
- build: |
|
||||
mkdir neovim/build
|
||||
cd neovim/build
|
||||
cmake -G Ninja $CMAKE_EXTRA_FLAGS ..
|
||||
cmake --build . --config RelWithDebInfo
|
||||
./bin/nvim --version
|
||||
- functionaltest: |
|
||||
cd neovim/build
|
||||
cmake --build . --config RelWithDebInfo --target functionaltest
|
||||
- oldtest: |
|
||||
export AUTOCONF_VERSION=2.69
|
||||
export AUTOMAKE_VERSION=1.15
|
||||
cd neovim
|
||||
mkdir .deps
|
||||
cd .deps
|
||||
cmake -G Ninja ../third-party/
|
||||
cmake --build . --config Debug
|
||||
cd ..
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -G Ninja -DMIN_LOG_LEVEL=3 ..
|
||||
cmake --build . --config Debug
|
||||
./bin/nvim --version
|
||||
- test: |
|
||||
export LC_CTYPE=en_US.UTF-8
|
||||
# functional tests
|
||||
cd neovim/build
|
||||
# cmake --build . --config Debug --target functionaltest
|
||||
# oldtests
|
||||
cd ..
|
||||
gmake oldtest
|
||||
|
@ -1,11 +1,11 @@
|
||||
BasedOnStyle: Google
|
||||
Language: Cpp
|
||||
ColumnLimit: 100
|
||||
ColumnLimit: 80
|
||||
IndentWidth: 2
|
||||
TabWidth: 8
|
||||
TabWidth: 2
|
||||
UseTab: Never
|
||||
IndentCaseLabels: false
|
||||
BreakBeforeBraces: Custom
|
||||
IndentCaseLabels: true
|
||||
BreakBeforeBraces: Linux
|
||||
AlignEscapedNewlinesLeft: false
|
||||
AllowShortFunctionsOnASingleLine: false
|
||||
AlignTrailingComments: true
|
||||
@ -17,24 +17,4 @@ AllowShortLoopsOnASingleLine: false
|
||||
BinPackParameters: false
|
||||
BreakBeforeBinaryOperators: true
|
||||
BreakBeforeTernaryOperators: true
|
||||
ContinuationIndentWidth: 2
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: No
|
||||
AlwaysBreakTemplateDeclarations: No
|
||||
AlignEscapedNewlines: DontAlign
|
||||
BinPackArguments: false
|
||||
BraceWrapping:
|
||||
AfterClass: false
|
||||
AfterControlStatement: false
|
||||
AfterEnum: false
|
||||
AfterFunction: true
|
||||
AfterObjCDeclaration: false
|
||||
AfterStruct: false
|
||||
AfterUnion: false
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
IndentBraces: false
|
||||
PointerAlignment: Right
|
||||
SortIncludes: false
|
||||
Cpp11BracedListStyle: false
|
||||
ContinuationIndentWidth: 4
|
||||
|
2
.clangd
2
.clangd
@ -1,2 +0,0 @@
|
||||
CompileFlags:
|
||||
CompilationDatabase: build/ # Search build/ directory for compile_commands.json
|
@ -8,9 +8,6 @@ end_of_line = lf
|
||||
insert_final_newline = true
|
||||
charset = utf-8
|
||||
|
||||
[*.{c,h,in,lua}]
|
||||
max_line_length = 100
|
||||
|
||||
[{Makefile,**/Makefile,runtime/doc/*.txt}]
|
||||
indent_style = tab
|
||||
indent_size = 8
|
||||
|
@ -1,53 +0,0 @@
|
||||
# To use this file (requires git 2.23):
|
||||
# git config blame.ignoreRevsFile .git-blame-ignore-revs
|
||||
|
||||
# eval.c: factor out eval/funcs.c #11828
|
||||
# - This is a move/rename. git 2.33 doesn't know how to ignore it.
|
||||
# It is here anyway, (1) in case git improves later, and (2) to
|
||||
# save you the trouble of attempting this.
|
||||
6c5bbf07d988ef55e5e8ba8d70b62c1f0885261b
|
||||
|
||||
# symbol renames
|
||||
6186df3562e33e92f04ed8c850204ceabc4746e1
|
||||
|
||||
# style (uncrustify, etc.)
|
||||
2d240024acbd68c2d3f82bc72cb12b1a4928c6bf
|
||||
61178778230e609d68b271ffd53ffd993cd23c42
|
||||
15af08ad176339d1f269ce264bb0efea283c9536
|
||||
47f99d66440ae8be26b34531989ac61edc1ad9fe
|
||||
1e49a1c888a3d9a581f4aa409a26ada3ac2417cb
|
||||
3b3dbcf7b7ba5466e6ab643e256f2374b520a6b2
|
||||
e8067d1490a31ff76143d576dc9948b4f09c6c55
|
||||
d5b66e88601b4d2fde5d905f9d12847126ba4449
|
||||
07715044887d82f74254e64c4c32fa49b0501bea
|
||||
6ed43f8f1caad702f9590d174c5ec142f3d85b18
|
||||
0a83017fe95df0290adb98ec6bf457b96a3fab17
|
||||
867e8885991ae450019c18aa5e42546bd4b62c2c
|
||||
1f49268c46fcbe65f7e2e2cb620e6f51c059cf9e
|
||||
51a98aa0c2fe3231a0ffc8a78189bc6fafd6abf6
|
||||
853346a94d6aa78c97314a3b217fb5a5408a47f1
|
||||
30fefee684e641a0c6867446c6de30efa2f0a126
|
||||
f4ca3a29ddcb0c98e8e09c45a6342af709f8cc45
|
||||
48e67b229415b4e2b3315bd00b817e5f9ab970c8
|
||||
7a26eb8a567cbc831d4f629f9eccb767a44436b8
|
||||
2f9b9e61d7417183f2d9f36d804247c0926be9d4
|
||||
c0767bd4f3ce7b34bb77da0657c49ba10ba1b32e
|
||||
d90fb1c0bfc1e64c783c385a79e7de87013dadba
|
||||
9c268263b1792d00b3ffdfd7495af2575862656e
|
||||
8c74c895b300bcee5fa937a2329d1d4756567b42
|
||||
40be47e0faef7aa015eb4ba44ceb1ee1a03e97cf
|
||||
4472c56d54f447040f6e8610b261b7efa0d04eb6
|
||||
a68faed02dc8e37b8f10da14dc02e33e6ed93947
|
||||
725cbe7d414f609e769081276f2a034e32a4337b
|
||||
7e3bdc75e44b9139d8afaea4381b53ae78b15746
|
||||
4ba12b3dda34472c193c9fa8ffd7d3bd5b6c04d6
|
||||
849f104c2789c884428fd45501912c6591a78e12
|
||||
38dd53c525054daf83dba27d7d46e90e8b41fa50
|
||||
6059784770c4c88fb6fe528b9f7634192fa1164e
|
||||
ee031eb5256bb83e0d6add2bae6fd943a4186ffe
|
||||
69e11b58b4db0952f11a5ff85aa7150b5f5b8db8
|
||||
271bb32855853b011fceaf0ad2f829bce66b2a19
|
||||
|
||||
# typos
|
||||
d238b8f6003d34cae7f65ff7585b48a2cd9449fb
|
||||
4547137aaff32b20172870a549d3a28a3c7adf1c
|
5
.gitattributes
vendored
5
.gitattributes
vendored
@ -1,6 +1 @@
|
||||
*.h linguist-language=C
|
||||
src/nvim/testdir/test42.in diff
|
||||
.github/ export-ignore
|
||||
.travis.yml export-ignore
|
||||
codecov.yml export-ignore
|
||||
.builds/ export-ignore
|
||||
|
3
.github/FUNDING.yml
vendored
3
.github/FUNDING.yml
vendored
@ -1,2 +1 @@
|
||||
github: neovim
|
||||
open_collective: neovim
|
||||
custom: https://salt.bountysource.com/teams/neovim
|
||||
|
29
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
29
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Report a problem in Nvim
|
||||
title: ''
|
||||
labels: bug
|
||||
|
||||
---
|
||||
|
||||
<!-- Before reporting: search existing issues and check the FAQ. -->
|
||||
|
||||
- `nvim --version`:
|
||||
- `vim -u DEFAULTS` (version: ) behaves differently?
|
||||
- Operating system/version:
|
||||
- Terminal name/version:
|
||||
- `$TERM`:
|
||||
|
||||
### Steps to reproduce using `nvim -u NORC`
|
||||
|
||||
```
|
||||
nvim -u NORC
|
||||
# Alternative for shell-related problems:
|
||||
# env -i TERM=ansi-256color "$(which nvim)"
|
||||
|
||||
```
|
||||
|
||||
### Actual behaviour
|
||||
|
||||
### Expected behaviour
|
||||
|
75
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
75
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@ -1,75 +0,0 @@
|
||||
name: Bug Report
|
||||
description: Report a problem in Neovim
|
||||
labels: [bug]
|
||||
body:
|
||||
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
_Before reporting:_ search [existing issues](https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aopen+label%3Abug) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ). Usage questions such as "How do I...?" belong on the [Neovim Discourse](https://neovim.discourse.group/c/7-category/7) and will be closed.
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
label: "Neovim version (nvim -v)"
|
||||
placeholder: "0.6.0 commit db1b0ee3b30f"
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: "Vim (not Nvim) behaves the same?"
|
||||
description: "Does `vim -u DEFAULTS` have the same issue? Note the exact Vim version (`8.x.yyyy`)."
|
||||
placeholder: "no, vim 7.3.432"
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: "Operating system/version"
|
||||
placeholder: "macOS 11.5"
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: "Terminal name/version"
|
||||
placeholder: "xterm 3.1"
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: "$TERM environment variable"
|
||||
placeholder: "xterm-256color"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
label: "Installation"
|
||||
description: "How did you install neovim: build from repo / system package manager / appimage / homebrew / snap / chocolatey / other (describe)?"
|
||||
placeholder: "Arch User Repository (AUR)"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "How to reproduce the issue"
|
||||
description: |
|
||||
- Steps to reproduce using `nvim --clean` ("factory defaults").
|
||||
- For build failures: list the exact steps including CMake flags (if any).
|
||||
- For shell-related problems: try `env -i TERM=ansi-256color "$(which nvim)"`.
|
||||
placeholder: |
|
||||
nvim --clean
|
||||
:edit foo
|
||||
yiwp
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Expected behavior"
|
||||
description: "Describe the behavior you expect. May include logs, images, or videos."
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Actual behavior"
|
||||
validations:
|
||||
required: true
|
5
.github/ISSUE_TEMPLATE/config.yml
vendored
5
.github/ISSUE_TEMPLATE/config.yml
vendored
@ -1,5 +0,0 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Question
|
||||
url: https://neovim.discourse.group/
|
||||
about: Ask questions about configuration and usage of Neovim
|
27
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
27
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Request an enhancement for Nvim
|
||||
title: ''
|
||||
labels: enhancement
|
||||
|
||||
---
|
||||
|
||||
<!-- Before reporting: search existing issues and check the FAQ. -->
|
||||
|
||||
- `nvim --version`:
|
||||
- `vim -u DEFAULTS` (version: ) behaves differently?
|
||||
- Operating system/version:
|
||||
- Terminal name/version:
|
||||
- `$TERM`:
|
||||
|
||||
### Steps to reproduce using `nvim -u NORC`
|
||||
|
||||
```
|
||||
nvim -u NORC
|
||||
|
||||
```
|
||||
|
||||
### Actual behaviour
|
||||
|
||||
### Expected behaviour
|
||||
|
21
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
21
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
@ -1,21 +0,0 @@
|
||||
name: Feature request
|
||||
description: Request an enhancement for Neovim
|
||||
labels: [enhancement]
|
||||
body:
|
||||
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Before requesting: search [existing issues](https://github.com/neovim/neovim/labels/enhancement) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ).
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
label: "Feature already in Vim?"
|
||||
description: "Does the feature already exist in Vim? If possible, specify which version (or commit) that introduced it."
|
||||
placeholder: "Yes, Vim 7.3.432"
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Feature description"
|
||||
validations:
|
||||
required: true
|
54
.github/ISSUE_TEMPLATE/lsp_bug_report.yml
vendored
54
.github/ISSUE_TEMPLATE/lsp_bug_report.yml
vendored
@ -1,54 +0,0 @@
|
||||
name: Language server (LSP) client bug
|
||||
description: Report an issue with Neovim LSP
|
||||
labels: [bug, lsp]
|
||||
body:
|
||||
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
_Before reporting:_ search [existing issues](https://github.com/neovim/neovim/issues?q=is%3Aissue+is%3Aopen+label%3Abug) and check the [FAQ](https://github.com/neovim/neovim/wiki/FAQ). Usage questions such as "How do I...?" or "Why isn't X language server/feature working?" belong on the [Neovim Discourse](https://neovim.discourse.group/c/7-category/7) and will be closed.
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
label: "Neovim version (nvim -v)"
|
||||
placeholder: "0.6.0 commit db1b0ee3b30f"
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: "Language server name/version"
|
||||
placeholder: "rls 0.5.2"
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: "Operating system/version"
|
||||
placeholder: "emacs 23"
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: 'Steps to reproduce using "nvim -u minimal_init.lua"'
|
||||
description: |
|
||||
- Download the minimal config with `curl -LO https://raw.githubusercontent.com/neovim/nvim-lspconfig/master/test/minimal_init.lua` and modify it to include any specific commands or servers pertaining to your issues.
|
||||
- _Note_: if the issue is with an autocompletion or other LSP plugin, report to that plugin's issue tracker.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Expected behavior"
|
||||
description: "Describe the behavior you expect. May include logs, images, or videos."
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: "Actual behavior"
|
||||
|
||||
- type: input
|
||||
attributes:
|
||||
label: "Log file"
|
||||
placeholder: "https://gist.github.com/prakhar1989/1b0a2c9849b2e1e912fb"
|
||||
description: |
|
||||
- Upload `lsp.log` before and after the problem in a [secret gist](https://gist.github.com/). Paste the URL to the gist.
|
||||
- You can set the log level by adding `vim.lsp.set_log_level("debug")` after setting up LSP in your config.
|
||||
- You can find the location of the log with `:lua print(vim.lsp.get_log_path())`
|
65
.github/labeler.yml
vendored
65
.github/labeler.yml
vendored
@ -1,65 +0,0 @@
|
||||
"lsp":
|
||||
- runtime/lua/vim/lsp.lua
|
||||
- runtime/lua/vim/lsp/*
|
||||
|
||||
"lua":
|
||||
- runtime/lua/**/*
|
||||
- src/nvim/lua/*
|
||||
|
||||
"tui":
|
||||
- src/nvim/tui/tui.*
|
||||
|
||||
"treesitter":
|
||||
- src/nvim/lua/treesitter.*
|
||||
- runtime/lua/vim/treesitter.lua
|
||||
- runtime/lua/vim/treesitter/*
|
||||
|
||||
"diagnostic":
|
||||
- runtime/lua/vim/diagnostic.lua
|
||||
|
||||
"dependencies":
|
||||
- third-party/**/*
|
||||
|
||||
"spell":
|
||||
- src/nvim/spell*
|
||||
|
||||
"terminal":
|
||||
- src/nvim/terminal.*
|
||||
|
||||
"column":
|
||||
- src/nvim/mark.h
|
||||
- src/nvim/mark.c
|
||||
- src/nvim/sign*
|
||||
|
||||
"folds":
|
||||
- src/nvim/fold*
|
||||
|
||||
"mouse":
|
||||
- src/nvim/mouse*
|
||||
|
||||
"documentation":
|
||||
- all: ["runtime/doc/*"]
|
||||
|
||||
"clipboard":
|
||||
- runtime/autoload/provider/clipboard.vim
|
||||
|
||||
"diff":
|
||||
- src/nvim/diff.*
|
||||
|
||||
"build":
|
||||
- CMakeLists.txt
|
||||
- "**/CMakeLists.txt"
|
||||
- "**/Makefile"
|
||||
- "**/*.cmake"
|
||||
|
||||
"test":
|
||||
- all: ["test/**/*"]
|
||||
|
||||
"ci":
|
||||
- .github/labeler.yml
|
||||
- .github/workflows/**/*
|
||||
- .builds/*
|
||||
- ci/**/*
|
||||
|
||||
"filetype":
|
||||
- runtime/lua/vim/filetype.lua
|
16
.github/scripts/remove-reviewers.js
vendored
16
.github/scripts/remove-reviewers.js
vendored
@ -1,16 +0,0 @@
|
||||
module.exports = async ({github, context}) => {
|
||||
const requestedReviewers = await github.rest.pulls.listRequestedReviewers({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: context.issue.number
|
||||
});
|
||||
|
||||
const reviewers = requestedReviewers.data.users.map(e => e.login)
|
||||
|
||||
github.rest.pulls.removeRequestedReviewers({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: context.issue.number,
|
||||
reviewers: reviewers
|
||||
});
|
||||
}
|
95
.github/scripts/reviews.js
vendored
95
.github/scripts/reviews.js
vendored
@ -1,95 +0,0 @@
|
||||
module.exports = async ({github, context}) => {
|
||||
const pr_data = await github.rest.pulls.get({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: context.issue.number
|
||||
})
|
||||
const labels = pr_data.data.labels.map(e => e.name)
|
||||
|
||||
const reviewers = new Set()
|
||||
if (labels.includes('api')) {
|
||||
reviewers.add("bfredl")
|
||||
reviewers.add("gpanders")
|
||||
reviewers.add("muniter")
|
||||
}
|
||||
|
||||
if (labels.includes('build')) {
|
||||
reviewers.add("jamessan")
|
||||
}
|
||||
|
||||
if (labels.includes('ci')) {
|
||||
reviewers.add("jamessan")
|
||||
}
|
||||
|
||||
if (labels.includes('column')) {
|
||||
reviewers.add("lewis6991")
|
||||
}
|
||||
|
||||
if (labels.includes('diagnostic')) {
|
||||
reviewers.add("gpanders")
|
||||
}
|
||||
|
||||
if (labels.includes('diff')) {
|
||||
reviewers.add("lewis6991")
|
||||
}
|
||||
|
||||
if (labels.includes('dependencies')) {
|
||||
reviewers.add("jamessan")
|
||||
}
|
||||
|
||||
if (labels.includes('distribution')) {
|
||||
reviewers.add("jamessan")
|
||||
}
|
||||
|
||||
if (labels.includes('documentation')) {
|
||||
reviewers.add("clason")
|
||||
}
|
||||
|
||||
if (labels.includes('extmarks')) {
|
||||
reviewers.add("bfredl")
|
||||
}
|
||||
|
||||
if (labels.includes('filetype')) {
|
||||
reviewers.add("clason")
|
||||
reviewers.add("gpanders")
|
||||
}
|
||||
|
||||
if (labels.includes('gui')) {
|
||||
reviewers.add("glacambre")
|
||||
reviewers.add("smolck")
|
||||
}
|
||||
|
||||
if (labels.includes('lsp')) {
|
||||
reviewers.add("mfussenegger")
|
||||
reviewers.add("mjlbach")
|
||||
}
|
||||
|
||||
if (labels.includes('treesitter')) {
|
||||
reviewers.add("bfredl")
|
||||
reviewers.add("vigoux")
|
||||
}
|
||||
|
||||
if (labels.includes('typo')) {
|
||||
reviewers.add("dundargoc")
|
||||
}
|
||||
|
||||
if (labels.includes('ui')) {
|
||||
reviewers.add("bfredl")
|
||||
}
|
||||
|
||||
if (labels.includes('vim-patch')) {
|
||||
reviewers.add("seandewar")
|
||||
reviewers.add("zeertzjq")
|
||||
}
|
||||
|
||||
// Remove person that opened the PR since they can't review themselves
|
||||
const pr_opener = pr_data.data.user.login
|
||||
reviewers.delete(pr_opener)
|
||||
|
||||
github.rest.pulls.requestReviewers({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: context.issue.number,
|
||||
reviewers: Array.from(reviewers)
|
||||
});
|
||||
}
|
20
.github/workflows/api-docs-check.yml
vendored
20
.github/workflows/api-docs-check.yml
vendored
@ -1,20 +0,0 @@
|
||||
name: Missing API docs
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
branches-ignore:
|
||||
- 'marvim/api-doc-update**'
|
||||
paths:
|
||||
- 'src/nvim/api/*.[ch]'
|
||||
- 'runtime/lua/**.lua'
|
||||
- 'runtime/doc/**'
|
||||
|
||||
jobs:
|
||||
call-regen-api-docs:
|
||||
if: github.event.pull_request.draft == false
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
uses: ./.github/workflows/api-docs.yml
|
||||
with:
|
||||
check_only: true
|
70
.github/workflows/api-docs.yml
vendored
70
.github/workflows/api-docs.yml
vendored
@ -1,70 +0,0 @@
|
||||
# Autogenerate the API docs on new commit to important branches
|
||||
# Also work as a check for PR's to not forget committing their doc changes
|
||||
# called from api-docs-check.yml
|
||||
name: Autogenerate API docs
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'src/nvim/api/*.[ch]'
|
||||
- 'runtime/lua/**.lua'
|
||||
- 'runtime/doc/**'
|
||||
branches:
|
||||
- 'master'
|
||||
- 'release-[0-9]+.[0-9]+'
|
||||
workflow_dispatch:
|
||||
workflow_call:
|
||||
inputs:
|
||||
check_only:
|
||||
type: boolean
|
||||
default: false
|
||||
required: false
|
||||
|
||||
jobs:
|
||||
regen-api-docs:
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y python3 luajit
|
||||
conda install -c conda-forge doxygen=1.9.2 msgpack-python
|
||||
echo "$CONDA/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Setup git config
|
||||
run: |
|
||||
git config --global user.name 'marvim'
|
||||
git config --global user.email 'marvim@users.noreply.github.com'
|
||||
|
||||
- run: printf 'DOC_BRANCH=marvim/api-doc-update/%s\n' ${GITHUB_REF#refs/heads/} >> $GITHUB_ENV
|
||||
|
||||
- name: Generate docs
|
||||
id: docs
|
||||
run: |
|
||||
git checkout -b ${DOC_BRANCH}
|
||||
python3 scripts/gen_vimdoc.py
|
||||
printf '::set-output name=UPDATED_DOCS::%s\n' $([ -z "$(git diff)" ]; echo $?)
|
||||
|
||||
- name: FAIL, PR has not committed doc changes
|
||||
if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 && inputs.check_only }}
|
||||
run: |
|
||||
echo "Job failed, run ./scripts/gen_vimdoc.py and commit your doc changes"
|
||||
echo "The doc generation produces the following changes:"
|
||||
git --no-pager diff
|
||||
exit 1
|
||||
|
||||
- name: Automatic PR
|
||||
if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 && !inputs.check_only }}
|
||||
run: |
|
||||
git add -u
|
||||
git commit -m 'docs: regenerate [skip ci]'
|
||||
git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} ${DOC_BRANCH}
|
||||
gh pr create --draft --fill --base ${GITHUB_REF#refs/heads/} --head ${DOC_BRANCH} || true
|
33
.github/workflows/backport.yml
vendored
33
.github/workflows/backport.yml
vendored
@ -1,33 +0,0 @@
|
||||
name: Backport
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [closed, labeled]
|
||||
issue_comment:
|
||||
types: [created]
|
||||
jobs:
|
||||
backport:
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
name: Backport Pull Request
|
||||
if: >
|
||||
github.repository_owner == 'neovim' && (
|
||||
github.event_name == 'pull_request_target' &&
|
||||
github.event.pull_request.merged
|
||||
) || (
|
||||
github.event_name == 'issue_comment' &&
|
||||
github.event.issue.pull_request &&
|
||||
contains(github.event.comment.body, '/backport')
|
||||
)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
# required to find all branches
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
- name: Create backport PRs
|
||||
uses: zeebe-io/backport-action@v0.0.7
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
github_workspace: ${{ github.workspace }}
|
249
.github/workflows/ci.yml
vendored
249
.github/workflows/ci.yml
vendored
@ -1,249 +0,0 @@
|
||||
name: CI
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
- 'release-[0-9]+.[0-9]+'
|
||||
pull_request:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
branches:
|
||||
- 'master'
|
||||
- 'release-[0-9]+.[0-9]+'
|
||||
paths-ignore:
|
||||
- 'runtime/doc/*'
|
||||
|
||||
# Cancel any in-progress CI runs for a PR if it is updated
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
# This job tests two things: it lints the code but also builds neovim using
|
||||
# system dependencies instead of bundled dependencies. This is to make sure
|
||||
# we are able to build neovim without pigeonholing ourselves into specifics
|
||||
# of the bundled dependencies.
|
||||
|
||||
if: (github.event_name == 'pull_request' && github.base_ref == 'master' && !github.event.pull_request.draft) || (github.event_name == 'push' && github.ref == 'refs/heads/master')
|
||||
runs-on: ubuntu-20.04
|
||||
timeout-minutes: 10
|
||||
env:
|
||||
CC: gcc
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup common environment variables
|
||||
run: ./.github/workflows/env.sh lint
|
||||
|
||||
- name: Install apt packages
|
||||
run: |
|
||||
sudo add-apt-repository ppa:neovim-ppa/stable
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y \
|
||||
autoconf \
|
||||
automake \
|
||||
build-essential \
|
||||
ccache \
|
||||
cmake \
|
||||
flake8 \
|
||||
gettext \
|
||||
gperf \
|
||||
libluajit-5.1-dev \
|
||||
libmsgpack-dev \
|
||||
libtermkey-dev \
|
||||
libtool-bin \
|
||||
libtree-sitter-dev \
|
||||
libunibilium-dev \
|
||||
libuv1-dev \
|
||||
libvterm-dev \
|
||||
locales \
|
||||
lua-busted \
|
||||
lua-check \
|
||||
lua-filesystem \
|
||||
lua-inspect \
|
||||
lua-lpeg \
|
||||
lua-luv-dev \
|
||||
lua-nvim \
|
||||
luajit \
|
||||
ninja-build \
|
||||
pkg-config
|
||||
|
||||
- name: Cache artifacts
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
${{ env.CACHE_NVIM_DEPS_DIR }}
|
||||
~/.ccache
|
||||
key: lint-${{ hashFiles('cmake/*', '**/CMakeLists.txt', '!third-party/**CMakeLists.txt') }}-${{ github.base_ref }}
|
||||
|
||||
- name: Build third-party
|
||||
run: ./ci/before_script.sh
|
||||
|
||||
- name: Build nvim
|
||||
run: ./ci/run_tests.sh build_nvim
|
||||
|
||||
- if: "!cancelled()"
|
||||
name: clint-full
|
||||
run: ./ci/run_lint.sh clint-full
|
||||
|
||||
- if: "!cancelled()"
|
||||
name: lualint
|
||||
run: ./ci/run_lint.sh lualint
|
||||
|
||||
- if: "!cancelled()"
|
||||
name: pylint
|
||||
run: ./ci/run_lint.sh pylint
|
||||
|
||||
- if: "!cancelled()"
|
||||
name: shlint
|
||||
run: ./ci/run_lint.sh shlint
|
||||
|
||||
- if: "!cancelled()"
|
||||
name: check-single-includes
|
||||
run: ./ci/run_lint.sh check-single-includes
|
||||
|
||||
- name: Cache dependencies
|
||||
run: ./ci/before_cache.sh
|
||||
|
||||
posix:
|
||||
name: ${{ matrix.runner }} ${{ matrix.flavor }} (cc=${{ matrix.cc }})
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- flavor: asan
|
||||
cc: clang-13
|
||||
runner: ubuntu-20.04
|
||||
os: linux
|
||||
- flavor: tsan
|
||||
cc: clang-13
|
||||
runner: ubuntu-20.04
|
||||
os: linux
|
||||
- cc: clang
|
||||
runner: macos-10.15
|
||||
os: osx
|
||||
- cc: clang
|
||||
runner: macos-11.0
|
||||
os: osx
|
||||
|
||||
# The functionaltest-lua test two things simultaneously:
|
||||
# 1. Check that the tests pass with PUC Lua instead of LuaJIT.
|
||||
# 2. Use as oldest/minimum versions of dependencies/build tools we
|
||||
# still explicitly support so we don't accidentally rely on
|
||||
# features that is only available on later versions.
|
||||
- flavor: functionaltest-lua
|
||||
cc: gcc
|
||||
runner: ubuntu-20.04
|
||||
os: linux
|
||||
cmake: minimum_required
|
||||
runs-on: ${{ matrix.runner }}
|
||||
timeout-minutes: 45
|
||||
if: github.event.pull_request.draft == false
|
||||
env:
|
||||
CC: ${{ matrix.cc }}
|
||||
CI_OS_NAME: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup common environment variables
|
||||
run: ./.github/workflows/env.sh ${{ matrix.flavor }}
|
||||
|
||||
- name: Install apt packages
|
||||
if: matrix.os == 'linux'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y autoconf automake build-essential ccache cmake cpanminus cscope gcc-multilib gdb gettext gperf language-pack-tr libtool-bin locales ninja-build pkg-config python3 python3-pip python3-setuptools unzip valgrind xclip
|
||||
|
||||
- name: Install minimum required version of cmake
|
||||
if: matrix.cmake == 'minimum_required'
|
||||
env:
|
||||
CMAKE_URL: 'https://cmake.org/files/v3.10/cmake-3.10.0-Linux-x86_64.sh'
|
||||
CMAKE_VERSION: '3.10.0'
|
||||
shell: bash
|
||||
run: |
|
||||
curl --retry 5 --silent --show-error --fail -o /tmp/cmake-installer.sh "$CMAKE_URL"
|
||||
mkdir -p "$HOME/.local/bin" /opt/cmake-custom
|
||||
chmod a+x /tmp/cmake-installer.sh
|
||||
/tmp/cmake-installer.sh --prefix=/opt/cmake-custom --skip-license
|
||||
ln -sfn /opt/cmake-custom/bin/cmake "$HOME/.local/bin/cmake"
|
||||
cmake_version="$(cmake --version | head -1)"
|
||||
echo "$cmake_version" | grep -qF "cmake version $CMAKE_VERSION" || {
|
||||
echo "Unexpected CMake version: $cmake_version"
|
||||
exit 1
|
||||
}
|
||||
|
||||
- name: Install new clang
|
||||
if: matrix.flavor == 'asan' || matrix.flavor == 'tsan'
|
||||
run: |
|
||||
wget https://apt.llvm.org/llvm.sh
|
||||
chmod a+x llvm.sh
|
||||
sudo ./llvm.sh 13
|
||||
rm llvm.sh
|
||||
|
||||
- name: Install brew packages
|
||||
if: matrix.os == 'osx'
|
||||
run: |
|
||||
brew update --quiet
|
||||
brew install automake ccache cpanminus ninja
|
||||
|
||||
- name: Setup interpreter packages
|
||||
run: ./ci/install.sh
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
${{ env.CACHE_NVIM_DEPS_DIR }}
|
||||
~/.ccache
|
||||
key: ${{ matrix.runner }}-${{ matrix.flavor }}-${{ matrix.cc }}-${{ hashFiles('cmake/*', 'third-party/**', '**/CMakeLists.txt') }}-${{ github.base_ref }}
|
||||
|
||||
- name: Build third-party
|
||||
run: ./ci/before_script.sh
|
||||
|
||||
- name: Build
|
||||
run: ./ci/run_tests.sh build_nvim
|
||||
|
||||
- if: matrix.flavor != 'tsan' && matrix.flavor != 'functionaltest-lua' && !cancelled()
|
||||
name: Unittests
|
||||
run: ./ci/run_tests.sh unittests
|
||||
|
||||
- if: matrix.flavor != 'tsan' && !cancelled()
|
||||
name: Functionaltests
|
||||
run: ./ci/run_tests.sh functionaltests
|
||||
|
||||
- if: "!cancelled()"
|
||||
name: Oldtests
|
||||
run: ./ci/run_tests.sh oldtests
|
||||
|
||||
- if: "!cancelled()"
|
||||
name: Install nvim
|
||||
run: ./ci/run_tests.sh install_nvim
|
||||
|
||||
- name: Cache dependencies
|
||||
run: ./ci/before_cache.sh
|
||||
|
||||
windows:
|
||||
runs-on: windows-2019
|
||||
timeout-minutes: 45
|
||||
if: github.event.pull_request.draft == false
|
||||
env:
|
||||
DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', github.workspace) }}
|
||||
DEPS_PREFIX: ${{ format('{0}/nvim-deps/usr', github.workspace) }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
config: [ MINGW_64-gcov, MSVC_64 ]
|
||||
name: windows (${{ matrix.config }})
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ env.DEPS_BUILD_DIR }}
|
||||
key: ${{ matrix.config }}-${{ hashFiles('third-party\**') }}
|
||||
|
||||
- name: Run CI
|
||||
run: powershell ci\build.ps1
|
||||
env:
|
||||
CONFIGURATION: ${{ matrix.config }}
|
23
.github/workflows/commitlint.yml
vendored
23
.github/workflows/commitlint.yml
vendored
@ -1,23 +0,0 @@
|
||||
name: "Commit Linter"
|
||||
on:
|
||||
# Only pull_request and push honor [skip ci]. Since this workflow must pass
|
||||
# to merge a PR, it can't be skipped, so use pull_request_target
|
||||
pull_request_target:
|
||||
types: [opened, synchronize, reopened, ready_for_review]
|
||||
branches:
|
||||
- 'master'
|
||||
jobs:
|
||||
lint-commits:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event.pull_request.draft == false
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
path: pr_nvim
|
||||
- uses: rhysd/action-setup-vim@v1
|
||||
with:
|
||||
neovim: true
|
||||
- run: wget https://raw.githubusercontent.com/neovim/neovim/master/scripts/lintcommit.lua
|
||||
- run: nvim --clean -es +"cd pr_nvim" +"lua dofile('../lintcommit.lua').main({trace=true})"
|
44
.github/workflows/coverity-scan.yml
vendored
44
.github/workflows/coverity-scan.yml
vendored
@ -1,44 +0,0 @@
|
||||
name: Coverity
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 10 * * 1' # Run every Monday at 00:10
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
scan:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y autoconf automake build-essential cmake gettext gperf libtool-bin locales ninja-build pkg-config unzip
|
||||
|
||||
- name: Download Coverity
|
||||
run: |
|
||||
wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=neovim%2Fneovim" -O coverity_tool.tgz
|
||||
mkdir cov-scan
|
||||
tar ax -f coverity_tool.tgz --strip-components=1 -C cov-scan
|
||||
env:
|
||||
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
|
||||
|
||||
- name: Build dependencies
|
||||
run: make deps
|
||||
|
||||
- name: Build/scan neovim
|
||||
run: |
|
||||
env PATH=$(pwd)/cov-scan/bin:$PATH cov-build --dir cov-int make
|
||||
|
||||
- name: Submit results
|
||||
run: |
|
||||
tar zcf cov-scan.tgz cov-int
|
||||
curl --form token=$TOKEN \
|
||||
--form email=$EMAIL \
|
||||
--form file=@cov-scan.tgz \
|
||||
--form version="$(git rev-parse HEAD)" \
|
||||
--form description="Weekly GHA scan" \
|
||||
'https://scan.coverity.com/builds?project=neovim%2Fneovim'
|
||||
env:
|
||||
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
|
||||
EMAIL: ${{ secrets.COVERITY_SCAN_EMAIL }}
|
70
.github/workflows/env.sh
vendored
70
.github/workflows/env.sh
vendored
@ -1,70 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e -u
|
||||
|
||||
FLAVOR=${1:-}
|
||||
|
||||
cat <<EOF >> "$GITHUB_PATH"
|
||||
$HOME/.local/bin
|
||||
EOF
|
||||
|
||||
cat <<EOF >> "$GITHUB_ENV"
|
||||
CACHE_ENABLE=true
|
||||
CI_TARGET=tests
|
||||
CI_BUILD_DIR=$GITHUB_WORKSPACE
|
||||
BUILD_DIR=$GITHUB_WORKSPACE/build
|
||||
DEPS_BUILD_DIR=$HOME/nvim-deps
|
||||
INSTALL_PREFIX=$HOME/nvim-install
|
||||
LOG_DIR=$GITHUB_WORKSPACE/build/log
|
||||
NVIM_LOG_FILE=$GITHUB_WORKSPACE/build/.nvimlog
|
||||
VALGRIND_LOG=$GITHUB_WORKSPACE/build/log/valgrind-%p.log
|
||||
CACHE_NVIM_DEPS_DIR=$HOME/.cache/nvim-deps
|
||||
CACHE_MARKER=$HOME/.cache/nvim-deps/.ci_cache_marker
|
||||
CCACHE_BASEDIR=$GITHUB_WORKSPACE
|
||||
CCACHE_COMPRESS=1
|
||||
CCACHE_SLOPPINESS=time_macros,file_macro
|
||||
CCACHE_DIR=$HOME/.ccache
|
||||
EOF
|
||||
|
||||
DEPS_CMAKE_FLAGS=-DUSE_BUNDLED_GPERF=OFF
|
||||
FUNCTIONALTEST=functionaltest
|
||||
BUILD_FLAGS="CMAKE_FLAGS=-DCI_BUILD=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=$HOME/nvim-install -DBUSTED_OUTPUT_TYPE=nvim -DDEPS_PREFIX=$HOME/nvim-deps/usr -DMIN_LOG_LEVEL=3"
|
||||
|
||||
case "$FLAVOR" in
|
||||
asan)
|
||||
BUILD_FLAGS="$BUILD_FLAGS -DPREFER_LUA=ON"
|
||||
cat <<EOF >> "$GITHUB_ENV"
|
||||
CLANG_SANITIZER=ASAN_UBSAN
|
||||
SYMBOLIZER=asan_symbolize-13
|
||||
ASAN_OPTIONS=detect_leaks=1:check_initialization_order=1:log_path=$GITHUB_WORKSPACE/build/log/asan:intercept_tls_get_addr=0
|
||||
UBSAN_OPTIONS=print_stacktrace=1 log_path=$GITHUB_WORKSPACE/build/log/ubsan
|
||||
EOF
|
||||
;;
|
||||
tsan)
|
||||
cat <<EOF >> "$GITHUB_ENV"
|
||||
TSAN_OPTIONS=log_path=$GITHUB_WORKSPACE/build/log/tsan
|
||||
CLANG_SANITIZER=TSAN
|
||||
EOF
|
||||
;;
|
||||
lint)
|
||||
# Re-enable once system deps are available
|
||||
# BUILD_FLAGS="$BUILD_FLAGS -DLIBLUV_LIBRARY:FILEPATH=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/lua/5.1/luv.so -DLIBLUV_INCLUDE_DIR:PATH=/usr/include/lua5.1"
|
||||
DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUV=ON"
|
||||
cat <<EOF >> "$GITHUB_ENV"
|
||||
USE_BUNDLED=OFF
|
||||
CI_TARGET=lint
|
||||
EOF
|
||||
;;
|
||||
functionaltest-lua)
|
||||
BUILD_FLAGS="$BUILD_FLAGS -DPREFER_LUA=ON"
|
||||
FUNCTIONALTEST=functionaltest-lua
|
||||
DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
cat <<EOF >> "$GITHUB_ENV"
|
||||
$BUILD_FLAGS
|
||||
DEPS_CMAKE_FLAGS=$DEPS_CMAKE_FLAGS
|
||||
FUNCTIONALTEST=$FUNCTIONALTEST
|
||||
EOF
|
49
.github/workflows/labeler.yml
vendored
49
.github/workflows/labeler.yml
vendored
@ -1,49 +0,0 @@
|
||||
name: "Pull Request Labeler"
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened]
|
||||
jobs:
|
||||
|
||||
triage:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/labeler@main
|
||||
with:
|
||||
repo-token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
sync-labels: ""
|
||||
|
||||
type-scope:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_REPO: ${{ github.repository }}
|
||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||
steps:
|
||||
- name: "Extract commit type and add as label"
|
||||
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|([[:alpha:]]+)(\(.*\))?!?:.*|\1|')" || true
|
||||
- name: "Extract commit scope and add as label"
|
||||
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+\((.+)\)!?:.*|\1|')" || true
|
||||
- name: "Extract if the PR is a breaking change and add it as label"
|
||||
run: gh pr edit "$PR_NUMBER" --add-label "$(echo "$PR_TITLE" | sed -E 's|[[:alpha:]]+(\(.*\))?!:.*|breaking-change|')" || true
|
||||
|
||||
request-reviewer:
|
||||
if: github.event.pull_request.state == 'open' && github.event.pull_request.draft == false
|
||||
runs-on: ubuntu-latest
|
||||
needs: ["triage", "type-scope"]
|
||||
permissions:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: 'Request reviewers'
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const script = require('./.github/scripts/reviews.js')
|
||||
await script({github, context})
|
64
.github/workflows/notes.md
vendored
64
.github/workflows/notes.md
vendored
@ -1,64 +0,0 @@
|
||||
```
|
||||
${NVIM_VERSION}
|
||||
```
|
||||
|
||||
## Install
|
||||
|
||||
### Windows
|
||||
|
||||
#### Zip
|
||||
|
||||
1. Download **nvim-win64.zip**
|
||||
2. Extract the zip.
|
||||
3. Run `nvim-qt.exe`
|
||||
|
||||
#### MSI
|
||||
|
||||
1. Download **nvim-win64.msi**
|
||||
2. Run the MSI
|
||||
3. Search and run `nvim-qt.exe` or run `nvim.exe` on your CLI of choice.
|
||||
|
||||
### macOS
|
||||
|
||||
1. Download **nvim-macos.tar.gz**
|
||||
2. Extract: `tar xzvf nvim-macos.tar.gz`
|
||||
3. Run `./nvim-macos/bin/nvim`
|
||||
|
||||
### Linux (x64)
|
||||
|
||||
#### Tarball
|
||||
|
||||
1. Download **nvim-linux64.tar.gz**
|
||||
2. Extract: `tar xzvf nvim-linux64.tar.gz`
|
||||
3. Run `./nvim-linux64/bin/nvim`
|
||||
|
||||
#### Debian Package
|
||||
|
||||
1. Download **nvim-linux64.deb**
|
||||
2. Install the package using `sudo apt install ./nvim-linux64.deb`
|
||||
3. Run `nvim`
|
||||
|
||||
#### AppImage
|
||||
1. Download **nvim.appimage**
|
||||
2. Run `chmod u+x nvim.appimage && ./nvim.appimage`
|
||||
- If your system does not have FUSE you can [extract the appimage](https://github.com/AppImage/AppImageKit/wiki/FUSE#type-2-appimage):
|
||||
```
|
||||
./nvim.appimage --appimage-extract
|
||||
./squashfs-root/usr/bin/nvim
|
||||
```
|
||||
|
||||
### Other
|
||||
|
||||
- Install by [package manager](https://github.com/neovim/neovim/wiki/Installing-Neovim)
|
||||
|
||||
## SHA256 Checksums
|
||||
|
||||
```
|
||||
${SHA_LINUX_64_TAR}
|
||||
${SHA_LINUX_64_DEB}
|
||||
${SHA_APP_IMAGE}
|
||||
${SHA_APP_IMAGE_ZSYNC}
|
||||
${SHA_MACOS}
|
||||
${SHA_WIN_64_ZIP}
|
||||
${SHA_WIN_64_MSI}
|
||||
```
|
243
.github/workflows/release.yml
vendored
243
.github/workflows/release.yml
vendored
@ -1,243 +0,0 @@
|
||||
name: Release
|
||||
on:
|
||||
schedule:
|
||||
- cron: '5 5 * * *'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag_name:
|
||||
description: 'Tag name for release'
|
||||
required: false
|
||||
default: nightly
|
||||
push:
|
||||
tags:
|
||||
- v[0-9]+.[0-9]+.[0-9]+
|
||||
|
||||
# Build on the oldest supported images, so we have broader compatibility
|
||||
# Upgrade to gcc-11 to prevent it from using its builtins (#14150)
|
||||
jobs:
|
||||
linux:
|
||||
runs-on: ubuntu-18.04
|
||||
outputs:
|
||||
version: ${{ steps.build.outputs.version }}
|
||||
release: ${{ steps.build.outputs.release }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y autoconf automake build-essential cmake gcc-11 gettext gperf libtool-bin locales ninja-build pkg-config unzip
|
||||
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
|
||||
run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV
|
||||
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
|
||||
run: printf 'NVIM_BUILD_TYPE=RelWithDebInfo\n' >> $GITHUB_ENV
|
||||
- name: Build release
|
||||
id: build
|
||||
run: |
|
||||
CC=gcc-11 make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH="
|
||||
printf '::set-output name=version::%s\n' "$(./build/bin/nvim --version | head -n 3 | sed -z 's/\n/%0A/g')"
|
||||
printf '::set-output name=release::%s\n' "$(./build/bin/nvim --version | head -n 1)"
|
||||
make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-linux64" install
|
||||
cd "$GITHUB_WORKSPACE/build/"
|
||||
cpack -C $NVIM_BUILD_TYPE
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: nvim-linux64
|
||||
path: build/nvim-linux64.tar.gz
|
||||
retention-days: 1
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: nvim-linux64
|
||||
path: build/nvim-linux64.deb
|
||||
retention-days: 1
|
||||
|
||||
appimage:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y autoconf automake build-essential cmake gcc-11 gettext gperf libtool-bin locales ninja-build pkg-config unzip
|
||||
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
|
||||
run: CC=gcc-11 make appimage-latest
|
||||
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
|
||||
run: CC=gcc-11 make appimage-nightly
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: appimage
|
||||
path: build/bin/nvim.appimage
|
||||
retention-days: 1
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: appimage
|
||||
path: build/bin/nvim.appimage.zsync
|
||||
retention-days: 1
|
||||
|
||||
macOS:
|
||||
runs-on: macos-11
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install brew packages
|
||||
run: |
|
||||
brew update --quiet
|
||||
brew install automake ninja
|
||||
- if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name != 'nightly')
|
||||
run: printf 'NVIM_BUILD_TYPE=Release\n' >> $GITHUB_ENV
|
||||
- if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name == 'nightly')
|
||||
run: printf 'NVIM_BUILD_TYPE=RelWithDebInfo\n' >> $GITHUB_ENV
|
||||
- name: Provision universal `libintl`
|
||||
run: |
|
||||
GETTEXT_PREFIX="$(brew --prefix gettext)"
|
||||
printf 'GETTEXT_PREFIX=%s\n' "$GETTEXT_PREFIX" >> $GITHUB_ENV
|
||||
bottle_tag="arm64_big_sur"
|
||||
brew fetch --bottle-tag="$bottle_tag" gettext
|
||||
cd "$(mktemp -d)"
|
||||
tar xf "$(brew --cache)"/**/*gettext*${bottle_tag}*.tar.gz
|
||||
lipo gettext/*/lib/libintl.a "${GETTEXT_PREFIX}/lib/libintl.a" -create -output libintl.a
|
||||
mv -f libintl.a /usr/local/lib/
|
||||
- name: Ensure static linkage to `libintl`
|
||||
run: |
|
||||
# We're about to mangle `gettext`, so let's remove any potentially broken
|
||||
# installs (e.g. curl, git) as those could interfere with our build.
|
||||
brew uninstall $(brew uses --installed --recursive gettext)
|
||||
brew unlink gettext
|
||||
ln -sf "$(brew --prefix)/opt/$(readlink "${GETTEXT_PREFIX}")/bin"/* /usr/local/bin/
|
||||
rm -f "$GETTEXT_PREFIX"
|
||||
- name: Build release
|
||||
run: |
|
||||
export MACOSX_DEPLOYMENT_TARGET="$(sw_vers -productVersion | cut -f1 -d.)"
|
||||
OSX_FLAGS="-DCMAKE_OSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} -DCMAKE_OSX_ARCHITECTURES=arm64\;x86_64"
|
||||
make CMAKE_BUILD_TYPE=${NVIM_BUILD_TYPE} \
|
||||
CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH= $OSX_FLAGS" \
|
||||
DEPS_CMAKE_FLAGS="$OSX_FLAGS -DUSE_BUNDLED_GPERF=OFF"
|
||||
make DESTDIR="$GITHUB_WORKSPACE/build/release/nvim-macos" install
|
||||
- name: Create package
|
||||
run: |
|
||||
cd "$GITHUB_WORKSPACE/build/release"
|
||||
tar cfz nvim-macos.tar.gz nvim-macos
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: nvim-macos
|
||||
path: build/release/nvim-macos.tar.gz
|
||||
retention-days: 1
|
||||
|
||||
windows:
|
||||
runs-on: windows-2019
|
||||
env:
|
||||
DEPS_BUILD_DIR: ${{ format('{0}/nvim-deps', github.workspace) }}
|
||||
DEPS_PREFIX: ${{ format('{0}/nvim-deps/usr', github.workspace) }}
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- config: MSVC_64
|
||||
archive: nvim-win64
|
||||
name: windows (${{ matrix.config }})
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- run: powershell ci\build.ps1 -NoTests
|
||||
env:
|
||||
CONFIGURATION: ${{ matrix.config }}
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: ${{ matrix.archive }}
|
||||
path: build/${{ matrix.archive }}.zip
|
||||
retention-days: 1
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: ${{ matrix.archive }}
|
||||
path: build/${{ matrix.archive }}.msi
|
||||
retention-days: 1
|
||||
|
||||
publish:
|
||||
needs: [linux, appimage, macOS, windows]
|
||||
runs-on: ubuntu-20.04
|
||||
env:
|
||||
GH_REPO: ${{ github.repository }}
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
# Must perform checkout first, since it deletes the target directory
|
||||
# before running, and would therefore delete the downloaded artifacts
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/download-artifact@v2
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y gettext-base
|
||||
|
||||
- if: github.event_name == 'workflow_dispatch'
|
||||
run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
|
||||
- if: github.event_name == 'schedule'
|
||||
run: echo 'TAG_NAME=nightly' >> $GITHUB_ENV
|
||||
- if: github.event_name == 'push'
|
||||
run: |
|
||||
TAG_NAME=${{ github.ref }}
|
||||
echo "TAG_NAME=${TAG_NAME#refs/tags/}" >> $GITHUB_ENV
|
||||
- if: env.TAG_NAME == 'nightly'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
(echo 'SUBJECT=Nvim development (prerelease) build';
|
||||
echo 'PRERELEASE=--prerelease') >> $GITHUB_ENV
|
||||
gh release delete nightly --yes || true
|
||||
git push origin :nightly || true
|
||||
- if: env.TAG_NAME != 'nightly'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
(echo 'SUBJECT=Nvim release build';
|
||||
echo 'PRERELEASE=') >> $GITHUB_ENV
|
||||
gh release delete stable --yes || true
|
||||
git push origin :stable || true
|
||||
# `sha256sum` outputs <sha> <path>, so we cd into each dir to drop the
|
||||
# containing folder from the output.
|
||||
- name: Generate Linux64 SHA256 checksums
|
||||
run: |
|
||||
cd ./nvim-linux64
|
||||
sha256sum nvim-linux64.tar.gz > nvim-linux64.tar.gz.sha256sum
|
||||
echo "SHA_LINUX_64_TAR=$(cat nvim-linux64.tar.gz.sha256sum)" >> $GITHUB_ENV
|
||||
sha256sum nvim-linux64.deb > nvim-linux64.deb.sha256sum
|
||||
echo "SHA_LINUX_64_DEB=$(cat nvim-linux64.deb.sha256sum)" >> $GITHUB_ENV
|
||||
- name: Generate App Image SHA256 checksums
|
||||
run: |
|
||||
cd ./appimage
|
||||
sha256sum nvim.appimage > nvim.appimage.sha256sum
|
||||
echo "SHA_APP_IMAGE=$(cat nvim.appimage.sha256sum)" >> $GITHUB_ENV
|
||||
- name: Generate App Image Zsync SHA256 checksums
|
||||
run: |
|
||||
cd ./appimage
|
||||
sha256sum nvim.appimage.zsync > nvim.appimage.zsync.sha256sum
|
||||
echo "SHA_APP_IMAGE_ZSYNC=$(cat nvim.appimage.zsync.sha256sum)" >> $GITHUB_ENV
|
||||
- name: Generate macOS SHA256 checksums
|
||||
run: |
|
||||
cd ./nvim-macos
|
||||
sha256sum nvim-macos.tar.gz > nvim-macos.tar.gz.sha256sum
|
||||
echo "SHA_MACOS=$(cat nvim-macos.tar.gz.sha256sum)" >> $GITHUB_ENV
|
||||
- name: Generate Win64 SHA256 checksums
|
||||
run: |
|
||||
cd ./nvim-win64
|
||||
sha256sum nvim-win64.zip > nvim-win64.zip.sha256sum
|
||||
echo "SHA_WIN_64_ZIP=$(cat nvim-win64.zip.sha256sum)" >> $GITHUB_ENV
|
||||
sha256sum nvim-win64.msi > nvim-win64.msi.sha256sum
|
||||
echo "SHA_WIN_64_MSI=$(cat nvim-win64.msi.sha256sum)" >> $GITHUB_ENV
|
||||
- name: Publish release
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NVIM_VERSION: ${{ needs.linux.outputs.version }}
|
||||
DEBUG: api
|
||||
run: |
|
||||
envsubst < "$GITHUB_WORKSPACE/.github/workflows/notes.md" > "$RUNNER_TEMP/notes.md"
|
||||
gh release create $TAG_NAME $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos/* nvim-linux64/* appimage/* nvim-win64/*
|
||||
if [ "$TAG_NAME" != "nightly" ]; then
|
||||
gh release create stable $PRERELEASE --notes-file "$RUNNER_TEMP/notes.md" --title "$SUBJECT" --target $GITHUB_SHA nvim-macos/* nvim-linux64/* appimage/* nvim-win64/*
|
||||
fi
|
17
.github/workflows/remove-reviewers-on-draft.yml
vendored
17
.github/workflows/remove-reviewers-on-draft.yml
vendored
@ -1,17 +0,0 @@
|
||||
name: "Remove reviewers"
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [converted_to_draft, closed]
|
||||
jobs:
|
||||
remove-reviewers:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: 'Remove reviewers'
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const script = require('./.github/scripts/remove-reviewers.js')
|
||||
await script({github, context})
|
18
.github/workflows/reviews.yml
vendored
18
.github/workflows/reviews.yml
vendored
@ -1,18 +0,0 @@
|
||||
name: "Request reviews"
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [labeled, ready_for_review]
|
||||
jobs:
|
||||
request-reviewer:
|
||||
if: github.event.pull_request.state == 'open' && github.event.pull_request.draft == false
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: 'Request reviewers'
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const script = require('./.github/scripts/reviews.js')
|
||||
await script({github, context})
|
52
.github/workflows/vim-patches.yml
vendored
52
.github/workflows/vim-patches.yml
vendored
@ -1,52 +0,0 @@
|
||||
name: vim-patches
|
||||
on:
|
||||
schedule:
|
||||
- cron: '3 3 * * *'
|
||||
|
||||
jobs:
|
||||
update-vim-patches:
|
||||
runs-on: ubuntu-20.04
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
env:
|
||||
VIM_SOURCE_DIR: ${{ format('{0}/vim-src', github.workspace) }}
|
||||
VERSION_BRANCH: marvim/ci-version-update
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
repository: vim/vim
|
||||
path: ${{ env.VIM_SOURCE_DIR }}
|
||||
fetch-depth: 0
|
||||
|
||||
- run: |
|
||||
gh release download -R neovim/neovim -p nvim.appimage
|
||||
chmod a+x nvim.appimage
|
||||
mkdir -p $HOME/.local/bin
|
||||
mv nvim.appimage $HOME/.local/bin/nvim
|
||||
printf '%s\n' "$HOME/.local/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Setup git config
|
||||
run: |
|
||||
git config --global user.name 'marvim'
|
||||
git config --global user.email 'marvim@users.noreply.github.com'
|
||||
|
||||
- name: Update src/version.c
|
||||
id: update-version
|
||||
run: |
|
||||
git checkout -b ${VERSION_BRANCH}
|
||||
nvim -i NONE -u NONE --headless +'luafile scripts/vimpatch.lua' +q
|
||||
printf '::set-output name=NEW_PATCHES::%s\n' $([ -z "$(git diff)" ]; echo $?)
|
||||
|
||||
- name: Automatic PR
|
||||
if: ${{ steps.update-version.outputs.NEW_PATCHES != 0 }}
|
||||
run: |
|
||||
git add -u
|
||||
git commit -m 'version.c: update [skip ci]'
|
||||
git push --force https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} ${VERSION_BRANCH}
|
||||
gh pr create --draft --fill --label vim-patch --base ${GITHUB_REF#refs/heads/} --head ${VERSION_BRANCH} || true
|
34
.gitignore
vendored
34
.gitignore
vendored
@ -1,23 +1,16 @@
|
||||
# Tools
|
||||
/venv/
|
||||
.ropeproject/
|
||||
compile_commands.json
|
||||
/.luarc.json
|
||||
|
||||
# IDEs
|
||||
# Visual Studio
|
||||
/.vs/
|
||||
/.vscode/
|
||||
/.idea/
|
||||
|
||||
# Build/deps dir
|
||||
/build/
|
||||
/cmake-build-debug/
|
||||
/dist/
|
||||
/.deps/
|
||||
/tmp/
|
||||
/.clangd/
|
||||
/.cache/clangd/
|
||||
/.ccls-cache/
|
||||
/.clang-tidy
|
||||
|
||||
.DS_Store
|
||||
*.mo
|
||||
.*.sw?
|
||||
*~
|
||||
@ -25,6 +18,8 @@ compile_commands.json
|
||||
*.o
|
||||
*.so
|
||||
|
||||
tags
|
||||
|
||||
/src/nvim/po/vim.pot
|
||||
/src/nvim/po/*.ck
|
||||
|
||||
@ -32,14 +27,13 @@ compile_commands.json
|
||||
/.nvimlog
|
||||
|
||||
# Generated by scripts/vim-patch.sh
|
||||
/.vim-src
|
||||
*.rej
|
||||
/.vim-src/
|
||||
|
||||
# Generated by old (Vim) tests.
|
||||
/src/nvim/testdir/del
|
||||
/src/nvim/testdir/test*.out
|
||||
/src/nvim/testdir/test*.res
|
||||
/src/nvim/testdir/test*.log
|
||||
/src/nvim/testdir/test.log
|
||||
/src/nvim/testdir/messages
|
||||
/src/nvim/testdir/viminfo
|
||||
/src/nvim/testdir/test.ok
|
||||
@ -48,7 +42,6 @@ compile_commands.json
|
||||
/src/nvim/testdir/valgrind.*
|
||||
/src/nvim/testdir/.gdbinit
|
||||
/runtime/indent/testdir/*.out
|
||||
+runtime/indent/testdir/*.fail
|
||||
# Generated by src/nvim/testdir/runnvim.sh.
|
||||
/src/nvim/testdir/*.tlog
|
||||
|
||||
@ -61,15 +54,10 @@ compile_commands.json
|
||||
# local make targets
|
||||
local.mk
|
||||
|
||||
# Generated from :help docs
|
||||
tags
|
||||
# runtime/doc
|
||||
/runtime/doc/*.html
|
||||
/runtime/doc/tags.ref
|
||||
/runtime/doc/errors.log
|
||||
|
||||
# Generated by gen_vimdoc.py:
|
||||
/runtime/doc/*.mpack
|
||||
/tmp-*-doc
|
||||
|
||||
# vim patches
|
||||
/vim-*.patch
|
||||
# CLion
|
||||
/.idea/
|
||||
|
15
.luacheckrc
15
.luacheckrc
@ -1,14 +1,7 @@
|
||||
-- vim: ft=lua tw=80
|
||||
|
||||
stds.nvim = {
|
||||
read_globals = { "jit" }
|
||||
}
|
||||
std = "lua51+nvim"
|
||||
|
||||
-- Ignore W211 (unused variable) with preload files.
|
||||
files["**/preload.lua"] = {ignore = { "211" }}
|
||||
-- Allow vim module to modify itself, but only here.
|
||||
files["src/nvim/lua/vim.lua"] = {ignore = { "122/vim" }}
|
||||
|
||||
-- Don't report unused self arguments of methods.
|
||||
self = false
|
||||
@ -25,11 +18,3 @@ ignore = {
|
||||
read_globals = {
|
||||
"vim",
|
||||
}
|
||||
|
||||
globals = {
|
||||
"vim.g",
|
||||
}
|
||||
|
||||
exclude_files = {
|
||||
'test/functional/fixtures/lua/syntax_error.lua',
|
||||
}
|
||||
|
22
.luacov
22
.luacov
@ -1,22 +0,0 @@
|
||||
-- Configuration file for LuaCov
|
||||
|
||||
local source = require("lfs").currentdir()
|
||||
|
||||
local function pesc(s)
|
||||
assert(type(s) == 'string', s)
|
||||
return s:gsub('[%(%)%.%%%+%-%*%?%[%]%^%$]', '%%%1')
|
||||
end
|
||||
|
||||
return {
|
||||
include = {
|
||||
-- Absolute paths (starting with source dir, not hidden (i.e. .deps)).
|
||||
pesc(source) .. "[/\\][^.].+",
|
||||
-- Relative (non-hidden) paths.
|
||||
'^[^/\\.]',
|
||||
},
|
||||
modules = {
|
||||
['vim'] = 'runtime/lua/vim/shared.lua'
|
||||
},
|
||||
}
|
||||
|
||||
-- vim: ft=lua tw=80 sw=2 et
|
134
.mailmap
134
.mailmap
@ -1,134 +0,0 @@
|
||||
Abdelhakeem <abdelhakeem.osama@hotmail.com> Abdelhakeem Osama
|
||||
Alvaro Muñoz <alvaro@pwntester.com> Alvaro Muñoz
|
||||
Andreas Johansson <andreas@ndrs.xyz> <ndreas@users.noreply.github.com>
|
||||
Andrew Pyatkov <mrbiggfoot@gmail.com> <mrbiggfoot@users.noreply.github.com>
|
||||
Anmol Sethi <hi@nhooyr.io> <anmol@aubble.com>
|
||||
Anmol Sethi <hi@nhooyr.io> <me@anmol.io>
|
||||
Anmol Sethi <hi@nhooyr.io> <nhooyr@users.noreply.github.com>
|
||||
BK1603 <chouhan.shreyansh2702@gmail.com> Shreyansh Chouhan
|
||||
Billy Su <g4691821@gmail.com> Billy SU
|
||||
Billy Vong <billyvg@gmail.com> <billyvg@users.noreply.github.com>
|
||||
Björn Linse <bjorn.linse@gmail.com> bfredl
|
||||
Carlos Hernandez <carlos@techbyte.ca> <hurricanehrndz@users.noreply.github.com>
|
||||
Chris Kipp <ckipp@pm.me> ckipp01
|
||||
Christian Clason <c.clason@uni-graz.at> <christian.clason@uni-due.de>
|
||||
Cédric Barreteau <> <cbarrete@users.noreply.github.com>
|
||||
Dan Aloni <alonid@gmail.com> <dan@kernelim.com>
|
||||
Daniel Hahler <git@thequod.de> <github@thequod.de>
|
||||
Eisuke Kawashima <e-kwsm@users.noreply.github.com> E Kawashima
|
||||
ElPiloto <luis.r.piloto@gmail.com> Luis Piloto
|
||||
Eliseo Martínez <eliseomarmol@gmail.com> Eliseo Martínez
|
||||
Fabian Viöl <f.vioel@googlemail.com> Fabian
|
||||
Florian Walch <florian@fwalch.com> <fwalch@users.noreply.github.com>
|
||||
Gabriel Cruz <gabs.oficial98@gmail.com> <LTKills@users.noreply.github.com>
|
||||
Gaelan Steele <gbs@canishe.com> Gaelan
|
||||
Gavin D. Howard <gavin@schedmd.com> <yzena.tech@gmail.com>
|
||||
George Zhao <zhaozg@gmail.com> <zhaozg@aliyun.com>
|
||||
George Zhao <zhaozg@gmail.com> George Zhao
|
||||
Gregory Anders <greg@gpanders.com> <8965202+gpanders@users.noreply.github.com>
|
||||
Gregory Anders <greg@gpanders.com> Greg Anders
|
||||
Grzegorz Milka <grzegorzmilka@gmail.com> Grzegorz
|
||||
Harm te Hennepe <dhtehennepe@gmail.com> <d.h.tehennepe@student.utwente.nl>
|
||||
Harm te Hennepe <dhtehennepe@gmail.com> <harm@tehennepe.org>
|
||||
Hirokazu Hata <h.hata.ai.t@gmail.com> <h-michael@users.noreply.github.com>
|
||||
Ihor Antonov <ngortheone@gmail.com> <ngortheone@users.noreply.github.com>
|
||||
J Phani Mahesh <phanimahesh@gmail.com> <github@phanimahesh.me>
|
||||
Jack Bracewell <FriedSock@users.noreply.github.com> <jack.bracewell@unboxedconsulting.com>
|
||||
Jack Bracewell <FriedSock@users.noreply.github.com> <jbtwentythree@gmail.com>
|
||||
Jacques Germishuys <jacquesg@striata.com> <jacquesg@users.noreply.github.com>
|
||||
Jakub Łuczyński <doubleloop@o2.pl> <doubleloop@users.noreply.github.com>
|
||||
James McCoy <jamessan@jamessan.com> <vega.james@gmail.com>
|
||||
Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> <janedmundlazo@hotmail.com>
|
||||
Jan Viljanen <jan.a.viljanen@gmail.com> <jan.viljanen@greenpeace.org>
|
||||
Javier Lopez <graulopezjavier@gmail.com> Javier López
|
||||
Jit Yao Yap <jityao@gmail.com> <jityao+github@gmail.com>
|
||||
Jit Yao Yap <jityao@gmail.com> Jit
|
||||
John Gehrig <jdg.gehrig@gmail.com> <jgehrig@users.noreply.github.com>
|
||||
John Schmidt <john.schmidt.h@gmail.com> John
|
||||
John Szakmeister <john@szakmeister.net> <jszakmeister@users.noreply.github.com>
|
||||
Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.com> <jdebp@users.noreply.github.com>
|
||||
Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.com> <postmaster@localhost>
|
||||
Jurica Bradaric <jbradaric@gmail.com> <jbradaric@users.noreply.github.com>
|
||||
Jurica Bradaric <jbradaric@gmail.com> <jurica.bradaric@avl.com>
|
||||
KillTheMule <KillTheMule@users.noreply.github.com> <github@pipsfrank.de>
|
||||
Kwon-Young Choi <kwon-young.choi@hotmail.fr> Kwon-Young
|
||||
Lucas Hoffmann <l-m-h@web.de> <lucc@posteo.de>
|
||||
Lucas Hoffmann <l-m-h@web.de> <lucc@users.noreply.github.com>
|
||||
Marco Hinz <mh.codebro@gmail.com> <mh.codebro+github@gmail.com>
|
||||
Marvim the Paranoid Android <marvim@users.noreply.github.com> marvim
|
||||
Mateusz Czapliński <czapkofan@gmail.com> Mateusz Czaplinski
|
||||
Mathias Fussenegger <f.mathias@zignar.net> <mfussenegger@users.noreply.github.com>
|
||||
Mathias Fussenegger <f.mathias@zignar.net> Mathias Fußenegger
|
||||
Matt Wozniski <godlygeek@gmail.com> <godlygeek+git@gmail.com>
|
||||
Matthieu Coudron <mattator@gmail.com> <coudron@iij.ad.jp>
|
||||
Matthieu Coudron <mattator@gmail.com> <matthieu.coudron@upmc.fr>
|
||||
Matthieu Coudron <mattator@gmail.com> <mcoudron@hotmail.com>
|
||||
Matthieu Coudron <mattator@gmail.com> <teto@users.noreply.github.com>
|
||||
MichaHoffmann <michoffmann.potsdam@gmail.com> Michael Hoffmann
|
||||
MichaHoffmann <michoffmann.potsdam@gmail.com> micha
|
||||
Michael Ennen <mike.ennen@gmail.com> <brcolow@users.noreply.github.com>
|
||||
Michael Ennen <mike.ennen@gmail.com> brcolow
|
||||
Michael Reed <m.reed@mykolab.com> <Pyrohh@users.noreply.github.com>
|
||||
Michael Schupikov <michael@schupikov.de> <DarkDeepBlue@users.noreply.github.com>
|
||||
Nicolas Hillegeer <nicolas@hillegeer.com> <nicolashillegeer@gmail.com>
|
||||
Panashe M. Fundira <fundirap@gmail.com> Panashe Fundira
|
||||
Patrice Peterson <patrice.peterson@mailbox.org> runiq
|
||||
Pavel Platto <hinidu@gmail.com> Hinidu
|
||||
Petter Wahlman <petter@wahlman.no> <pwahlman@cisco.com>
|
||||
Poh Zi How <poh.zihow@gmail.com> pohzipohzi
|
||||
Rich Wareham <rjw57@cam.ac.uk> <rjw57@cantab.net>
|
||||
Rui Abreu Ferreira <equalsraf@users.noreply.github.com> @equalsraf
|
||||
Rui Abreu Ferreira <raf-ep@gmx.com> <equalsraf@users.noreply.github.com>
|
||||
Rui Abreu Ferreira <raf-ep@gmx.com> <rap-ep@gmx.com>
|
||||
Sam Wilson <tecywiz121@hotmail.com> <sawilson@akamai.com>
|
||||
Sander Bosma <sanderbosma@gmail.com> sander2
|
||||
Santos Gallegos <stsewd@protonmail.com> <santos_g@outlook.com>
|
||||
Sebastian Parborg <darkdefende@gmail.com> DarkDefender
|
||||
Shirasaka <tk.shirasaka@gmail.com> tk-shirasaka
|
||||
Shota <shotat@users.noreply.github.com> shotat
|
||||
Shougo Matsushita <Shougo.Matsu@gmail.com> Shougo
|
||||
Stephan Seitz <stephan.seitz@fau.de> <stephan.lauf@yahoo.de>
|
||||
Steven Sojka <Steven.Sojka@tdameritrade.com> <steelsojka@gmail.com>
|
||||
Steven Sojka <steelsojka@gmail.com> <steelsojka@users.noreply.github.com>
|
||||
TJ DeVries <devries.timothyj@gmail.com> <timothydvrs1234@gmail.com>
|
||||
Thomas Fehér <thomas.feher@yahoo.de> <thomasfeher@web.de>
|
||||
Thomas Vigouroux <tomvig38@gmail.com> <39092278+vigoux@users.noreply.github.com>
|
||||
Utkarsh Maheshwari <UtkarshME96@gmail.com> UTkarsh Maheshwari
|
||||
Utkarsh Maheshwari <utkarshme96@gmail.com> <UtkarshME96@gmail.com>
|
||||
VVKot <volodymyr.kot.ua@gmail.com> Volodymyr Kot
|
||||
Victor Adam <victor.adam@cofelyineo-gdfsuez.com> <Victor.Adam@derpymail.org>
|
||||
Wang Shidong <wsdjeg@outlook.com> <wsdjeg@users.noreply.github.com>
|
||||
Wei Huang <daviseago@gmail.com> davix
|
||||
Xu Cheng <xucheng@me.com> <xu-cheng@users.noreply.github.com>
|
||||
Yamakaky <yamakaky@gmail.com> <yamakaky@yamaworld.fr>
|
||||
Yegappan Lakshmanan <yegappan@yahoo.com> <4298407+yegappan@users.noreply.github.com>
|
||||
Yichao Zhou <broken.zhoug@gmail.com> Yichao Zhou <broken.zhou@gmail.com>
|
||||
Yichao Zhou <broken.zhoug@gmail.com> zhou13 <broken.zhou@gmail.com>
|
||||
Yorick Peterse <git@yorickpeterse.com> <yorick@yorickpeterse.com>
|
||||
ZyX <kp-pav@yandex.ru> <kp-pav@ya.ru>
|
||||
ZyX <kp-pav@yandex.ru> Nikolai Aleksandrovich Pavlov
|
||||
aph <a.hewson@gmail.com> Ashley Hewson
|
||||
butwerenotthereyet <58348703+butwerenotthereyet@users.noreply.github.com> We're Yet
|
||||
chemzqm <chemzqm@gmail.com> Qiming zhao
|
||||
chentau <tchen1998@gmail.com> Tony Chen
|
||||
dedmass <carlo.abelli@gmail.com> Carlo Abelli
|
||||
equal-l2 <eng.equall2@gmail.com> <equal-l2@users.noreply.github.com>
|
||||
francisco souza <fsouza@users.noreply.github.com> <108725+fsouza@users.noreply.github.com>
|
||||
glacambre <code@lacamb.re> <me@r4>
|
||||
glacambre <code@lacamb.re> Ghjuvan Lacambre
|
||||
ii14 <ii14@users.noreply.github.com> <59243201+ii14@users.noreply.github.com>
|
||||
jdrouhard <john@jmdtech.org> <github@jmdtech.org>
|
||||
kuuote <znmxodq1@gmail.com> <36663503+kuuote@users.noreply.github.com>
|
||||
matveyt <matthewtarasov@gmail.com> <35012635+matveyt@users.noreply.github.com>
|
||||
nate <nateozemon@gmail.com> nateozem
|
||||
ray-x <rayx.cn@gmail.com> rayx
|
||||
relnod <mail@paul-schiffers.de> <relnod@users.noreply.github.com>
|
||||
rockerBOO <rockerboo@gmail.com> Dave Lage
|
||||
rpigott <rpigott@berkeley.edu> Ronan Pigott
|
||||
sach1t <sach0010t@gmail.com> <sach1t@users.noreply.github.com>
|
||||
shade-of-noon <73705427+shade-of-noon@users.noreply.github.com> Edwin Pujols
|
||||
shadmansaleh <shadmansaleh3@gmail.com> <13149513+shadmansaleh@users.noreply.github.com>
|
||||
shadmansaleh <shadmansaleh3@gmail.com> Shadman
|
||||
sohnryang <loop.infinitely@gmail.com> 손량
|
||||
timeyyy <timeyyy_da_man@hotmail.com> Timothy C Eichler
|
||||
timeyyy <timeyyy_da_man@hotmail.com> timothy eichler
|
123
.travis.yml
123
.travis.yml
@ -1,23 +1,9 @@
|
||||
dist: bionic
|
||||
dist: xenial
|
||||
|
||||
language: c
|
||||
|
||||
env:
|
||||
global:
|
||||
# Encrypted environment variables, see
|
||||
# http://docs.travis-ci.com/user/encryption-keys/
|
||||
#
|
||||
# SNAP_SECRET_KEY: generated by:
|
||||
# travis encrypt SNAP_SECRET_KEY=xx --add
|
||||
# https://github.com/neovim/neovim/pull/11428
|
||||
# snapcraft key expires after 1 year. Steps to refresh it:
|
||||
# 1. snapcraft enable-ci travis --refresh
|
||||
# 2. mv .snapcraft/travis_snapcraft.cfg ci/snap/travis_snapcraft.cfg
|
||||
# 3. Copy after_success command to ci/snap/deploy.sh from .travis.yml
|
||||
# 4. Undo changes to .travis.yml
|
||||
- secure: hd0qn2u8ABbJg5Bx4pBRcUQbKYFmcSHoecyHIPTCnGJT+NI41Bvm/IkN/N5DhBF+LbD3Q2nmR/dzI5H/dqS7RxMFvEx1DuFLendFHHX3MYf0AuKpXYY3gwgMTmqx8p/v6srlU7RBGWNGzHCWqksAem+EIWCe3I7WvfdKo1/DV/Y=
|
||||
|
||||
- PATH="$HOME/.local/bin:$PATH"
|
||||
# Set "false" to force rebuild of third-party dependencies.
|
||||
- CACHE_ENABLE=true
|
||||
# Build directory for Neovim.
|
||||
@ -31,13 +17,17 @@ env:
|
||||
# Nvim log file.
|
||||
- NVIM_LOG_FILE="$BUILD_DIR/.nvimlog"
|
||||
# Default CMake flags.
|
||||
- CMAKE_FLAGS="-DCI_BUILD=ON
|
||||
- CMAKE_FLAGS="-DTRAVIS_CI_BUILD=ON
|
||||
-DCMAKE_BUILD_TYPE=Debug
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX
|
||||
-DBUSTED_OUTPUT_TYPE=nvim
|
||||
-DDEPS_PREFIX=$DEPS_BUILD_DIR/usr
|
||||
-DMIN_LOG_LEVEL=3"
|
||||
- DEPS_CMAKE_FLAGS="-DUSE_BUNDLED_GPERF=OFF"
|
||||
# Additional CMake flags for 32-bit builds.
|
||||
- CMAKE_FLAGS_32BIT="-DCMAKE_SYSTEM_LIBRARY_PATH=/lib32:/usr/lib32:/usr/local/lib32
|
||||
-DCMAKE_IGNORE_PATH=/lib:/usr/lib:/usr/local/lib
|
||||
-DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake"
|
||||
# Environment variables for Clang sanitizers.
|
||||
- ASAN_OPTIONS="detect_leaks=1:check_initialization_order=1:log_path=$LOG_DIR/asan"
|
||||
- TSAN_OPTIONS="log_path=$LOG_DIR/tsan"
|
||||
@ -46,7 +36,7 @@ env:
|
||||
- VALGRIND_LOG="$LOG_DIR/valgrind-%p.log"
|
||||
- CACHE_NVIM_DEPS_DIR="$HOME/.cache/nvim-deps"
|
||||
# If this file exists, the cache is valid (compile was successful).
|
||||
- CACHE_MARKER="$CACHE_NVIM_DEPS_DIR/.ci_cache_marker"
|
||||
- CACHE_MARKER="$CACHE_NVIM_DEPS_DIR/.travis_cache_marker"
|
||||
# default target name for functional tests
|
||||
- FUNCTIONALTEST=functionaltest
|
||||
- CI_TARGET=tests
|
||||
@ -54,7 +44,8 @@ env:
|
||||
- CCACHE_COMPRESS=1
|
||||
- CCACHE_SLOPPINESS=time_macros,file_macro
|
||||
- CCACHE_BASEDIR="$TRAVIS_BUILD_DIR"
|
||||
- CI_OS_NAME="$TRAVIS_OS_NAME"
|
||||
# Default since 3.3, but Travis (Xenial) has 3.2.4; required with newer gcc/clang.
|
||||
- CCACHE_CPP2=1
|
||||
|
||||
anchors:
|
||||
envs: &common-job-env
|
||||
@ -71,12 +62,12 @@ addons:
|
||||
- build-essential
|
||||
- clang
|
||||
- cmake
|
||||
- cpanminus
|
||||
- cscope
|
||||
- gcc-multilib
|
||||
- gdb
|
||||
- gperf
|
||||
- language-pack-tr
|
||||
- libc6-dev-i386
|
||||
- libtool-bin
|
||||
- locales
|
||||
- ninja-build
|
||||
@ -86,16 +77,21 @@ addons:
|
||||
- xclip
|
||||
homebrew:
|
||||
update: true
|
||||
casks:
|
||||
- powershell
|
||||
packages:
|
||||
- ccache
|
||||
- cpanminus
|
||||
- ninja
|
||||
- perl
|
||||
|
||||
jobs:
|
||||
include:
|
||||
- stage: baseline
|
||||
name: clang-asan
|
||||
os: linux
|
||||
compiler: clang
|
||||
# Use Lua so that ASAN can test our embedded Lua support. 8fec4d53d0f6
|
||||
env:
|
||||
- CLANG_SANITIZER=ASAN_UBSAN
|
||||
- CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
|
||||
- *common-job-env
|
||||
- name: gcc-coverage (gcc 9)
|
||||
os: linux
|
||||
compiler: gcc-9
|
||||
@ -103,19 +99,28 @@ jobs:
|
||||
- GCOV=gcov-9
|
||||
- CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON"
|
||||
- GCOV_ERROR_FILE="/tmp/libgcov-errors.log"
|
||||
- USE_LUACOV=1
|
||||
- BUSTED_ARGS="--coverage"
|
||||
- *common-job-env
|
||||
addons:
|
||||
snaps:
|
||||
- name: powershell
|
||||
confinement: classic
|
||||
apt:
|
||||
sources:
|
||||
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
||||
packages:
|
||||
- *common-apt-packages
|
||||
- gcc-9
|
||||
- if: branch = master AND commit_message !~ /\[skip.lint\]/
|
||||
name: lint
|
||||
os: linux
|
||||
env:
|
||||
- CI_TARGET=lint
|
||||
- *common-job-env
|
||||
|
||||
- stage: second stage
|
||||
name: "macOS: clang"
|
||||
os: osx
|
||||
compiler: clang
|
||||
osx_image: xcode10.2 # macOS 10.14
|
||||
env:
|
||||
- *common-job-env
|
||||
- name: gcc-functionaltest-lua
|
||||
os: linux
|
||||
compiler: gcc
|
||||
@ -131,67 +136,15 @@ jobs:
|
||||
compiler: gcc
|
||||
env:
|
||||
- BUILD_32BIT=ON
|
||||
- CMAKE_FLAGS="$CMAKE_FLAGS -m32 -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake"
|
||||
- DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -m32 -DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake"
|
||||
# Minimum required CMake.
|
||||
- CMAKE_URL=https://cmake.org/files/v2.8/cmake-2.8.12-Linux-i386.sh
|
||||
- *common-job-env
|
||||
- name: big-endian
|
||||
- name: clang-tsan
|
||||
os: linux
|
||||
arch: s390x
|
||||
compiler: gcc
|
||||
compiler: clang
|
||||
env:
|
||||
- FUNCTIONALTEST=functionaltest-lua
|
||||
- CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON"
|
||||
- DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF"
|
||||
- CLANG_SANITIZER=TSAN
|
||||
- *common-job-env
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- *common-apt-packages
|
||||
- gettext
|
||||
- python-pip
|
||||
- python3-pip
|
||||
- python-setuptools
|
||||
- python3-setuptools
|
||||
- python-dev
|
||||
- python3-dev
|
||||
- if: type != pull_request
|
||||
name: snap
|
||||
os: linux
|
||||
env:
|
||||
- LC_ALL: C.UTF-8
|
||||
- LANG: C.UTF-8
|
||||
- SNAPCRAFT_ENABLE_SILENT_REPORT: y
|
||||
- SNAPCRAFT_ENABLE_DEVELOPER_DEBUG: y
|
||||
- SNAPCRAFT_BUILD_ENVIRONMENT: lxd
|
||||
addons:
|
||||
snaps:
|
||||
- name: snapcraft
|
||||
channel: stable
|
||||
classic: true
|
||||
- name: http
|
||||
- name: transfer
|
||||
- name: lxd
|
||||
channel: stable
|
||||
# Override default before_install, before_cache.
|
||||
before_install: /bin/true
|
||||
before_cache: /bin/true
|
||||
install: ci/snap/install.sh
|
||||
before_script: echo "Building snap..."
|
||||
script: ci/snap/script.sh
|
||||
after_success: ci/snap/after_success.sh
|
||||
deploy:
|
||||
skip_cleanup: true
|
||||
provider: script
|
||||
script: ci/snap/deploy.sh
|
||||
on:
|
||||
branch: master
|
||||
allow_failures:
|
||||
- env:
|
||||
- LC_ALL: C.UTF-8
|
||||
- LANG: C.UTF-8
|
||||
- SNAPCRAFT_ENABLE_SILENT_REPORT: y
|
||||
- SNAPCRAFT_ENABLE_DEVELOPER_DEBUG: y
|
||||
- SNAPCRAFT_BUILD_ENVIRONMENT: lxd
|
||||
fast_finish: true
|
||||
|
||||
before_install: ci/before_install.sh
|
||||
|
@ -1,4 +1,4 @@
|
||||
.DONE:
|
||||
@echo "Use GNU Make (gmake) to build neovim"
|
||||
@echo "Please use GNU Make (gmake) to build neovim"
|
||||
.DEFAULT:
|
||||
@echo "Use GNU Make (gmake) to build neovim"
|
||||
@echo "Please use GNU Make (gmake) to build neovim"
|
||||
|
234
CMakeLists.txt
234
CMakeLists.txt
@ -2,20 +2,10 @@
|
||||
# intro: https://codingnest.com/basic-cmake/
|
||||
# best practices (3.0+): https://gist.github.com/mbinna/c61dbb39bca0e4fb7d1f73b0d66a4fd1
|
||||
|
||||
# Version should match the tested CMAKE_URL in .github/workflows/ci.yml.
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
# Version should match the tested CMAKE_URL in .travis.yml.
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
project(nvim C)
|
||||
|
||||
if(POLICY CMP0065)
|
||||
cmake_policy(SET CMP0065 NEW)
|
||||
endif()
|
||||
if(POLICY CMP0060)
|
||||
cmake_policy(SET CMP0060 NEW)
|
||||
endif()
|
||||
if(POLICY CMP0075)
|
||||
cmake_policy(SET CMP0075 NEW)
|
||||
endif()
|
||||
|
||||
# Point CMake at any custom modules we may ship
|
||||
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
||||
|
||||
@ -26,23 +16,9 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
# Prefer our bundled versions of dependencies.
|
||||
if(DEFINED ENV{DEPS_BUILD_DIR})
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
|
||||
# pkg-config 29.2 has a bug on OpenBSD which causes it to drop any paths that
|
||||
# *contain* system include paths. To avoid this, we prefix what would be
|
||||
# "/usr/include" as "/_usr/include".
|
||||
# This check is also performed in the third-party/CMakeLists.txt and in the
|
||||
# else clause following here.
|
||||
# https://github.com/neovim/neovim/pull/14745#issuecomment-860201794
|
||||
set(DEPS_PREFIX "$ENV{DEPS_BUILD_DIR}/_usr" CACHE PATH "Path prefix for finding dependencies")
|
||||
else()
|
||||
set(DEPS_PREFIX "$ENV{DEPS_BUILD_DIR}/usr" CACHE PATH "Path prefix for finding dependencies")
|
||||
endif()
|
||||
set(DEPS_PREFIX "$ENV{DEPS_BUILD_DIR}/usr" CACHE PATH "Path prefix for finding dependencies")
|
||||
else()
|
||||
if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
|
||||
set(DEPS_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.deps/_usr" CACHE PATH "Path prefix for finding dependencies")
|
||||
else()
|
||||
set(DEPS_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.deps/usr" CACHE PATH "Path prefix for finding dependencies")
|
||||
endif()
|
||||
set(DEPS_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.deps/usr" CACHE PATH "Path prefix for finding dependencies")
|
||||
# When running from within CLion or Visual Studio,
|
||||
# build bundled dependencies automatically.
|
||||
if(NOT EXISTS ${DEPS_PREFIX}
|
||||
@ -71,8 +47,13 @@ else()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
|
||||
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${DEPS_PREFIX}/lib/pkgconfig")
|
||||
if(CMAKE_CROSSCOMPILING AND NOT UNIX)
|
||||
list(INSERT CMAKE_FIND_ROOT_PATH 0 ${DEPS_PREFIX})
|
||||
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX}/../host/bin)
|
||||
else()
|
||||
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
|
||||
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${DEPS_PREFIX}/lib/pkgconfig")
|
||||
endif()
|
||||
|
||||
# used for check_c_compiler_flag
|
||||
include(CheckCCompilerFlag)
|
||||
@ -95,8 +76,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
endif()
|
||||
|
||||
if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
# Ignore case when comparing filenames on Windows and Mac.
|
||||
set(CASE_INSENSITIVE_FILENAME TRUE)
|
||||
# Enable fixing case-insensitive filenames for Windows and Mac.
|
||||
set(USE_FNAME_CASE TRUE)
|
||||
endif()
|
||||
@ -134,32 +113,47 @@ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
|
||||
# If not in a git repo (e.g., a tarball) these tokens define the complete
|
||||
# version string, else they are combined with the result of `git describe`.
|
||||
set(NVIM_VERSION_MAJOR 0)
|
||||
set(NVIM_VERSION_MINOR 7)
|
||||
set(NVIM_VERSION_PATCH 2)
|
||||
set(NVIM_VERSION_MINOR 4)
|
||||
set(NVIM_VERSION_PATCH 4)
|
||||
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
|
||||
|
||||
# API level
|
||||
set(NVIM_API_LEVEL 9) # Bump this after any API change.
|
||||
set(NVIM_API_LEVEL 6) # Bump this after any API change.
|
||||
set(NVIM_API_LEVEL_COMPAT 0) # Adjust this after a _breaking_ API change.
|
||||
set(NVIM_API_PRERELEASE false)
|
||||
|
||||
file(TO_CMAKE_PATH ${CMAKE_CURRENT_LIST_DIR}/.git FORCED_GIT_DIR)
|
||||
include(GetGitRevisionDescription)
|
||||
get_git_head_revision(GIT_REFSPEC NVIM_VERSION_COMMIT)
|
||||
if(NVIM_VERSION_COMMIT) # is a git repo
|
||||
git_describe(NVIM_VERSION_MEDIUM)
|
||||
# `git describe` annotates the most recent tagged release; for pre-release
|
||||
# builds we must replace that with the unreleased version.
|
||||
string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.[0-9]+"
|
||||
"v${NVIM_VERSION_MAJOR}.${NVIM_VERSION_MINOR}.${NVIM_VERSION_PATCH}"
|
||||
NVIM_VERSION_MEDIUM
|
||||
${NVIM_VERSION_MEDIUM})
|
||||
endif()
|
||||
|
||||
set(NVIM_VERSION_BUILD_TYPE "${CMAKE_BUILD_TYPE}")
|
||||
# NVIM_VERSION_CFLAGS set further below.
|
||||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
# Minimize logging for release-type builds.
|
||||
if(NOT CMAKE_C_FLAGS_RELEASE MATCHES DMIN_LOG_LEVEL)
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DMIN_LOG_LEVEL=3")
|
||||
endif()
|
||||
if(NOT CMAKE_C_FLAGS_MINSIZEREL MATCHES DMIN_LOG_LEVEL)
|
||||
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -DMIN_LOG_LEVEL=3")
|
||||
endif()
|
||||
if(NOT CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DMIN_LOG_LEVEL)
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DMIN_LOG_LEVEL=3")
|
||||
endif()
|
||||
|
||||
# Log level (MIN_LOG_LEVEL in log.h)
|
||||
if("${MIN_LOG_LEVEL}" MATCHES "^$")
|
||||
# Minimize logging for release-type builds.
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Release"
|
||||
OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"
|
||||
OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel")
|
||||
message(STATUS "MIN_LOG_LEVEL not specified, default is 3 (ERROR) for release builds")
|
||||
set(MIN_LOG_LEVEL 3)
|
||||
else()
|
||||
message(STATUS "MIN_LOG_LEVEL not specified, default is 1 (INFO)")
|
||||
set(MIN_LOG_LEVEL 1)
|
||||
endif()
|
||||
message(STATUS "MIN_LOG_LEVEL not specified, default is 1 (INFO)")
|
||||
else()
|
||||
if(NOT MIN_LOG_LEVEL MATCHES "^[0-3]$")
|
||||
message(FATAL_ERROR "invalid MIN_LOG_LEVEL: " ${MIN_LOG_LEVEL})
|
||||
@ -279,37 +273,13 @@ if(MSVC)
|
||||
else()
|
||||
add_compile_options(-Wall -Wextra -pedantic -Wno-unused-parameter
|
||||
-Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion
|
||||
-Wdouble-promotion
|
||||
-Wmissing-noreturn
|
||||
-Wmissing-format-attribute
|
||||
-Wmissing-prototypes)
|
||||
|
||||
check_c_compiler_flag(-Wimplicit-fallthrough HAVE_WIMPLICIT_FALLTHROUGH_FLAG)
|
||||
if(HAVE_WIMPLICIT_FALLTHROUGH_FLAG)
|
||||
check_c_compiler_flag(-Wimplicit-fallthrough HAS_WIMPLICIT_FALLTHROUGH_FLAG)
|
||||
if(HAS_WIMPLICIT_FALLTHROUGH_FLAG)
|
||||
add_compile_options(-Wimplicit-fallthrough)
|
||||
endif()
|
||||
|
||||
# Clang doesn't have -Wsuggest-attribute so check for each one.
|
||||
check_c_compiler_flag(-Wsuggest-attribute=pure HAVE_WSUGGEST_ATTRIBUTE_PURE)
|
||||
if(HAVE_WSUGGEST_ATTRIBUTE_PURE)
|
||||
add_compile_options(-Wsuggest-attribute=pure)
|
||||
endif()
|
||||
|
||||
check_c_compiler_flag(-Wsuggest-attribute=const HAVE_WSUGGEST_ATTRIBUTE_CONST)
|
||||
if(HAVE_WSUGGEST_ATTRIBUTE_CONST)
|
||||
add_compile_options(-Wsuggest-attribute=const)
|
||||
endif()
|
||||
|
||||
check_c_compiler_flag(-Wsuggest-attribute=malloc HAVE_WSUGGEST_ATTRIBUTE_MALLOC)
|
||||
if(HAVE_WSUGGEST_ATTRIBUTE_MALLOC)
|
||||
add_compile_options(-Wsuggest-attribute=malloc)
|
||||
endif()
|
||||
|
||||
check_c_compiler_flag(-Wsuggest-attribute=cold HAVE_WSUGGEST_ATTRIBUTE_COLD)
|
||||
if(HAVE_WSUGGEST_ATTRIBUTE_COLD)
|
||||
add_compile_options(-Wsuggest-attribute=cold)
|
||||
endif()
|
||||
|
||||
# On FreeBSD 64 math.h uses unguarded C11 extension, which taints clang
|
||||
# 3.4.1 used there.
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
@ -339,10 +309,8 @@ if(UNIX)
|
||||
|
||||
if(HAS_FSTACK_PROTECTOR_STRONG_FLAG)
|
||||
add_compile_options(-fstack-protector-strong)
|
||||
link_libraries(-fstack-protector-strong)
|
||||
elseif(HAS_FSTACK_PROTECTOR_FLAG)
|
||||
add_compile_options(-fstack-protector --param ssp-buffer-size=4)
|
||||
link_libraries(-fstack-protector --param ssp-buffer-size=4)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -360,10 +328,10 @@ if(HAS_DIAG_COLOR_FLAG)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(CI_BUILD "CI, extra flags will be set" OFF)
|
||||
option(TRAVIS_CI_BUILD "Travis/QuickBuild CI, extra flags will be set" OFF)
|
||||
|
||||
if(CI_BUILD)
|
||||
message(STATUS "CI build enabled")
|
||||
if(TRAVIS_CI_BUILD)
|
||||
message(STATUS "Travis/QuickBuild CI build enabled")
|
||||
add_compile_options(-Werror)
|
||||
if(DEFINED ENV{BUILD_32BIT})
|
||||
# Get some test coverage for unsigned char
|
||||
@ -390,8 +358,8 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||
add_definitions(-D_GNU_SOURCE)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT PREFER_LUA AND LUAJIT_VERSION LESS "2.1.0-beta3")
|
||||
# Required for luajit < 2.1.0-beta3.
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
# Required for luajit.
|
||||
set(CMAKE_EXE_LINKER_FLAGS
|
||||
"${CMAKE_EXE_LINKER_FLAGS} -pagezero_size 10000 -image_base 100000000")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS
|
||||
@ -409,41 +377,9 @@ include_directories(SYSTEM ${LIBUV_INCLUDE_DIRS})
|
||||
find_package(Msgpack 1.0.0 REQUIRED)
|
||||
include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS})
|
||||
|
||||
find_package(LibLUV 1.43.0 REQUIRED)
|
||||
find_package(LibLUV 1.30.0 REQUIRED)
|
||||
include_directories(SYSTEM ${LIBLUV_INCLUDE_DIRS})
|
||||
|
||||
find_package(TreeSitter REQUIRED)
|
||||
include_directories(SYSTEM ${TreeSitter_INCLUDE_DIRS})
|
||||
|
||||
list(APPEND CMAKE_REQUIRED_INCLUDES "${TreeSitter_INCLUDE_DIRS}")
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES "${TreeSitter_LIBRARIES}")
|
||||
check_c_source_compiles("
|
||||
#include <tree_sitter/api.h>
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
TSQueryCursor *cursor = ts_query_cursor_new();
|
||||
ts_query_cursor_set_match_limit(cursor, 32);
|
||||
return 0;
|
||||
}
|
||||
" TS_HAS_SET_MATCH_LIMIT)
|
||||
if(TS_HAS_SET_MATCH_LIMIT)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_TS_HAS_SET_MATCH_LIMIT")
|
||||
endif()
|
||||
check_c_source_compiles("
|
||||
#include <stdlib.h>
|
||||
#include <tree_sitter/api.h>
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
ts_set_allocator(malloc, calloc, realloc, free);
|
||||
return 0;
|
||||
}
|
||||
" TS_HAS_SET_ALLOCATOR)
|
||||
if(TS_HAS_SET_ALLOCATOR)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_TS_HAS_SET_ALLOCATOR")
|
||||
endif()
|
||||
|
||||
# Note: The test lib requires LuaJIT; it will be skipped if LuaJIT is missing.
|
||||
option(PREFER_LUA "Prefer Lua over LuaJIT in the nvim executable." OFF)
|
||||
|
||||
@ -555,19 +491,18 @@ include(LuaHelpers)
|
||||
set(LUA_DEPENDENCIES lpeg mpack bit)
|
||||
if(NOT LUA_PRG)
|
||||
foreach(CURRENT_LUA_PRG luajit lua5.1 lua5.2 lua)
|
||||
unset(_CHECK_LUA_PRG CACHE)
|
||||
# If LUA_PRG is set find_program() will not search
|
||||
unset(LUA_PRG CACHE)
|
||||
unset(LUA_PRG_WORKS)
|
||||
find_program(_CHECK_LUA_PRG ${CURRENT_LUA_PRG})
|
||||
find_program(LUA_PRG ${CURRENT_LUA_PRG})
|
||||
|
||||
if(_CHECK_LUA_PRG)
|
||||
check_lua_deps(${_CHECK_LUA_PRG} "${LUA_DEPENDENCIES}" LUA_PRG_WORKS)
|
||||
if(LUA_PRG)
|
||||
check_lua_deps(${LUA_PRG} "${LUA_DEPENDENCIES}" LUA_PRG_WORKS)
|
||||
if(LUA_PRG_WORKS)
|
||||
set(LUA_PRG "${_CHECK_LUA_PRG}" CACHE FILEPATH "Path to a program.")
|
||||
break()
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
unset(_CHECK_LUA_PRG CACHE)
|
||||
else()
|
||||
check_lua_deps(${LUA_PRG} "${LUA_DEPENDENCIES}" LUA_PRG_WORKS)
|
||||
endif()
|
||||
@ -578,33 +513,6 @@ endif()
|
||||
|
||||
message(STATUS "Using Lua interpreter: ${LUA_PRG}")
|
||||
|
||||
if(DEBUG)
|
||||
option(COMPILE_LUA "Pre-compile Lua sources into bytecode (for sources that are included in the binary)" OFF)
|
||||
else()
|
||||
option(COMPILE_LUA "Pre-compile Lua sources into bytecode (for sources that are included in the binary)" ON)
|
||||
endif()
|
||||
|
||||
if(COMPILE_LUA AND NOT WIN32)
|
||||
if(PREFER_LUA)
|
||||
foreach(CURRENT_LUAC_PRG luac5.1 luac)
|
||||
find_program(_CHECK_LUAC_PRG ${CURRENT_LUAC_PRG})
|
||||
if(_CHECK_LUAC_PRG)
|
||||
set(LUAC_PRG "${_CHECK_LUAC_PRG} -s -o - %s" CACHE STRING "Format for compiling to Lua bytecode")
|
||||
break()
|
||||
endif()
|
||||
endforeach()
|
||||
elseif(LUA_PRG MATCHES "luajit")
|
||||
check_lua_module(${LUA_PRG} "jit.bcsave" LUAJIT_HAS_JIT_BCSAVE)
|
||||
if(LUAJIT_HAS_JIT_BCSAVE)
|
||||
set(LUAC_PRG "${LUA_PRG} -b -s %s -" CACHE STRING "Format for compiling to Lua bytecode")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(LUAC_PRG)
|
||||
message(STATUS "Using Lua compiler: ${LUAC_PRG}")
|
||||
endif()
|
||||
|
||||
# Setup busted.
|
||||
find_program(BUSTED_PRG NAMES busted busted.bat)
|
||||
find_program(BUSTED_LUA_PRG busted-lua)
|
||||
@ -652,10 +560,15 @@ if(BUSTED_PRG)
|
||||
# console pool: to do so we need to use the USES_TERMINAL
|
||||
# option, but this is only available in CMake 3.2
|
||||
set(TEST_TARGET_ARGS)
|
||||
list(APPEND TEST_TARGET_ARGS "USES_TERMINAL")
|
||||
if(NOT (${CMAKE_VERSION} VERSION_LESS 3.2.0))
|
||||
list(APPEND TEST_TARGET_ARGS "USES_TERMINAL")
|
||||
endif()
|
||||
|
||||
set(UNITTEST_PREREQS nvim-test unittest-headers)
|
||||
set(FUNCTIONALTEST_PREREQS nvim printenv-test printargs-test shell-test pwsh-test streams-test tty-test ${GENERATED_HELP_TAGS})
|
||||
set(FUNCTIONALTEST_PREREQS nvim printargs-test shell-test streams-test ${GENERATED_HELP_TAGS})
|
||||
if(NOT WIN32)
|
||||
list(APPEND FUNCTIONALTEST_PREREQS tty-test)
|
||||
endif()
|
||||
set(BENCHMARK_PREREQS nvim tty-test)
|
||||
|
||||
# Useful for automated build systems, if they want to manually run the tests.
|
||||
@ -751,26 +664,21 @@ endif()
|
||||
|
||||
if(LUACHECK_PRG)
|
||||
add_custom_target(lualint
|
||||
COMMAND ${LUACHECK_PRG} -q runtime/ scripts/ src/ test/
|
||||
COMMAND ${LUACHECK_PRG} -q runtime/ src/ test/
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
else()
|
||||
add_custom_target(lualint false
|
||||
COMMENT "lualint: LUACHECK_PRG not defined")
|
||||
endif()
|
||||
|
||||
|
||||
#add uninstall target
|
||||
if(NOT TARGET uninstall)
|
||||
configure_file(
|
||||
"cmake/UninstallHelper.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/UninstallHelper.cmake"
|
||||
IMMEDIATE @ONLY)
|
||||
|
||||
add_custom_target(uninstall
|
||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/UninstallHelper.cmake)
|
||||
endif()
|
||||
|
||||
|
||||
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
add_subdirectory(packaging)
|
||||
endif()
|
||||
set(CPACK_PACKAGE_NAME "Neovim")
|
||||
set(CPACK_PACKAGE_VENDOR "neovim.io")
|
||||
set(CPACK_PACKAGE_VERSION ${NVIM_VERSION_MEDIUM})
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "Neovim")
|
||||
# Set toplevel directory/installer name as Neovim
|
||||
set(CPACK_PACKAGE_FILE_NAME "Neovim")
|
||||
set(CPACK_TOPLEVEL_TAG "Neovim")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
|
||||
set(CPACK_NSIS_MODIFY_PATH ON)
|
||||
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
|
||||
include(CPack)
|
||||
|
168
CONTRIBUTING.md
168
CONTRIBUTING.md
@ -7,11 +7,10 @@ Getting started
|
||||
If you want to help but don't know where to start, here are some
|
||||
low-risk/isolated tasks:
|
||||
|
||||
- [Merge a Vim patch].
|
||||
- Try a [complexity:low] issue.
|
||||
- Fix bugs found by [Clang](#clang-scan-build), [PVS](#pvs-studio) or
|
||||
[Coverity](#coverity).
|
||||
- [Improve documentation][wiki-contribute-help]
|
||||
- [Merge a Vim patch] (familiarity with Vim is *strongly* recommended)
|
||||
|
||||
Reporting problems
|
||||
------------------
|
||||
@ -19,21 +18,19 @@ Reporting problems
|
||||
- [Check the FAQ][wiki-faq].
|
||||
- [Search existing issues][github-issues] (including closed!)
|
||||
- Update Neovim to the latest version to see if your problem persists.
|
||||
- Try to reproduce with `nvim --clean` ("factory defaults").
|
||||
- [Bisect](https://neovim.io/doc/user/starting.html#bisect) your config: disable plugins incrementally, to narrow down the cause of the issue.
|
||||
- [Bisect][git-bisect] Neovim's source code to find the cause of a regression, if you can. This is _extremely_ helpful.
|
||||
- Disable plugins incrementally, to narrow down the cause of the issue.
|
||||
- When reporting a crash, [include a stacktrace](https://github.com/neovim/neovim/wiki/FAQ#backtrace-linux).
|
||||
- Use [ASAN/UBSAN](#clang-sanitizers-asan-and-ubsan) to get detailed errors for segfaults and undefined behavior.
|
||||
- Check the logs. `:edit $NVIM_LOG_FILE`
|
||||
- [Bisect][git-bisect] to the cause of a regression, if you are able. This is _extremely_ helpful.
|
||||
- Check `$NVIM_LOG_FILE`, if it exists.
|
||||
- Include `cmake --system-information` for build-related issues.
|
||||
|
||||
Developer guidelines
|
||||
--------------------
|
||||
|
||||
- Read `:help dev` if you are working on Nvim core.
|
||||
- Read `:help dev-ui` if you are developing a UI.
|
||||
- Read `:help dev-api-client` if you are developing an API client.
|
||||
- Install `ninja` for faster builds of Nvim.
|
||||
- Nvim contributors should read `:help dev`.
|
||||
- External UI developers should read `:help dev-ui`.
|
||||
- API client developers should read `:help dev-api-client`.
|
||||
- Nvim developers are _strongly encouraged_ to install `ninja` for faster builds.
|
||||
```
|
||||
sudo apt-get install ninja-build
|
||||
make distclean
|
||||
@ -43,8 +40,8 @@ Developer guidelines
|
||||
Pull requests (PRs)
|
||||
---------------------
|
||||
|
||||
- To avoid duplicate work, create a draft pull request.
|
||||
- Your PR must include [test coverage][run-tests].
|
||||
- To avoid duplicate work, create a `[WIP]` pull request as soon as possible.
|
||||
- Your PR must include **test coverage.** See [test/README.md][run-tests].
|
||||
- Avoid cosmetic changes to unrelated files in the same commit.
|
||||
- Use a [feature branch][git-feature-branch] instead of the master branch.
|
||||
- Use a **rebase workflow** for small PRs.
|
||||
@ -63,55 +60,33 @@ Pull requests (PRs)
|
||||
- During a squash/fixup, use `exec make -C build unittest` between each
|
||||
pick/edit/reword.
|
||||
|
||||
### Stages: Draft and Ready for review
|
||||
### Stages: WIP, RFC, RDY
|
||||
|
||||
Pull requests have two stages: Draft and Ready for review.
|
||||
Pull requests have three stages: `[WIP]` (Work In Progress), `[RFC]` (Request
|
||||
For Comment) and `[RDY]` (Ready).
|
||||
|
||||
1. [Create a Draft PR][pr-draft] while you are _not_ requesting feedback as
|
||||
you are still working on the PR.
|
||||
- You can skip this if your PR is ready for review.
|
||||
2. [Change your PR to ready][pr-ready] when the PR is ready for review.
|
||||
- You can convert back to Draft at any time.
|
||||
|
||||
Do __not__ add labels like `[RFC]` or `[WIP]` in the title to indicate the
|
||||
state of your PR: this just adds noise. Non-Draft PRs are assumed to be open
|
||||
for comments; if you want feedback from specific people, `@`-mention them in
|
||||
a comment.
|
||||
- `[RFC]` is assumed by default, i.e. you are requesting a review.
|
||||
- Add `[WIP]` to the PR title if you are _not_ requesting feedback and the work
|
||||
is still in flux.
|
||||
- Add `[RDY]` if you are _done_ and only waiting on merge.
|
||||
|
||||
### Commit messages
|
||||
|
||||
Follow the [conventional commits guidelines][conventional_commits] to *make reviews easier* and to make
|
||||
the VCS/git logs more valuable. The general structure of a commit message is:
|
||||
Follow [commit message hygiene][hygiene] to *make reviews easier* and to make
|
||||
the VCS/git logs more valuable.
|
||||
|
||||
```
|
||||
<type>([optional scope]): <description>
|
||||
|
||||
[optional body]
|
||||
|
||||
[optional footer(s)]
|
||||
```
|
||||
|
||||
- Prefix the commit subject with one of these [_types_](https://github.com/commitizen/conventional-commit-types/blob/master/index.json):
|
||||
- `build`, `ci`, `docs`, `feat`, `fix`, `perf`, `refactor`, `revert`, `test`, `vim-patch`, `chore`
|
||||
- You can **ignore this for "fixup" commits** or any commits you expect to be squashed.
|
||||
- Append optional scope to _type_ such as `(lsp)`, `(treesitter)`, `(float)`, …
|
||||
- _Description_ shouldn't start with a capital letter or end in a period.
|
||||
- Use the _imperative voice_: "Fix bug" rather than "Fixed bug" or "Fixes bug."
|
||||
- Try to keep the first line under 72 characters.
|
||||
- A blank line must follow the subject.
|
||||
- Breaking API changes must be indicated by
|
||||
1. "!" after the type/scope, and
|
||||
2. a "BREAKING CHANGE" footer describing the change.
|
||||
Example:
|
||||
```
|
||||
refactor(provider)!: drop support for Python 2
|
||||
|
||||
BREAKING CHANGE: refactor to use Python 3 features since Python 2 is no longer supported.
|
||||
```
|
||||
- **Prefix the commit subject with a _scope_:** `doc:`, `test:`, `foo.c:`,
|
||||
`runtime:`, ...
|
||||
- Subject line for commits with only style/lint changes can be a single
|
||||
word: `style` or `lint`.
|
||||
- A blank line must separate the subject from the description.
|
||||
- Use the _imperative voice_: "Fix bug" rather than "Fixed bug" or "Fixes bug."
|
||||
|
||||
### Automated builds (CI)
|
||||
|
||||
Each pull request must pass the automated builds on [sourcehut] and [GitHub Actions].
|
||||
Each pull request must pass the automated builds on [Travis CI], [QuickBuild]
|
||||
and [AppVeyor].
|
||||
|
||||
- CI builds are compiled with [`-Werror`][gcc-warnings], so compiler warnings
|
||||
will fail the build.
|
||||
@ -125,19 +100,14 @@ Each pull request must pass the automated builds on [sourcehut] and [GitHub Acti
|
||||
- The [lint](#lint) build checks modified lines _and their immediate
|
||||
neighbors_, to encourage incrementally updating the legacy style to meet our
|
||||
[style](#style). (See [#3174][3174] for background.)
|
||||
- CI for freebsd and openbsd runs on [sourcehut].
|
||||
- To get a backtrace on freebsd (after connecting via ssh):
|
||||
```sh
|
||||
sudo pkg install tmux # If you want tmux.
|
||||
lldb build/bin/nvim -c nvim.core
|
||||
|
||||
# To get a full backtrace:
|
||||
# 1. Rebuild with debug info.
|
||||
rm -rf nvim.core build
|
||||
gmake CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="-DCI_BUILD=ON -DMIN_LOG_LEVEL=3" nvim
|
||||
# 2. Run the failing test to generate a new core file.
|
||||
TEST_FILE=test/functional/foo.lua gmake functionaltest
|
||||
lldb build/bin/nvim -c nvim.core
|
||||
- [How to investigate QuickBuild failures](https://github.com/neovim/neovim/pull/4718#issuecomment-217631350)
|
||||
- QuickBuild uses this invocation:
|
||||
```
|
||||
mkdir -p build/${params.get("buildType")} \
|
||||
&& cd build/${params.get("buildType")} \
|
||||
&& cmake -G "Unix Makefiles" -DBUSTED_OUTPUT_TYPE=TAP -DCMAKE_BUILD_TYPE=${params.get("buildType")}
|
||||
-DTRAVIS_CI_BUILD=ON ../.. && ${node.getAttribute("make", "make")}
|
||||
VERBOSE=1 nvim unittest-prereqs functionaltest-prereqs
|
||||
```
|
||||
|
||||
### Clang scan-build
|
||||
@ -162,7 +132,7 @@ see potential bugs found by [PVS Studio](https://www.viva64.com/en/pvs-studio/).
|
||||
|
||||
- Use this format for commit messages (where `{id}` is the PVS warning-id)):
|
||||
```
|
||||
fix(PVS/V{id}): {description}
|
||||
PVS/V{id}: {description}
|
||||
```
|
||||
- Search the Neovim commit history to find examples:
|
||||
```
|
||||
@ -178,27 +148,13 @@ master build. To view the defects, just request access; you will be approved.
|
||||
- Use this format for commit messages (where `{id}` is the CID (Coverity ID);
|
||||
([example](https://github.com/neovim/neovim/pull/804))):
|
||||
```
|
||||
fix(coverity/{id}): {description}
|
||||
coverity/{id}: {description}
|
||||
```
|
||||
- Search the Neovim commit history to find examples:
|
||||
```
|
||||
git log --oneline --no-merges --grep coverity
|
||||
```
|
||||
|
||||
### Clang sanitizers (ASAN and UBSAN)
|
||||
|
||||
ASAN/UBSAN can be used to detect memory errors and other common forms of undefined behavior at runtime in debug builds.
|
||||
|
||||
- To build Neovim with sanitizers enabled, use
|
||||
```
|
||||
rm -rf build && CMAKE_EXTRA_FLAGS="-DCMAKE_C_COMPILER=clang -DCLANG_ASAN_UBSAN=1" make
|
||||
```
|
||||
- When running Neovim, use
|
||||
```
|
||||
UBSAN_OPTIONS=print_stacktrace=1 ASAN_OPTIONS=log_path=/tmp/nvim_asan nvim args...
|
||||
```
|
||||
- If Neovim exits unexpectedly, check `/tmp/nvim_asan.{PID}` (or your preferred `log_path`) for log files with error messages.
|
||||
|
||||
|
||||
Coding
|
||||
------
|
||||
@ -218,36 +174,20 @@ You can lint a single file (but this will _not_ exclude legacy errors):
|
||||
|
||||
### Style
|
||||
|
||||
- Style rules are (mostly) defined by `src/uncrustify.cfg` which tries to match
|
||||
the [style-guide]. To use the Nvim `gq` command with `uncrustify`:
|
||||
```
|
||||
if !empty(findfile('src/uncrustify.cfg', ';'))
|
||||
setlocal formatprg=uncrustify\ -q\ -l\ C\ -c\ src/uncrustify.cfg\ --no-backup
|
||||
endif
|
||||
```
|
||||
The required version of `uncrustify` is specified in `uncrustify.cfg`.
|
||||
- There is also `.clang-format` which has drifted from the [style-guide], but
|
||||
is available for reference. To use the Nvim `gq` command with `clang-format`:
|
||||
```
|
||||
if !empty(findfile('.clang-format', ';'))
|
||||
setlocal formatprg=clang-format\ -style=file
|
||||
endif
|
||||
```
|
||||
The repo includes a `.clang-format` config file which (mostly) matches the
|
||||
[style-guide]. You can use `clang-format` to format code with the `gq`
|
||||
operator in Nvim:
|
||||
|
||||
if !empty(findfile('.clang-format', ';'))
|
||||
setlocal formatprg=clang-format\ -style=file
|
||||
endif
|
||||
|
||||
### Navigate
|
||||
|
||||
- Set `blame.ignoreRevsFile` to ignore [noise commits](https://github.com/neovim/neovim/commit/2d240024acbd68c2d3f82bc72cb12b1a4928c6bf) in git blame:
|
||||
```
|
||||
git config blame.ignoreRevsFile .git-blame-ignore-revs
|
||||
```
|
||||
- Use **[universal-ctags](https://github.com/universal-ctags/ctags).**
|
||||
("Exuberant ctags", the typical `ctags` binary provided by your distro, is
|
||||
unmaintained and won't recognize many function signatures in Neovim source.)
|
||||
- Explore the source code [on the web](https://sourcegraph.com/github.com/neovim/neovim).
|
||||
- If using [lua-language-server][], symlink `contrib/luarc.json` into the
|
||||
project root:
|
||||
|
||||
$ ln -s contrib/luarc.json .luarc.json
|
||||
|
||||
|
||||
Reviewing
|
||||
@ -256,10 +196,10 @@ Reviewing
|
||||
To help review pull requests, start with [this checklist][review-checklist].
|
||||
|
||||
Reviewing can be done on GitHub, but you may find it easier to do locally.
|
||||
Using [GitHub CLI][gh], you can create a new branch with the contents of a pull
|
||||
Using [`hub`][hub], you can create a new branch with the contents of a pull
|
||||
request, e.g. [#1820][1820]:
|
||||
|
||||
gh pr checkout https://github.com/neovim/neovim/pull/1820
|
||||
hub checkout https://github.com/neovim/neovim/pull/1820
|
||||
|
||||
Use [`git log -p master..FETCH_HEAD`][git-history-filtering] to list all
|
||||
commits in the feature branch which aren't in the `master` branch; `-p`
|
||||
@ -274,22 +214,18 @@ as context, use the `-W` argument as well.
|
||||
[git-rebasing]: http://git-scm.com/book/en/v2/Git-Branching-Rebasing
|
||||
[github-issues]: https://github.com/neovim/neovim/issues
|
||||
[1820]: https://github.com/neovim/neovim/pull/1820
|
||||
[gh]: https://cli.github.com/
|
||||
[conventional_commits]: https://www.conventionalcommits.org
|
||||
[style-guide]: https://neovim.io/doc/user/dev_style.html#dev-style
|
||||
[hub]: https://hub.github.com/
|
||||
[hygiene]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
|
||||
[style-guide]: http://neovim.io/develop/style-guide.xml
|
||||
[ASan]: http://clang.llvm.org/docs/AddressSanitizer.html
|
||||
[run-tests]: https://github.com/neovim/neovim/blob/master/test/README.md#running-tests
|
||||
[wiki-faq]: https://github.com/neovim/neovim/wiki/FAQ
|
||||
[review-checklist]: https://github.com/neovim/neovim/wiki/Code-review-checklist
|
||||
[3174]: https://github.com/neovim/neovim/issues/3174
|
||||
[sourcehut]: https://builds.sr.ht/~jmk
|
||||
[GitHub Actions]: https://github.com/neovim/neovim/actions
|
||||
[Travis CI]: https://travis-ci.org/neovim/neovim
|
||||
[QuickBuild]: http://neovim-qb.szakmeister.net/dashboard
|
||||
[AppVeyor]: https://ci.appveyor.com/project/neovim/neovim
|
||||
[Merge a Vim patch]: https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-Vim
|
||||
[Clang report]: https://neovim.io/doc/reports/clang/
|
||||
[complexity:low]: https://github.com/neovim/neovim/issues?q=is%3Aopen+is%3Aissue+label%3Acomplexity%3Alow
|
||||
[master error list]: https://raw.githubusercontent.com/neovim/doc/gh-pages/reports/clint/errors.json
|
||||
[wiki-contribute-help]: https://github.com/neovim/neovim/wiki/contribute-%3Ahelp
|
||||
[pr-draft]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request
|
||||
[pr-ready]: https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request
|
||||
[uncrustify]: http://uncrustify.sourceforge.net/
|
||||
[lua-language-server]: https://github.com/sumneko/lua-language-server/
|
||||
|
@ -189,17 +189,8 @@ contributed under the Vim license and (2) externally maintained libraries.
|
||||
The externally maintained libraries used by Neovim are:
|
||||
|
||||
- Klib: a Generic Library in C. MIT/X11 license.
|
||||
- Lua: MIT license
|
||||
- LuaJIT: a Just-In-Time Compiler for Lua. Copyright Mike Pall. MIT license.
|
||||
- Luv: Apache 2.0 license
|
||||
- libmpack: MIT license
|
||||
- libtermkey: MIT license
|
||||
- libuv. Copyright Joyent, Inc. and other Node contributors. Node.js license.
|
||||
- libvterm: MIT license
|
||||
- lua-compat: MIT license
|
||||
- tree-sitter: MIT license
|
||||
- xdiff: LGPL license
|
||||
- lua-cjson: MIT license
|
||||
- LuaJIT: a Just-In-Time Compiler for Lua. Copyright Mike Pall. MIT license.
|
||||
|
||||
====
|
||||
|
51
MAINTAIN.md
51
MAINTAIN.md
@ -10,13 +10,14 @@ General guidelines
|
||||
* Write down what was decided
|
||||
* Constraints are good
|
||||
* Use automation to solve problems
|
||||
* Never break the API... but sometimes break the UI
|
||||
* Never break the API
|
||||
|
||||
Ticket triage
|
||||
-------------
|
||||
|
||||
In practice we haven't found a way to forecast more precisely than "next" and
|
||||
"after next". So there are usually one or two (at most) planned milestones:
|
||||
In practice we haven't found a meaningful way to forecast more precisely than
|
||||
"next" and "after next". That means there are usually one or two (at most)
|
||||
planned milestones:
|
||||
|
||||
- Next bugfix-release (1.0.x)
|
||||
- Next feature-release (1.x.0)
|
||||
@ -24,16 +25,16 @@ In practice we haven't found a way to forecast more precisely than "next" and
|
||||
The forecasting problem might be solved with an explicit priority system (like
|
||||
Bram's todo.txt). Meanwhile the Neovim priority system is defined by:
|
||||
|
||||
- PRs nearing completion.
|
||||
- PRs nearing completion (RDY).
|
||||
- Issue labels. E.g. the `+plan` label increases the ticket's priority merely
|
||||
for having a plan written down: it is _closer to completion_ than tickets
|
||||
without a plan.
|
||||
- Comment activity or new information.
|
||||
|
||||
Anything that isn't in the next milestone, and doesn't have a finished PR—is
|
||||
Anything that isn't in the next milestone, and doesn't have a RDY PR ... is
|
||||
just not something you care very much about, by construction. Post-release you
|
||||
can review open issues, but chances are your next milestone is already getting
|
||||
full... :)
|
||||
full :)
|
||||
|
||||
Release policy
|
||||
--------------
|
||||
@ -52,45 +53,9 @@ has a major bug:
|
||||
3. Cut a release from `release-x.y`.
|
||||
- Run `./scripts/release.sh`
|
||||
- Update (force-push) the remote `stable` tag.
|
||||
- The [nightly job](https://github.com/neovim/neovim/blob/master/.github/workflows/release.yml#L4)
|
||||
- The [nightly job](https://github.com/neovim/bot-ci/blob/master/ci/nightly.sh)
|
||||
will update the release assets based on the `stable` tag.
|
||||
|
||||
The neovim repository includes a backport [github action](https://github.com/zeebe-io/backport-action).
|
||||
In order to trigger the action, a PR must be labeled with a label matching the
|
||||
form `backport release-0.X`. If the label is applied before the PR is merged,
|
||||
the backport will be filed automatically against the target branch. Otherwise,
|
||||
comment `\backport` on the merged PR *after* the label has been applied to trigger
|
||||
a backport. Note, the PR must have a description in the issue body, or the backport
|
||||
will fail.
|
||||
|
||||
Third-party dependencies
|
||||
--------------
|
||||
|
||||
These "bundled" dependencies can be updated by bumping their versions in `third-party/CMakeLists.txt`:
|
||||
- [Lua](https://www.lua.org/download.html)
|
||||
- [LuaJIT](https://github.com/LuaJIT/LuaJIT)
|
||||
- [Luv](https://github.com/luvit/luv)
|
||||
- [libtermkey](https://github.com/neovim/libtermkey)
|
||||
- [libuv](https://github.com/libuv/libuv)
|
||||
- [libvterm](http://www.leonerd.org.uk/code/libvterm/)
|
||||
- [lua-compat](https://github.com/keplerproject/lua-compat-5.3)
|
||||
- [tree-sitter](https://github.com/tree-sitter/tree-sitter)
|
||||
|
||||
`scripts/bump-dep.sh` is a script that can automate this process for `LuaJIT`, `Luv`, `libuv` & `tree-sitter`. See usage guide:
|
||||
- Run `./scripts/bump-deps.sh --dep Luv --version 1.43.0-0` to update a dependency.
|
||||
See `./scripts/bump-deps.sh -h` for more detailed usage
|
||||
- Run `./scripts/bump-deps.sh --pr` to create a pr
|
||||
To generate the default PR title and body, the script uses the most recent commit (not in `master`) with prefix `build(deps): `
|
||||
|
||||
These dependencies are "vendored" (inlined), we need to update the sources manually:
|
||||
- [libmpack](https://github.com/libmpack/libmpack)
|
||||
- [xdiff](https://github.com/git/git/tree/master/xdiff)
|
||||
- [lua-cjson](https://github.com/openresty/lua-cjson)
|
||||
- [Klib](https://github.com/attractivechaos/klib)
|
||||
|
||||
We also maintain some forks, particularly for Windows, if we are waiting on upstream changes:
|
||||
https://github.com/neovim/neovim/wiki/Deps
|
||||
|
||||
See also
|
||||
--------
|
||||
|
||||
|
103
Makefile
103
Makefile
@ -1,6 +1,4 @@
|
||||
MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
|
||||
MAKEFILE_DIR := $(dir $(MAKEFILE_PATH))
|
||||
|
||||
THIS_DIR = $(shell pwd)
|
||||
filter-false = $(strip $(filter-out 0 off OFF false FALSE,$1))
|
||||
filter-true = $(strip $(filter-out 1 on ON true TRUE,$1))
|
||||
|
||||
@ -14,7 +12,6 @@ CMAKE_BUILD_TYPE ?= Debug
|
||||
CMAKE_FLAGS := -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE)
|
||||
# Extra CMake flags which extend the default set
|
||||
CMAKE_EXTRA_FLAGS ?=
|
||||
NVIM_PRG := $(MAKEFILE_DIR)/build/bin/nvim
|
||||
|
||||
# CMAKE_INSTALL_PREFIX
|
||||
# - May be passed directly or as part of CMAKE_EXTRA_FLAGS.
|
||||
@ -38,7 +35,7 @@ else
|
||||
checkprefix: ;
|
||||
endif
|
||||
|
||||
CMAKE_GENERATOR ?= $(shell (command -v ninja > /dev/null 2>&1 && echo "Ninja") || \
|
||||
BUILD_TYPE ?= $(shell (type ninja > /dev/null 2>&1 && echo "Ninja") || \
|
||||
echo "Unix Makefiles")
|
||||
DEPS_BUILD_DIR ?= .deps
|
||||
ifneq (1,$(words [$(DEPS_BUILD_DIR)]))
|
||||
@ -46,28 +43,25 @@ ifneq (1,$(words [$(DEPS_BUILD_DIR)]))
|
||||
endif
|
||||
|
||||
ifeq (,$(BUILD_TOOL))
|
||||
ifeq (Ninja,$(CMAKE_GENERATOR))
|
||||
ifeq (Ninja,$(BUILD_TYPE))
|
||||
ifneq ($(shell $(CMAKE_PRG) --help 2>/dev/null | grep Ninja),)
|
||||
BUILD_TOOL = ninja
|
||||
BUILD_TOOL := ninja
|
||||
else
|
||||
# User's version of CMake doesn't support Ninja
|
||||
BUILD_TOOL = $(MAKE)
|
||||
CMAKE_GENERATOR := Unix Makefiles
|
||||
BUILD_TYPE := Unix Makefiles
|
||||
endif
|
||||
else
|
||||
BUILD_TOOL = $(MAKE)
|
||||
endif
|
||||
endif
|
||||
|
||||
BUILD_CMD = $(BUILD_TOOL)
|
||||
|
||||
# Only need to handle Ninja here. Make will inherit the VERBOSE variable, and the -j, -l, and -n flags.
|
||||
ifeq ($(CMAKE_GENERATOR),Ninja)
|
||||
ifneq ($(VERBOSE),)
|
||||
BUILD_TOOL += -v
|
||||
endif
|
||||
BUILD_TOOL += $(shell printf '%s' '$(MAKEFLAGS)' | grep -o -- ' *-[jl][0-9]\+ *')
|
||||
ifeq (n,$(findstring n,$(firstword -$(MAKEFLAGS))))
|
||||
BUILD_TOOL += -n
|
||||
ifneq ($(VERBOSE),)
|
||||
# Only need to handle Ninja here. Make will inherit the VERBOSE variable.
|
||||
ifeq ($(BUILD_TYPE),Ninja)
|
||||
BUILD_CMD += -v
|
||||
endif
|
||||
endif
|
||||
|
||||
@ -89,22 +83,22 @@ endif
|
||||
SINGLE_MAKE = export MAKEFLAGS= ; $(MAKE)
|
||||
|
||||
nvim: build/.ran-cmake deps
|
||||
+$(BUILD_TOOL) -C build
|
||||
+$(BUILD_CMD) -C build
|
||||
|
||||
libnvim: build/.ran-cmake deps
|
||||
+$(BUILD_TOOL) -C build libnvim
|
||||
+$(BUILD_CMD) -C build libnvim
|
||||
|
||||
cmake:
|
||||
touch CMakeLists.txt
|
||||
$(MAKE) build/.ran-cmake
|
||||
|
||||
build/.ran-cmake: | deps
|
||||
cd build && $(CMAKE_PRG) -G '$(CMAKE_GENERATOR)' $(CMAKE_FLAGS) $(CMAKE_EXTRA_FLAGS) $(MAKEFILE_DIR)
|
||||
cd build && $(CMAKE_PRG) -G '$(BUILD_TYPE)' $(CMAKE_FLAGS) $(CMAKE_EXTRA_FLAGS) $(THIS_DIR)
|
||||
touch $@
|
||||
|
||||
deps: | build/.ran-third-party-cmake
|
||||
ifeq ($(call filter-true,$(USE_BUNDLED)),)
|
||||
+$(BUILD_TOOL) -C $(DEPS_BUILD_DIR)
|
||||
+$(BUILD_CMD) -C $(DEPS_BUILD_DIR)
|
||||
endif
|
||||
|
||||
ifeq ($(call filter-true,$(USE_BUNDLED)),)
|
||||
@ -112,8 +106,8 @@ $(DEPS_BUILD_DIR):
|
||||
mkdir -p "$@"
|
||||
build/.ran-third-party-cmake:: $(DEPS_BUILD_DIR)
|
||||
cd $(DEPS_BUILD_DIR) && \
|
||||
$(CMAKE_PRG) -G '$(CMAKE_GENERATOR)' $(BUNDLED_CMAKE_FLAG) $(BUNDLED_LUA_CMAKE_FLAG) \
|
||||
$(DEPS_CMAKE_FLAGS) $(MAKEFILE_DIR)/third-party
|
||||
$(CMAKE_PRG) -G '$(BUILD_TYPE)' $(BUNDLED_CMAKE_FLAG) $(BUNDLED_LUA_CMAKE_FLAG) \
|
||||
$(DEPS_CMAKE_FLAGS) $(THIS_DIR)/third-party
|
||||
endif
|
||||
build/.ran-third-party-cmake::
|
||||
mkdir -p build
|
||||
@ -123,39 +117,26 @@ build/.ran-third-party-cmake::
|
||||
oldtest: | nvim build/runtime/doc/tags
|
||||
+$(SINGLE_MAKE) -C src/nvim/testdir clean
|
||||
ifeq ($(strip $(TEST_FILE)),)
|
||||
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG=$(NVIM_PRG) $(MAKEOVERRIDES)
|
||||
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" $(MAKEOVERRIDES)
|
||||
else
|
||||
@# Handle TEST_FILE=test_foo{,.res,.vim}.
|
||||
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst %.vim,%,$(patsubst %.res,%,$(TEST_FILE)))
|
||||
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG="$(realpath build/bin/nvim)" NEW_TESTS=$(TEST_FILE) SCRIPTS= $(MAKEOVERRIDES)
|
||||
endif
|
||||
# Build oldtest by specifying the relative .vim filename.
|
||||
.PHONY: phony_force
|
||||
src/nvim/testdir/%.vim: phony_force
|
||||
+$(SINGLE_MAKE) -C src/nvim/testdir NVIM_PRG=$(NVIM_PRG) SCRIPTS= $(MAKEOVERRIDES) $(patsubst src/nvim/testdir/%.vim,%,$@)
|
||||
|
||||
build/runtime/doc/tags helptags: | nvim
|
||||
+$(BUILD_TOOL) -C build runtime/doc/tags
|
||||
+$(BUILD_CMD) -C build runtime/doc/tags
|
||||
|
||||
# Builds help HTML _and_ checks for invalid help tags.
|
||||
helphtml: | nvim build/runtime/doc/tags
|
||||
+$(BUILD_TOOL) -C build doc_html
|
||||
+$(BUILD_CMD) -C build doc_html
|
||||
|
||||
functionaltest: | nvim
|
||||
+$(BUILD_TOOL) -C build functionaltest
|
||||
+$(BUILD_CMD) -C build functionaltest
|
||||
|
||||
functionaltest-lua: | nvim
|
||||
+$(BUILD_TOOL) -C build functionaltest-lua
|
||||
+$(BUILD_CMD) -C build functionaltest-lua
|
||||
|
||||
lualint: | build/.ran-cmake deps
|
||||
$(BUILD_TOOL) -C build lualint
|
||||
|
||||
shlint:
|
||||
@shellcheck --version | head -n 2
|
||||
shellcheck scripts/vim-patch.sh
|
||||
|
||||
_opt_shlint:
|
||||
@command -v shellcheck && { $(MAKE) shlint; exit $$?; } \
|
||||
|| echo "SKIP: shlint (shellcheck not found)"
|
||||
$(BUILD_CMD) -C build lualint
|
||||
|
||||
pylint:
|
||||
flake8 contrib/ scripts/ src/ test/
|
||||
@ -165,45 +146,37 @@ _opt_pylint:
|
||||
@command -v flake8 && { $(MAKE) pylint; exit $$?; } \
|
||||
|| echo "SKIP: pylint (flake8 not found)"
|
||||
|
||||
commitlint:
|
||||
$(NVIM_PRG) -u NONE -es +"lua require('scripts.lintcommit').main({trace=false})"
|
||||
|
||||
_opt_commitlint:
|
||||
@test -x build/bin/nvim && { $(MAKE) commitlint; exit $$?; } \
|
||||
|| echo "SKIP: commitlint (build/bin/nvim not found)"
|
||||
|
||||
unittest: | nvim
|
||||
+$(BUILD_TOOL) -C build unittest
|
||||
+$(BUILD_CMD) -C build unittest
|
||||
|
||||
benchmark: | nvim
|
||||
+$(BUILD_TOOL) -C build benchmark
|
||||
+$(BUILD_CMD) -C build benchmark
|
||||
|
||||
test: functionaltest unittest
|
||||
|
||||
clean:
|
||||
+test -d build && $(BUILD_TOOL) -C build clean || true
|
||||
+test -d build && $(BUILD_CMD) -C build clean || true
|
||||
$(MAKE) -C src/nvim/testdir clean
|
||||
$(MAKE) -C runtime/doc clean
|
||||
$(MAKE) -C runtime/indent clean
|
||||
|
||||
distclean:
|
||||
rm -rf $(DEPS_BUILD_DIR) build
|
||||
$(MAKE) clean
|
||||
|
||||
install: checkprefix nvim
|
||||
+$(BUILD_TOOL) -C build install
|
||||
+$(BUILD_CMD) -C build install
|
||||
|
||||
clint: build/.ran-cmake
|
||||
+$(BUILD_TOOL) -C build clint
|
||||
+$(BUILD_CMD) -C build clint
|
||||
|
||||
clint-full: build/.ran-cmake
|
||||
+$(BUILD_TOOL) -C build clint-full
|
||||
+$(BUILD_CMD) -C build clint-full
|
||||
|
||||
check-single-includes: build/.ran-cmake
|
||||
+$(BUILD_TOOL) -C build check-single-includes
|
||||
+$(BUILD_CMD) -C build check-single-includes
|
||||
|
||||
generated-sources: build/.ran-cmake
|
||||
+$(BUILD_TOOL) -C build generated-sources
|
||||
+$(BUILD_CMD) -C build generated-sources
|
||||
|
||||
appimage:
|
||||
bash scripts/genappimage.sh
|
||||
@ -214,16 +187,16 @@ appimage:
|
||||
appimage-%:
|
||||
bash scripts/genappimage.sh $*
|
||||
|
||||
lint: check-single-includes clint lualint _opt_pylint _opt_shlint _opt_commitlint
|
||||
lint: check-single-includes clint lualint _opt_pylint
|
||||
|
||||
# Generic pattern rules, allowing for `make build/bin/nvim` etc.
|
||||
# Does not work with "Unix Makefiles".
|
||||
ifeq ($(CMAKE_GENERATOR),Ninja)
|
||||
build/%: phony_force
|
||||
$(BUILD_TOOL) -C build $(patsubst build/%,%,$@)
|
||||
ifeq ($(BUILD_TYPE),Ninja)
|
||||
build/%:
|
||||
$(BUILD_CMD) -C build $(patsubst build/%,%,$@)
|
||||
|
||||
$(DEPS_BUILD_DIR)/%: phony_force
|
||||
$(BUILD_TOOL) -C $(DEPS_BUILD_DIR) $(patsubst $(DEPS_BUILD_DIR)/%,%,$@)
|
||||
$(DEPS_BUILD_DIR)/%:
|
||||
$(BUILD_CMD) -C $(DEPS_BUILD_DIR) $(patsubst $(DEPS_BUILD_DIR)/%,%,$@)
|
||||
endif
|
||||
|
||||
.PHONY: test lualint pylint shlint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage checkprefix commitlint
|
||||
.PHONY: test lualint pylint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage checkprefix
|
||||
|
56
README.md
56
README.md
@ -1,12 +1,12 @@
|
||||
<h1 align="center">
|
||||
<img src="https://raw.githubusercontent.com/neovim/neovim.github.io/master/logos/neovim-logo-300x87.png" alt="Neovim">
|
||||
</h1>
|
||||
[](https://neovim.io)
|
||||
|
||||
[Documentation](https://neovim.io/doc/general/) |
|
||||
[Chat](https://app.element.io/#/room/#neovim:matrix.org) |
|
||||
[Wiki](https://github.com/neovim/neovim/wiki) |
|
||||
[Documentation](https://neovim.io/doc) |
|
||||
[Chat/Discussion](https://gitter.im/neovim/neovim) |
|
||||
[Twitter](https://twitter.com/Neovim)
|
||||
|
||||
[](https://github.com/neovim/neovim/actions?query=workflow%3ACI+branch%3Amaster+event%3Apush)
|
||||
[](https://travis-ci.org/neovim/neovim)
|
||||
[](https://ci.appveyor.com/project/neovim/neovim/branch/master)
|
||||
[](https://codecov.io/gh/neovim/neovim)
|
||||
[](https://scan.coverity.com/projects/2227)
|
||||
[](https://neovim.io/doc/reports/clang)
|
||||
@ -15,7 +15,6 @@
|
||||
[](https://repology.org/metapackage/neovim)
|
||||
[](https://buildd.debian.org/neovim)
|
||||
[](https://github.com/neovim/neovim/releases/)
|
||||
[](https://snapcraft.io/nvim)
|
||||
|
||||
Neovim is a project that seeks to aggressively refactor Vim in order to:
|
||||
|
||||
@ -48,15 +47,13 @@ Install from package
|
||||
Pre-built packages for Windows, macOS, and Linux are found on the
|
||||
[Releases](https://github.com/neovim/neovim/releases/) page.
|
||||
|
||||
[Managed packages] are in [Homebrew], [Debian], [Ubuntu], [Fedora], [Arch Linux], [Void Linux], [Gentoo], and more!
|
||||
[Managed packages] are in Homebrew, [Debian], [Ubuntu], [Fedora], [Arch Linux],
|
||||
[Gentoo], and more!
|
||||
|
||||
Install from source
|
||||
-------------------
|
||||
|
||||
See the [Building Neovim](https://github.com/neovim/neovim/wiki/Building-Neovim) wiki page for details.
|
||||
|
||||
The build is CMake-based, but a Makefile is provided as a convenience.
|
||||
After installing the dependencies, run the following command.
|
||||
|
||||
make CMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
sudo make install
|
||||
@ -66,12 +63,29 @@ To install to a non-default location:
|
||||
make CMAKE_INSTALL_PREFIX=/full/path/
|
||||
make install
|
||||
|
||||
CMake hints for inspecting the build:
|
||||
To skip bundled (`third-party/*`) dependencies:
|
||||
|
||||
1. Install the dependencies using a package manager.
|
||||
```
|
||||
sudo apt install gperf luajit luarocks libuv1-dev libluajit-5.1-dev libunibilium-dev libmsgpack-dev libtermkey-dev libvterm-dev
|
||||
sudo luarocks build mpack
|
||||
sudo luarocks build lpeg
|
||||
sudo luarocks build inspect
|
||||
```
|
||||
2. Build with `USE_BUNDLED=OFF`:
|
||||
```
|
||||
make CMAKE_BUILD_TYPE=RelWithDebInfo USE_BUNDLED=OFF
|
||||
sudo make install
|
||||
```
|
||||
|
||||
To inspect the build, these CMake features are useful:
|
||||
|
||||
- `cmake --build build --target help` lists all build targets.
|
||||
- `build/CMakeCache.txt` (or `cmake -LAH build/`) contains the resolved values of all CMake variables.
|
||||
- `build/compile_commands.json` shows the full compiler invocations for each translation unit.
|
||||
|
||||
See the [Building Neovim](https://github.com/neovim/neovim/wiki/Building-Neovim) wiki page for details.
|
||||
|
||||
Transitioning from Vim
|
||||
--------------------
|
||||
|
||||
@ -99,9 +113,17 @@ Project layout
|
||||
License
|
||||
-------
|
||||
|
||||
Neovim contributions since [b17d96][license-commit] are licensed under the
|
||||
Apache 2.0 license, except for contributions copied from Vim (identified by the
|
||||
`vim-patch` token). See LICENSE for details.
|
||||
Neovim is licensed under the terms of the Apache 2.0 license, except for
|
||||
parts that were contributed under the Vim license.
|
||||
|
||||
- Contributions committed before [b17d96][license-commit] remain under the Vim
|
||||
license.
|
||||
|
||||
- Contributions committed after [b17d96][license-commit] are licensed under
|
||||
Apache 2.0 unless those contributions were copied from Vim (identified in
|
||||
the commit logs by the `vim-patch` token).
|
||||
|
||||
See `LICENSE` for details.
|
||||
|
||||
Vim is Charityware. You can use and copy it as much as you like, but you are
|
||||
encouraged to make a donation for needy children in Uganda. Please see the
|
||||
@ -121,10 +143,8 @@ Apache 2.0 license, except for contributions copied from Vim (identified by the
|
||||
[Managed packages]: https://github.com/neovim/neovim/wiki/Installing-Neovim#install-from-package
|
||||
[Debian]: https://packages.debian.org/testing/neovim
|
||||
[Ubuntu]: http://packages.ubuntu.com/search?keywords=neovim
|
||||
[Fedora]: https://packages.fedoraproject.org/pkgs/neovim/neovim/
|
||||
[Fedora]: https://apps.fedoraproject.org/packages/neovim
|
||||
[Arch Linux]: https://www.archlinux.org/packages/?q=neovim
|
||||
[Void Linux]: https://voidlinux.org/packages/?arch=x86_64&q=neovim
|
||||
[Gentoo]: https://packages.gentoo.org/packages/app-editors/neovim
|
||||
[Homebrew]: https://formulae.brew.sh/formula/neovim
|
||||
|
||||
<!-- vim: set tw=80: -->
|
||||
|
42
appveyor.yml
Normal file
42
appveyor.yml
Normal file
@ -0,0 +1,42 @@
|
||||
version: '{build}'
|
||||
environment:
|
||||
APPVEYOR_CACHE_ENTRY_ZIP_ARGS: "-t7z -m0=lzma -mx=9"
|
||||
DEPS_BUILD_DIR: "C:/projects/nvim-deps"
|
||||
DEPS_PREFIX: "C:/projects/nvim-deps/usr"
|
||||
# Silence/redirect errors due to missing locking support (via libgcov).
|
||||
GCOV_ERROR_FILE: "$(TEMP)/libgcov-errors.log"
|
||||
image: Visual Studio 2017
|
||||
configuration:
|
||||
- MINGW_64-gcov
|
||||
- MINGW_32
|
||||
- MSVC_64
|
||||
- MSVC_32
|
||||
init:
|
||||
- ps: |
|
||||
# Pull requests: skip some build configurations to save time.
|
||||
if ($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT -and $env:CONFIGURATION -match '^(MSVC_64|MINGW_32)$') {
|
||||
$env:APPVEYOR_CACHE_SKIP_SAVE = "true"
|
||||
Exit-AppVeyorBuild
|
||||
}
|
||||
# RDP
|
||||
#- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||
matrix:
|
||||
fast_finish: true
|
||||
install: []
|
||||
before_build:
|
||||
- ps: Install-Product node 8
|
||||
build_script:
|
||||
- powershell ci\build.ps1
|
||||
after_build:
|
||||
- ps: |
|
||||
if (Test-Path $env:GCOV_ERROR_FILE) {
|
||||
Get-Content $env:GCOV_ERROR_FILE -Head 10
|
||||
Get-Content $env:GCOV_ERROR_FILE -Tail 10
|
||||
} else {
|
||||
write-host "no GCOV_ERROR_FILE"
|
||||
}
|
||||
cache:
|
||||
- C:\projects\nvim-deps -> third-party\**
|
||||
artifacts:
|
||||
- path: build/Neovim.zip
|
||||
- path: build/bin/nvim.exe
|
@ -7,8 +7,6 @@ CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "${CI_DIR}/common/build.sh"
|
||||
source "${CI_DIR}/common/suite.sh"
|
||||
|
||||
mkdir -p "${HOME}/.cache"
|
||||
|
||||
echo "before_cache.sh: cache size"
|
||||
du -chd 1 "${HOME}/.cache" | sort -rh | head -20
|
||||
|
||||
@ -18,7 +16,7 @@ ccache -s 2>/dev/null || true
|
||||
find "${HOME}/.ccache" -name stats -delete
|
||||
|
||||
# Update the third-party dependency cache only if the build was successful.
|
||||
if ended_successfully && [ -d "${DEPS_BUILD_DIR}" ]; then
|
||||
if ended_successfully; then
|
||||
# Do not cache downloads. They should not be needed with up-to-date deps.
|
||||
rm -rf "${DEPS_BUILD_DIR}/build/downloads"
|
||||
rm -rf "${CACHE_NVIM_DEPS_DIR}"
|
||||
|
64
ci/before_install.sh
Executable file
64
ci/before_install.sh
Executable file
@ -0,0 +1,64 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
if [[ "${CI_TARGET}" == lint ]]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
echo 'Python info:'
|
||||
(
|
||||
set -x
|
||||
python3 --version
|
||||
python2 --version
|
||||
python --version
|
||||
pip3 --version
|
||||
pip2 --version
|
||||
pip --version
|
||||
|
||||
pyenv --version
|
||||
pyenv versions
|
||||
) 2>&1 | sed 's/^/ /' || true
|
||||
|
||||
# Use pyenv, but not for OSX on Travis, where it only has the "system" version.
|
||||
if [[ "${TRAVIS_OS_NAME}" != osx ]] && command -v pyenv; then
|
||||
echo 'Setting Python versions via pyenv'
|
||||
|
||||
# Prefer Python 2 over 3 (more conservative).
|
||||
pyenv global 2.7.15:3.7.1
|
||||
|
||||
echo 'Updated Python info:'
|
||||
(
|
||||
set -x
|
||||
python3 --version
|
||||
python2 --version
|
||||
python --version
|
||||
|
||||
python3 -m pip --version
|
||||
python2 -m pip --version
|
||||
) 2>&1 | sed 's/^/ /'
|
||||
fi
|
||||
|
||||
echo "Install node (LTS)"
|
||||
|
||||
if [[ "${TRAVIS_OS_NAME}" == osx ]] || [ ! -f ~/.nvm/nvm.sh ]; then
|
||||
curl -o ~/.nvm/nvm.sh https://raw.githubusercontent.com/creationix/nvm/master/nvm.sh
|
||||
fi
|
||||
|
||||
source ~/.nvm/nvm.sh
|
||||
nvm install --lts
|
||||
nvm use --lts
|
||||
|
||||
if [[ -n "$CMAKE_URL" ]]; then
|
||||
echo "Installing custom CMake: $CMAKE_URL"
|
||||
curl --retry 5 --silent --fail -o /tmp/cmake-installer.sh "$CMAKE_URL"
|
||||
mkdir -p "$HOME/.local/bin" /opt/cmake-custom
|
||||
bash /tmp/cmake-installer.sh --prefix=/opt/cmake-custom --skip-license
|
||||
ln -sfn /opt/cmake-custom/bin/cmake "$HOME/.local/bin/cmake"
|
||||
cmake_version="$(cmake --version)"
|
||||
echo "$cmake_version" | grep -qF '2.8.12' || {
|
||||
echo "Unexpected CMake version: $cmake_version"
|
||||
exit 1
|
||||
}
|
||||
fi
|
@ -3,6 +3,10 @@
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
if [[ "${CI_TARGET}" == lint ]]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "${CI_DIR}/common/build.sh"
|
||||
|
||||
@ -21,13 +25,15 @@ ccache -s
|
||||
# Reset ccache stats for real results in before_cache.
|
||||
ccache --zero-stats
|
||||
|
||||
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
||||
# Adds user to a dummy group.
|
||||
# That allows to test changing the group of the file by `os_fchown`.
|
||||
sudo dscl . -create /Groups/chown_test
|
||||
sudo dscl . -append /Groups/chown_test GroupMembership "${USER}"
|
||||
fi
|
||||
|
||||
# Compile dependencies.
|
||||
build_deps
|
||||
|
||||
# Install cluacov for Lua coverage.
|
||||
if [[ "$USE_LUACOV" == 1 ]]; then
|
||||
"${DEPS_BUILD_DIR}/usr/bin/luarocks" install cluacov
|
||||
fi
|
||||
|
||||
rm -rf "${LOG_DIR}"
|
||||
mkdir -p "${LOG_DIR}"
|
||||
|
149
ci/build.ps1
149
ci/build.ps1
@ -1,11 +1,10 @@
|
||||
param([switch]$NoTests)
|
||||
Set-StrictMode -Version Latest
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
$ErrorActionPreference = 'stop'
|
||||
Set-PSDebug -Strict -Trace 1
|
||||
|
||||
$isPullRequest = ($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT -ne $null)
|
||||
$env:CONFIGURATION -match '^(?<compiler>\w+)_(?<bits>32|64)(?:-(?<option>\w+))?$'
|
||||
$compiler = $Matches.compiler
|
||||
$compileOption = if ($Matches -contains 'option') {$Matches.option} else {''}
|
||||
$compileOption = $Matches.option
|
||||
$bits = $Matches.bits
|
||||
$cmakeBuildType = $(if ($env:CMAKE_BUILD_TYPE -ne $null) {$env:CMAKE_BUILD_TYPE} else {'RelWithDebInfo'});
|
||||
$buildDir = [System.IO.Path]::GetFullPath("$(pwd)")
|
||||
@ -24,15 +23,11 @@ $uploadToCodeCov = $false
|
||||
|
||||
function exitIfFailed() {
|
||||
if ($LastExitCode -ne 0) {
|
||||
Set-PSDebug -Off
|
||||
exit $LastExitCode
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $NoTests) {
|
||||
node --version
|
||||
npm.cmd --version
|
||||
}
|
||||
|
||||
if (-Not (Test-Path -PathType container $env:DEPS_BUILD_DIR)) {
|
||||
write-host "cache dir not found: $($env:DEPS_BUILD_DIR)"
|
||||
mkdir $env:DEPS_BUILD_DIR
|
||||
@ -51,17 +46,13 @@ if ($compiler -eq 'MINGW') {
|
||||
$nvimCmakeVars['USE_GCOV'] = 'ON'
|
||||
$uploadToCodecov = $true
|
||||
$env:GCOV = "C:\msys64\mingw$bits\bin\gcov"
|
||||
|
||||
# Setup/build Lua coverage.
|
||||
$env:USE_LUACOV = 1
|
||||
$env:BUSTED_ARGS = "--coverage"
|
||||
}
|
||||
# These are native MinGW builds, but they use the toolchain inside
|
||||
# MSYS2, this allows using all the dependencies and tools available
|
||||
# in MSYS2, but we cannot build inside the MSYS2 shell.
|
||||
$cmakeGenerator = 'Ninja'
|
||||
$cmakeGeneratorArgs = '-v'
|
||||
$mingwPackages = @('ninja', 'cmake', 'diffutils').ForEach({
|
||||
$mingwPackages = @('ninja', 'cmake', 'perl', 'diffutils').ForEach({
|
||||
"mingw-w64-$arch-$_"
|
||||
})
|
||||
|
||||
@ -72,117 +63,91 @@ if ($compiler -eq 'MINGW') {
|
||||
& C:\msys64\usr\bin\mkdir -p /var/cache/pacman/pkg
|
||||
|
||||
# Build third-party dependencies
|
||||
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm -Syu" ; exitIfFailed
|
||||
# Update again in case updating pacman changes pacman.conf
|
||||
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm -Syu" ; exitIfFailed
|
||||
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm -Su" ; exitIfFailed
|
||||
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm --needed -S $mingwPackages" ; exitIfFailed
|
||||
}
|
||||
elseif ($compiler -eq 'MSVC') {
|
||||
$cmakeGeneratorArgs = '/verbosity:normal'
|
||||
$cmakeGenerator = 'Visual Studio 16 2019'
|
||||
}
|
||||
|
||||
if ($compiler -eq 'MSVC') {
|
||||
$installationPath = vswhere.exe -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
|
||||
if ($installationPath -and (test-path "$installationPath\Common7\Tools\vsdevcmd.bat")) {
|
||||
& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -arch=x${bits} -no_logo && set" | foreach-object {
|
||||
$name, $value = $_ -split '=', 2
|
||||
set-content env:\"$name" $value
|
||||
}
|
||||
if ($bits -eq 32) {
|
||||
$cmakeGenerator = 'Visual Studio 15 2017'
|
||||
}
|
||||
elseif ($bits -eq 64) {
|
||||
$cmakeGenerator = 'Visual Studio 15 2017 Win64'
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $NoTests) {
|
||||
python -m ensurepip
|
||||
python -m pip install pynvim ; exitIfFailed
|
||||
# Sanity check
|
||||
python -c "import pynvim; print(str(pynvim))" ; exitIfFailed
|
||||
# Setup python (use AppVeyor system python)
|
||||
C:\Python27\python.exe -m pip install pynvim ; exitIfFailed
|
||||
C:\Python35\python.exe -m pip install pynvim ; exitIfFailed
|
||||
# Disambiguate python3
|
||||
move c:\Python35\python.exe c:\Python35\python3.exe
|
||||
$env:PATH = "C:\Python35;C:\Python27;$env:PATH"
|
||||
# Sanity check
|
||||
python -c "import pynvim; print(str(pynvim))" ; exitIfFailed
|
||||
python3 -c "import pynvim; print(str(pynvim))" ; exitIfFailed
|
||||
|
||||
gem.cmd install --pre neovim
|
||||
Get-Command -CommandType Application neovim-ruby-host.bat
|
||||
$env:PATH = "C:\Ruby24\bin;$env:PATH"
|
||||
gem.cmd install neovim
|
||||
Get-Command -CommandType Application neovim-ruby-host.bat
|
||||
|
||||
npm.cmd install -g neovim
|
||||
Get-Command -CommandType Application neovim-node-host.cmd
|
||||
npm.cmd link neovim
|
||||
}
|
||||
npm.cmd install -g neovim
|
||||
Get-Command -CommandType Application neovim-node-host.cmd
|
||||
npm.cmd link neovim
|
||||
|
||||
function convertToCmakeArgs($vars) {
|
||||
return $vars.GetEnumerator() | foreach { "-D$($_.Key)=$($_.Value)" }
|
||||
}
|
||||
|
||||
cd $env:DEPS_BUILD_DIR
|
||||
if ($compiler -eq 'MSVC') {
|
||||
if ($bits -eq 32) {
|
||||
cmake -G $cmakeGenerator -A Win32 $(convertToCmakeArgs($depsCmakeVars)) "$buildDir/third-party/" ; exitIfFailed
|
||||
} else {
|
||||
cmake -G $cmakeGenerator -A x64 $(convertToCmakeArgs($depsCmakeVars)) "$buildDir/third-party/" ; exitIfFailed
|
||||
}
|
||||
} else {
|
||||
cmake -G $cmakeGenerator $(convertToCmakeArgs($depsCmakeVars)) "$buildDir/third-party/" ; exitIfFailed
|
||||
}
|
||||
cmake -G $cmakeGenerator $(convertToCmakeArgs($depsCmakeVars)) "$buildDir/third-party/" ; exitIfFailed
|
||||
cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed
|
||||
cd $buildDir
|
||||
|
||||
# Build Neovim
|
||||
mkdir build
|
||||
cd build
|
||||
if ($compiler -eq 'MSVC') {
|
||||
if ($bits -eq 32) {
|
||||
cmake -G $cmakeGenerator -A Win32 $(convertToCmakeArgs($nvimCmakeVars)) .. ; exitIfFailed
|
||||
} else {
|
||||
cmake -G $cmakeGenerator -A x64 $(convertToCmakeArgs($nvimCmakeVars)) .. ; exitIfFailed
|
||||
}
|
||||
} else {
|
||||
cmake -G $cmakeGenerator $(convertToCmakeArgs($nvimCmakeVars)) .. ; exitIfFailed
|
||||
}
|
||||
cmake -G $cmakeGenerator $(convertToCmakeArgs($nvimCmakeVars)) .. ; exitIfFailed
|
||||
cmake --build . --config $cmakeBuildType -- $cmakeGeneratorArgs ; exitIfFailed
|
||||
.\bin\nvim --version ; exitIfFailed
|
||||
|
||||
# Ensure that the "win32" feature is set.
|
||||
.\bin\nvim -u NONE --headless -c 'exe !has(\"win32\").\"cq\"' ; exitIfFailed
|
||||
|
||||
if ($env:USE_LUACOV -eq 1) {
|
||||
& $env:DEPS_PREFIX\luarocks\luarocks.bat install cluacov
|
||||
}
|
||||
|
||||
if (-not $NoTests) {
|
||||
# Functional tests
|
||||
# The $LastExitCode from MSBuild can't be trusted
|
||||
$failed = $false
|
||||
|
||||
# Run only this test file:
|
||||
# $env:TEST_FILE = "test\functional\foo.lua"
|
||||
cmake --build . --config $cmakeBuildType --target functionaltest -- $cmakeGeneratorArgs 2>&1 |
|
||||
foreach { $failed = $failed -or
|
||||
$_ -match 'functional tests failed with error'; $_ }
|
||||
|
||||
# Functional tests
|
||||
# The $LastExitCode from MSBuild can't be trusted
|
||||
$failed = $false
|
||||
# Temporarily turn off tracing to reduce log file output
|
||||
Set-PSDebug -Off
|
||||
cmake --build . --config $cmakeBuildType --target functionaltest -- $cmakeGeneratorArgs 2>&1 |
|
||||
foreach { $failed = $failed -or
|
||||
$_ -match 'functional tests failed with error'; $_ }
|
||||
if ($failed) {
|
||||
if ($uploadToCodecov) {
|
||||
if ($env:USE_LUACOV -eq 1) {
|
||||
& $env:DEPS_PREFIX\bin\luacov.bat
|
||||
}
|
||||
bash -l /c/projects/neovim/ci/common/submit_coverage.sh functionaltest
|
||||
}
|
||||
if ($failed) {
|
||||
exit $LastExitCode
|
||||
}
|
||||
exit $LastExitCode
|
||||
}
|
||||
Set-PSDebug -Strict -Trace 1
|
||||
|
||||
# Old tests
|
||||
# Add MSYS to path, required for e.g. `find` used in test scripts.
|
||||
# But would break functionaltests, where its `more` would be used then.
|
||||
$OldPath = $env:PATH
|
||||
$env:PATH = "C:\msys64\usr\bin;$env:PATH"
|
||||
& "C:\msys64\mingw$bits\bin\mingw32-make.exe" -C $(Convert-Path ..\src\nvim\testdir) VERBOSE=1 ; exitIfFailed
|
||||
$env:PATH = $OldPath
|
||||
|
||||
if ($uploadToCodecov) {
|
||||
bash -l /c/projects/neovim/ci/common/submit_coverage.sh oldtest
|
||||
}
|
||||
if ($uploadToCodecov) {
|
||||
bash -l /c/projects/neovim/ci/common/submit_coverage.sh functionaltest
|
||||
}
|
||||
|
||||
# Ensure choco's cpack is not in PATH otherwise, it conflicts with CMake's
|
||||
if (Test-Path -Path $env:ChocolateyInstall\bin\cpack.exe) {
|
||||
Remove-Item -Path $env:ChocolateyInstall\bin\cpack.exe -Force
|
||||
# Old tests
|
||||
# Add MSYS to path, required for e.g. `find` used in test scripts.
|
||||
# But would break functionaltests, where its `more` would be used then.
|
||||
$OldPath = $env:PATH
|
||||
$env:PATH = "C:\msys64\usr\bin;$env:PATH"
|
||||
& "C:\msys64\mingw$bits\bin\mingw32-make.exe" -C $(Convert-Path ..\src\nvim\testdir) VERBOSE=1 ; exitIfFailed
|
||||
$env:PATH = $OldPath
|
||||
|
||||
if ($uploadToCodecov) {
|
||||
bash -l /c/projects/neovim/ci/common/submit_coverage.sh oldtest
|
||||
}
|
||||
|
||||
# Build artifacts
|
||||
cpack -C $cmakeBuildType
|
||||
cpack -G ZIP -C RelWithDebInfo
|
||||
if ($env:APPVEYOR_REPO_TAG_NAME -ne $null) {
|
||||
cpack -G NSIS -C RelWithDebInfo
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
_stat() {
|
||||
if test "${CI_OS_NAME}" = osx ; then
|
||||
if test "${TRAVIS_OS_NAME}" = osx ; then
|
||||
stat -f %Sm "${@}"
|
||||
else
|
||||
stat -c %y "${@}"
|
||||
@ -8,6 +8,8 @@ _stat() {
|
||||
|
||||
top_make() {
|
||||
printf '%78s\n' | tr ' ' '='
|
||||
# Travis has 1.5 virtual cores according to:
|
||||
# http://docs.travis-ci.com/user/speeding-up-the-build/#Paralellizing-your-build-on-one-VM
|
||||
ninja "$@"
|
||||
}
|
||||
|
||||
@ -16,6 +18,9 @@ build_make() {
|
||||
}
|
||||
|
||||
build_deps() {
|
||||
if test "${BUILD_32BIT}" = ON ; then
|
||||
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
|
||||
fi
|
||||
if test "${FUNCTIONALTEST}" = "functionaltest-lua" \
|
||||
|| test "${CLANG_SANITIZER}" = "ASAN_UBSAN" ; then
|
||||
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON"
|
||||
@ -27,7 +32,7 @@ build_deps() {
|
||||
if test "${CACHE_ENABLE}" = "false" ; then
|
||||
export CCACHE_RECACHE=1
|
||||
elif test -f "${CACHE_MARKER}" ; then
|
||||
echo "Using third-party dependencies from cache (last update: $(_stat "${CACHE_MARKER}"))."
|
||||
echo "Using third-party dependencies from Travis cache (last update: $(_stat "${CACHE_MARKER}"))."
|
||||
cp -a "${CACHE_NVIM_DEPS_DIR}"/. "${DEPS_BUILD_DIR}"
|
||||
fi
|
||||
|
||||
@ -35,28 +40,30 @@ build_deps() {
|
||||
# update CMake configuration and update to newer deps versions.
|
||||
cd "${DEPS_BUILD_DIR}"
|
||||
echo "Configuring with '${DEPS_CMAKE_FLAGS}'."
|
||||
CC= cmake -G Ninja ${DEPS_CMAKE_FLAGS} "${CI_BUILD_DIR}/third-party/"
|
||||
CC= cmake -G Ninja ${DEPS_CMAKE_FLAGS} "${TRAVIS_BUILD_DIR}/third-party/"
|
||||
|
||||
if ! top_make; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd "${CI_BUILD_DIR}"
|
||||
cd "${TRAVIS_BUILD_DIR}"
|
||||
}
|
||||
|
||||
build_nvim() {
|
||||
check_core_dumps --delete quiet
|
||||
|
||||
prepare_build() {
|
||||
if test -n "${CLANG_SANITIZER}" ; then
|
||||
CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON"
|
||||
fi
|
||||
if test "${BUILD_32BIT}" = ON ; then
|
||||
CMAKE_FLAGS="${CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
|
||||
fi
|
||||
|
||||
mkdir -p "${BUILD_DIR}"
|
||||
cd "${BUILD_DIR}"
|
||||
echo "Configuring with '${CMAKE_FLAGS} $@'."
|
||||
cmake -G Ninja ${CMAKE_FLAGS} "$@" "${CI_BUILD_DIR}"
|
||||
|
||||
cmake -G Ninja ${CMAKE_FLAGS} "$@" "${TRAVIS_BUILD_DIR}"
|
||||
}
|
||||
|
||||
build_nvim() {
|
||||
echo "Building nvim."
|
||||
if ! top_make nvim ; then
|
||||
exit 1
|
||||
@ -83,5 +90,14 @@ build_nvim() {
|
||||
fi
|
||||
check_sanitizer "${LOG_DIR}"
|
||||
|
||||
cd "${CI_BUILD_DIR}"
|
||||
cd "${TRAVIS_BUILD_DIR}"
|
||||
}
|
||||
|
||||
macos_rvm_dance() {
|
||||
# neovim-ruby gem requires a ruby newer than the macOS default.
|
||||
source ~/.rvm/scripts/rvm
|
||||
rvm get stable --auto-dotfiles
|
||||
rvm reload
|
||||
rvm use 2.2.5
|
||||
rvm use
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
# Args:
|
||||
# $1: Flag(s) for codecov, separated by comma.
|
||||
|
||||
set -e
|
||||
set -ex
|
||||
|
||||
# Change to grandparent dir (POSIXly).
|
||||
CDPATH='' cd -P -- "$(dirname -- "$0")/../.." || exit
|
||||
@ -18,12 +18,12 @@ if ! [ -f "$codecov_sh" ]; then
|
||||
curl --retry 5 --silent --fail -o "$codecov_sh" https://codecov.io/bash
|
||||
chmod +x "$codecov_sh"
|
||||
|
||||
python -m pip install --quiet --user gcovr
|
||||
python3 -m pip install --quiet --user gcovr
|
||||
fi
|
||||
|
||||
(
|
||||
cd build
|
||||
python -m gcovr --branches --exclude-unreachable-branches --print-summary -j 2 --exclude '.*/auto/.*' --root .. --delete -o ../coverage.xml --xml
|
||||
python3 -m gcovr --branches --exclude-unreachable-branches --print-summary -j 2 --exclude '.*/auto/.*' --root .. --delete -o ../coverage.xml --xml
|
||||
)
|
||||
|
||||
# Upload to codecov.
|
||||
@ -43,14 +43,3 @@ fi
|
||||
# Cleanup always, especially collected data.
|
||||
find . \( -name '*.gcov' -o -name '*.gcda' \) -ls -delete | wc -l
|
||||
rm -f coverage.xml
|
||||
|
||||
# Upload Lua coverage (generated manually on AppVeyor/Windows).
|
||||
if [ "$USE_LUACOV" = 1 ] && [ "$1" != "oldtest" ]; then
|
||||
if [ -x "${DEPS_BUILD_DIR}/usr/bin/luacov" ]; then
|
||||
"${DEPS_BUILD_DIR}/usr/bin/luacov"
|
||||
fi
|
||||
if ! "$codecov_sh" -f luacov.report.out -X gcov -X fix -Z -F "lua,${codecov_flags}"; then
|
||||
echo "codecov upload failed."
|
||||
fi
|
||||
rm luacov.stats.out
|
||||
fi
|
||||
|
@ -1,3 +1,9 @@
|
||||
# HACK: get newline for use in strings given that "\n" and $'' do not work.
|
||||
NL="$(printf '\nE')"
|
||||
NL="${NL%E}"
|
||||
|
||||
FAIL_SUMMARY=""
|
||||
|
||||
# Test success marker. If END_MARKER file exists, we know that all tests
|
||||
# finished. If FAIL_SUMMARY_FILE exists we know that some tests failed, this
|
||||
# file will contain information about failed tests. Build is considered
|
||||
@ -5,27 +11,173 @@
|
||||
END_MARKER="$BUILD_DIR/.tests_finished"
|
||||
FAIL_SUMMARY_FILE="$BUILD_DIR/.test_errors"
|
||||
|
||||
ANSI_CLEAR="\033[0K"
|
||||
|
||||
travis_fold() {
|
||||
local action="$1"
|
||||
local name="$2"
|
||||
name="$(echo -n "$name" | tr '\n\0' '--' | sed 's/[^A-Za-z0-9]\{1,\}/-/g')"
|
||||
name="$(echo -n "$name" | sed 's/-$//')"
|
||||
echo -en "travis_fold:${action}:${name}\r${ANSI_CLEAR}"
|
||||
}
|
||||
|
||||
if test "$TRAVIS" != "true" ; then
|
||||
travis_fold() {
|
||||
return 0
|
||||
}
|
||||
fi
|
||||
|
||||
enter_suite() {
|
||||
set +x
|
||||
FAILED=0
|
||||
rm -f "${END_MARKER}"
|
||||
local suite_name="$1"
|
||||
export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE}/$suite_name"
|
||||
travis_fold start "${NVIM_TEST_CURRENT_SUITE}"
|
||||
set -x
|
||||
}
|
||||
|
||||
exit_suite() {
|
||||
set +x
|
||||
if test $FAILED -ne 0 ; then
|
||||
echo "Suite ${NVIM_TEST_CURRENT_SUITE} failed, summary:"
|
||||
echo "${FAIL_SUMMARY}"
|
||||
else
|
||||
travis_fold end "${NVIM_TEST_CURRENT_SUITE}"
|
||||
fi
|
||||
export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE%/*}"
|
||||
if test "$1" != "--continue" ; then
|
||||
exit $FAILED
|
||||
else
|
||||
local saved_failed=$FAILED
|
||||
FAILED=0
|
||||
return $saved_failed
|
||||
fi
|
||||
}
|
||||
|
||||
fail() {
|
||||
local test_name="$1"
|
||||
local message="$2"
|
||||
local fail_char="$2"
|
||||
local message="$3"
|
||||
|
||||
: ${fail_char:=F}
|
||||
: ${message:=Test $test_name failed}
|
||||
|
||||
local full_msg="$test_name :: $message"
|
||||
local full_msg="$fail_char $NVIM_TEST_CURRENT_SUITE|$test_name :: $message"
|
||||
FAIL_SUMMARY="${FAIL_SUMMARY}${NL}${full_msg}"
|
||||
echo "${full_msg}" >> "${FAIL_SUMMARY_FILE}"
|
||||
echo "Failed: $full_msg"
|
||||
FAILED=1
|
||||
}
|
||||
|
||||
run_test() {
|
||||
local cmd="$1"
|
||||
test $# -gt 0 && shift
|
||||
local test_name="$1"
|
||||
: ${test_name:=$cmd}
|
||||
test $# -gt 0 && shift
|
||||
if ! eval "$cmd" ; then
|
||||
fail "${test_name}" "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
run_test_wd() {
|
||||
local hang_ok=
|
||||
if test "$1" = "--allow-hang" ; then
|
||||
hang_ok=1
|
||||
shift
|
||||
fi
|
||||
|
||||
local timeout="$1"
|
||||
test $# -gt 0 && shift
|
||||
|
||||
local cmd="$1"
|
||||
test $# -gt 0 && shift
|
||||
|
||||
local restart_cmd="$1"
|
||||
: ${restart_cmd:=true}
|
||||
test $# -gt 0 && shift
|
||||
|
||||
local test_name="$1"
|
||||
: ${test_name:=$cmd}
|
||||
test $# -gt 0 && shift
|
||||
|
||||
local output_file="$(mktemp)"
|
||||
local status_file="$(mktemp)"
|
||||
local sid_file="$(mktemp)"
|
||||
|
||||
local restarts=5
|
||||
local prev_tmpsize=-1
|
||||
while test $restarts -gt 0 ; do
|
||||
: > "$status_file"
|
||||
: > "$sid_file"
|
||||
setsid \
|
||||
env \
|
||||
output_file="$output_file" \
|
||||
status_file="$status_file" \
|
||||
sid_file="$sid_file" \
|
||||
cmd="$cmd" \
|
||||
CI_DIR="$CI_DIR" \
|
||||
sh -c '
|
||||
. "${CI_DIR}/common/test.sh"
|
||||
ps -o sid= > "$sid_file"
|
||||
(
|
||||
ret=0
|
||||
if ! eval "$cmd" 2>&1 ; then
|
||||
ret=1
|
||||
fi
|
||||
echo "$ret" > "$status_file"
|
||||
) | tee -a "$output_file"
|
||||
'
|
||||
while test "$(stat -c "%s" "$status_file")" -eq 0 ; do
|
||||
prev_tmpsize=$tmpsize
|
||||
sleep $timeout
|
||||
tmpsize="$(stat -c "%s" "$output_file")"
|
||||
if test $tempsize -eq $prev_temsize ; then
|
||||
# no output, assuming either hang or exit
|
||||
break
|
||||
fi
|
||||
done
|
||||
restarts=$(( restarts - 1 ))
|
||||
if test "$(stat -c "%s" "$status_file")" -eq 0 ; then
|
||||
# Status file not updated, assuming hang
|
||||
|
||||
# SID not known, this should not ever happen
|
||||
if test "$(stat -c "%s" "$sid_file")" -eq 0 ; then
|
||||
fail "$test_name" E "Shell did not run"
|
||||
break
|
||||
fi
|
||||
|
||||
# Kill all processes which belong to one session: should get rid of test
|
||||
# processes as well as sh itself.
|
||||
pkill -KILL -s$(cat "$sid_file")
|
||||
|
||||
if test $restarts -eq 0 ; then
|
||||
if test -z "$hang_ok" ; then
|
||||
fail "$test_name" E "Test hang up"
|
||||
fi
|
||||
else
|
||||
echo "Test ${test_name} hang up, restarting"
|
||||
eval "$restart_cmd"
|
||||
fi
|
||||
else
|
||||
local new_failed="$(cat "$status_file")"
|
||||
if test "$new_failed" != "0" ; then
|
||||
fail "$test_name" F "Test failed in run_test_wd"
|
||||
fi
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
rm -f "$output_file"
|
||||
rm -f "$status_file"
|
||||
rm -f "$sid_file"
|
||||
}
|
||||
|
||||
ended_successfully() {
|
||||
if test -f "${FAIL_SUMMARY_FILE}" ; then
|
||||
echo 'Test failed, complete summary:'
|
||||
cat "${FAIL_SUMMARY_FILE}"
|
||||
|
||||
if [[ "$GITHUB_ACTIONS" == "true" ]]; then
|
||||
rm -f "$FAIL_SUMMARY_FILE"
|
||||
fi
|
||||
|
||||
return 1
|
||||
fi
|
||||
if ! test -f "${END_MARKER}" ; then
|
||||
|
@ -15,7 +15,7 @@ print_core() {
|
||||
return 0
|
||||
fi
|
||||
echo "======= Core file $core ======="
|
||||
if test "${CI_OS_NAME}" = osx ; then
|
||||
if test "${TRAVIS_OS_NAME}" = osx ; then
|
||||
lldb -Q -o "bt all" -f "${app}" -c "${core}"
|
||||
else
|
||||
gdb -n -batch -ex 'thread apply all bt full' "${app}" -c "${core}"
|
||||
@ -30,11 +30,11 @@ check_core_dumps() {
|
||||
fi
|
||||
local app="${1:-${BUILD_DIR}/bin/nvim}"
|
||||
local cores
|
||||
if test "${CI_OS_NAME}" = osx ; then
|
||||
if test "${TRAVIS_OS_NAME}" = osx ; then
|
||||
cores="$(find /cores/ -type f -print)"
|
||||
local _sudo='sudo'
|
||||
else
|
||||
cores="$(find ./ -type f \( -name 'core.*' -o -name core -o -name nvim.core \) -print)"
|
||||
cores="$(find ./ -type f -name 'core.*' -print)"
|
||||
local _sudo=
|
||||
fi
|
||||
|
||||
@ -51,7 +51,7 @@ check_core_dumps() {
|
||||
fi
|
||||
done
|
||||
if test "$app" != quiet ; then
|
||||
fail 'cores' 'Core dumps found'
|
||||
fail 'cores' E 'Core dumps found'
|
||||
fi
|
||||
}
|
||||
|
||||
@ -72,7 +72,7 @@ check_logs() {
|
||||
rm "${log}"
|
||||
done
|
||||
if test -n "${err}" ; then
|
||||
fail 'logs' 'Runtime errors detected.'
|
||||
fail 'logs' E 'Runtime errors detected.'
|
||||
fi
|
||||
}
|
||||
|
||||
@ -82,43 +82,50 @@ valgrind_check() {
|
||||
|
||||
check_sanitizer() {
|
||||
if test -n "${CLANG_SANITIZER}"; then
|
||||
check_logs "${1}" "*san.*" | ${SYMBOLIZER:-cat}
|
||||
check_logs "${1}" "*san.*"
|
||||
fi
|
||||
}
|
||||
|
||||
unittests() {(
|
||||
run_unittests() {(
|
||||
enter_suite unittests
|
||||
ulimit -c unlimited || true
|
||||
if ! build_make unittest ; then
|
||||
fail 'unittests' 'Unit tests failed'
|
||||
fail 'unittests' F 'Unit tests failed'
|
||||
fi
|
||||
submit_coverage unittest
|
||||
check_core_dumps "$(command -v luajit)"
|
||||
exit_suite
|
||||
)}
|
||||
|
||||
functionaltests() {(
|
||||
run_functionaltests() {(
|
||||
enter_suite functionaltests
|
||||
ulimit -c unlimited || true
|
||||
if ! build_make ${FUNCTIONALTEST}; then
|
||||
fail 'functionaltests' 'Functional tests failed'
|
||||
fail 'functionaltests' F 'Functional tests failed'
|
||||
fi
|
||||
submit_coverage functionaltest
|
||||
check_sanitizer "${LOG_DIR}"
|
||||
valgrind_check "${LOG_DIR}"
|
||||
check_core_dumps
|
||||
exit_suite
|
||||
)}
|
||||
|
||||
oldtests() {(
|
||||
run_oldtests() {(
|
||||
enter_suite oldtests
|
||||
ulimit -c unlimited || true
|
||||
if ! make oldtest; then
|
||||
reset
|
||||
fail 'oldtests' 'Legacy tests failed'
|
||||
fail 'oldtests' F 'Legacy tests failed'
|
||||
fi
|
||||
submit_coverage oldtest
|
||||
check_sanitizer "${LOG_DIR}"
|
||||
valgrind_check "${LOG_DIR}"
|
||||
check_core_dumps
|
||||
exit_suite
|
||||
)}
|
||||
|
||||
check_runtime_files() {(
|
||||
set +x
|
||||
local test_name="$1" ; shift
|
||||
local message="$1" ; shift
|
||||
local tst="$1" ; shift
|
||||
@ -129,25 +136,27 @@ check_runtime_files() {(
|
||||
# Prefer failing the build over using more robust construct because files
|
||||
# with IFS are not welcome.
|
||||
if ! test -e "$file" ; then
|
||||
fail "$test_name" "It appears that $file is only a part of the file name"
|
||||
fail "$test_name" E \
|
||||
"It appears that $file is only a part of the file name"
|
||||
fi
|
||||
if ! test "$tst" "$INSTALL_PREFIX/share/nvim/runtime/$file" ; then
|
||||
fail "$test_name" "$(printf "$message" "$file")"
|
||||
fail "$test_name" F "$(printf "$message" "$file")"
|
||||
fi
|
||||
done
|
||||
)}
|
||||
|
||||
install_nvim() {(
|
||||
enter_suite 'install_nvim'
|
||||
if ! build_make install ; then
|
||||
fail 'install' 'make install failed'
|
||||
exit 1
|
||||
fail 'install' E 'make install failed'
|
||||
exit_suite
|
||||
fi
|
||||
|
||||
"${INSTALL_PREFIX}/bin/nvim" --version
|
||||
if ! "${INSTALL_PREFIX}/bin/nvim" -u NONE -e -c ':help' -c ':qall' ; then
|
||||
echo "Running ':help' in the installed nvim failed."
|
||||
echo "Maybe the helptags have not been generated properly."
|
||||
fail 'help' 'Failed running :help'
|
||||
fail 'help' F 'Failed running :help'
|
||||
fi
|
||||
|
||||
# Check that all runtime files were installed
|
||||
@ -168,6 +177,13 @@ install_nvim() {(
|
||||
local genvimsynf=syntax/vim/generated.vim
|
||||
local gpat='syn keyword vimFuncName .*eval'
|
||||
if ! grep -q "$gpat" "${INSTALL_PREFIX}/share/nvim/runtime/$genvimsynf" ; then
|
||||
fail 'funcnames' "It appears that $genvimsynf does not contain $gpat."
|
||||
fail 'funcnames' F "It appears that $genvimsynf does not contain $gpat."
|
||||
fi
|
||||
|
||||
exit_suite
|
||||
)}
|
||||
|
||||
csi_clean() {
|
||||
find "${BUILD_DIR}/bin" -name 'test-includes-*' -delete
|
||||
find "${BUILD_DIR}" -name '*test-include*.o' -delete
|
||||
}
|
||||
|
@ -3,18 +3,24 @@
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
if [[ "${CI_TARGET}" == lint ]]; then
|
||||
python -m pip -q install --user --upgrade flake8
|
||||
exit
|
||||
fi
|
||||
|
||||
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
||||
export PATH="/usr/local/opt/ccache/libexec:$PATH"
|
||||
fi
|
||||
|
||||
# Use default CC to avoid compilation problems when installing Python modules.
|
||||
echo "Install neovim module for Python."
|
||||
CC=cc python -m pip -q install --user --upgrade pynvim
|
||||
echo "Install neovim module for Python 3."
|
||||
CC=cc python3 -m pip -q install --upgrade pynvim
|
||||
echo "Install neovim module for Python 2."
|
||||
CC=cc python2 -m pip -q install --upgrade pynvim
|
||||
|
||||
echo "Install neovim RubyGem."
|
||||
gem install --no-document --bindir "$HOME/.local/bin" --user-install --pre neovim
|
||||
gem install --no-document --version ">= 0.8.0" neovim
|
||||
|
||||
echo "Install neovim npm package"
|
||||
npm install -g neovim
|
||||
npm link neovim
|
||||
|
||||
if [[ $CI_OS_NAME != osx ]]; then
|
||||
sudo cpanm -n Neovim::Ext || cat "$HOME/.cpanm/build.log"
|
||||
perl -W -e 'use Neovim::Ext; print $Neovim::Ext::VERSION'
|
||||
fi
|
||||
|
@ -8,17 +8,25 @@ CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "${CI_DIR}/common/build.sh"
|
||||
source "${CI_DIR}/common/suite.sh"
|
||||
|
||||
rm -f "$END_MARKER"
|
||||
enter_suite 'clint'
|
||||
run_test 'make clint-full' clint
|
||||
exit_suite --continue
|
||||
|
||||
# Run all tests if no input argument is given
|
||||
if (($# == 0)); then
|
||||
tests=('clint-full' 'lualint' 'pylint' 'shlint' 'check-single-includes')
|
||||
else
|
||||
tests=("$@")
|
||||
fi
|
||||
enter_suite 'lualint'
|
||||
run_test 'make lualint' lualint
|
||||
exit_suite --continue
|
||||
|
||||
for i in "${tests[@]}"; do
|
||||
make "$i" || fail "$i"
|
||||
done
|
||||
enter_suite 'pylint'
|
||||
run_test 'make pylint' pylint
|
||||
exit_suite --continue
|
||||
|
||||
enter_suite single-includes
|
||||
CLICOLOR_FORCE=1 run_test_wd \
|
||||
--allow-hang \
|
||||
10s \
|
||||
'make check-single-includes' \
|
||||
'csi_clean' \
|
||||
single-includes
|
||||
exit_suite --continue
|
||||
|
||||
end_tests
|
||||
|
@ -8,28 +8,29 @@ source "${CI_DIR}/common/build.sh"
|
||||
source "${CI_DIR}/common/test.sh"
|
||||
source "${CI_DIR}/common/suite.sh"
|
||||
|
||||
rm -f "$END_MARKER"
|
||||
enter_suite build
|
||||
|
||||
# Run all tests (with some caveats) if no input argument is given
|
||||
if (($# == 0)); then
|
||||
tests=('build_nvim')
|
||||
check_core_dumps --delete quiet
|
||||
|
||||
if test "$CLANG_SANITIZER" != "TSAN"; then
|
||||
# Additional threads are only created when the builtin UI starts, which
|
||||
# doesn't happen in the unit/functional tests
|
||||
if test "${FUNCTIONALTEST}" != "functionaltest-lua"; then
|
||||
tests+=('unittests')
|
||||
fi
|
||||
tests+=('functionaltests')
|
||||
prepare_build
|
||||
build_nvim
|
||||
|
||||
exit_suite --continue
|
||||
|
||||
enter_suite tests
|
||||
|
||||
if test "$CLANG_SANITIZER" != "TSAN" ; then
|
||||
# Additional threads are only created when the builtin UI starts, which
|
||||
# doesn't happen in the unit/functional tests
|
||||
if test "${FUNCTIONALTEST}" != "functionaltest-lua"; then
|
||||
run_test run_unittests
|
||||
fi
|
||||
|
||||
tests+=('oldtests' 'install_nvim')
|
||||
else
|
||||
tests=("$@")
|
||||
run_test run_functionaltests
|
||||
fi
|
||||
run_test run_oldtests
|
||||
|
||||
for i in "${tests[@]}"; do
|
||||
eval "$i" || fail "$i"
|
||||
done
|
||||
run_test install_nvim
|
||||
|
||||
exit_suite --continue
|
||||
|
||||
end_tests
|
||||
|
@ -3,7 +3,14 @@
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
ci/run_${CI_TARGET}.sh
|
||||
# This will pass the environment variables down to a bash process which runs
|
||||
# as $USER, while retaining the environment variables defined and belonging
|
||||
# to secondary groups given above in usermod.
|
||||
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
||||
sudo -E su "${USER}" -c "ci/run_${CI_TARGET}.sh"
|
||||
else
|
||||
ci/run_${CI_TARGET}.sh
|
||||
fi
|
||||
|
||||
if [[ -s "${GCOV_ERROR_FILE}" ]]; then
|
||||
echo '=== Unexpected gcov errors: ==='
|
||||
|
@ -1,194 +0,0 @@
|
||||
{
|
||||
"ref": "refs/heads/master",
|
||||
"before": "66b136c43c12df3dcf8f19ff48f206ad2e4f43fc",
|
||||
"after": "1bf69c32217cc455603ce8aa2b5415d9717f0fa2",
|
||||
"repository": {
|
||||
"id": 292861950,
|
||||
"node_id": "MDEwOlJlcG9zaXRvcnkyOTI4NjE5NTA=",
|
||||
"name": "neovim-snap",
|
||||
"full_name": "hurricanehrndz/neovim-snap",
|
||||
"private": false,
|
||||
"owner": {
|
||||
"name": "hurricanehrndz",
|
||||
"email": "hurricanehrndz@users.noreply.github.com",
|
||||
"login": "hurricanehrndz",
|
||||
"id": 5804237,
|
||||
"node_id": "MDQ6VXNlcjU4MDQyMzc=",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/5804237?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/hurricanehrndz",
|
||||
"html_url": "https://github.com/hurricanehrndz",
|
||||
"followers_url": "https://api.github.com/users/hurricanehrndz/followers",
|
||||
"following_url": "https://api.github.com/users/hurricanehrndz/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/hurricanehrndz/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/hurricanehrndz/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/hurricanehrndz/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/hurricanehrndz/orgs",
|
||||
"repos_url": "https://api.github.com/users/hurricanehrndz/repos",
|
||||
"events_url": "https://api.github.com/users/hurricanehrndz/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/hurricanehrndz/received_events",
|
||||
"type": "User",
|
||||
"site_admin": false
|
||||
},
|
||||
"html_url": "https://github.com/hurricanehrndz/neovim-snap",
|
||||
"description": "snap build for neovim",
|
||||
"fork": false,
|
||||
"url": "https://github.com/hurricanehrndz/neovim-snap",
|
||||
"forks_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/forks",
|
||||
"keys_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/keys{/key_id}",
|
||||
"collaborators_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/collaborators{/collaborator}",
|
||||
"teams_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/teams",
|
||||
"hooks_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/hooks",
|
||||
"issue_events_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/issues/events{/number}",
|
||||
"events_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/events",
|
||||
"assignees_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/assignees{/user}",
|
||||
"branches_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/branches{/branch}",
|
||||
"tags_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/tags",
|
||||
"blobs_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/git/blobs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/git/tags{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/git/refs{/sha}",
|
||||
"trees_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/git/trees{/sha}",
|
||||
"statuses_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/statuses/{sha}",
|
||||
"languages_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/languages",
|
||||
"stargazers_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/stargazers",
|
||||
"contributors_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/contributors",
|
||||
"subscribers_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/subscription",
|
||||
"commits_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/commits{/sha}",
|
||||
"git_commits_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/git/commits{/sha}",
|
||||
"comments_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/comments{/number}",
|
||||
"issue_comment_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/issues/comments{/number}",
|
||||
"contents_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/contents/{+path}",
|
||||
"compare_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/compare/{base}...{head}",
|
||||
"merges_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/merges",
|
||||
"archive_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/{archive_format}{/ref}",
|
||||
"downloads_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/downloads",
|
||||
"issues_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/issues{/number}",
|
||||
"pulls_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/pulls{/number}",
|
||||
"milestones_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/milestones{/number}",
|
||||
"notifications_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/notifications{?since,all,participating}",
|
||||
"labels_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/labels{/name}",
|
||||
"releases_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/releases{/id}",
|
||||
"deployments_url": "https://api.github.com/repos/hurricanehrndz/neovim-snap/deployments",
|
||||
"created_at": 1599227980,
|
||||
"updated_at": "2020-09-04T14:02:38Z",
|
||||
"pushed_at": 1599228352,
|
||||
"git_url": "git://github.com/hurricanehrndz/neovim-snap.git",
|
||||
"ssh_url": "git@github.com:hurricanehrndz/neovim-snap.git",
|
||||
"clone_url": "https://github.com/hurricanehrndz/neovim-snap.git",
|
||||
"svn_url": "https://github.com/hurricanehrndz/neovim-snap",
|
||||
"homepage": null,
|
||||
"size": 0,
|
||||
"stargazers_count": 0,
|
||||
"watchers_count": 0,
|
||||
"language": null,
|
||||
"has_issues": true,
|
||||
"has_projects": true,
|
||||
"has_downloads": true,
|
||||
"has_wiki": true,
|
||||
"has_pages": false,
|
||||
"forks_count": 0,
|
||||
"mirror_url": null,
|
||||
"archived": false,
|
||||
"disabled": false,
|
||||
"open_issues_count": 0,
|
||||
"license": {
|
||||
"key": "mit",
|
||||
"name": "MIT License",
|
||||
"spdx_id": "MIT",
|
||||
"url": "https://api.github.com/licenses/mit",
|
||||
"node_id": "MDc6TGljZW5zZTEz"
|
||||
},
|
||||
"forks": 0,
|
||||
"open_issues": 0,
|
||||
"watchers": 0,
|
||||
"default_branch": "master",
|
||||
"stargazers": 0,
|
||||
"master_branch": "master"
|
||||
},
|
||||
"pusher": {
|
||||
"name": "hurricanehrndz",
|
||||
"email": "hurricanehrndz@users.noreply.github.com"
|
||||
},
|
||||
"sender": {
|
||||
"login": "hurricanehrndz",
|
||||
"id": 5804237,
|
||||
"node_id": "MDQ6VXNlcjU4MDQyMzc=",
|
||||
"avatar_url": "https://avatars0.githubusercontent.com/u/5804237?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/hurricanehrndz",
|
||||
"html_url": "https://github.com/hurricanehrndz",
|
||||
"followers_url": "https://api.github.com/users/hurricanehrndz/followers",
|
||||
"following_url": "https://api.github.com/users/hurricanehrndz/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/hurricanehrndz/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/hurricanehrndz/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/hurricanehrndz/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/hurricanehrndz/orgs",
|
||||
"repos_url": "https://api.github.com/users/hurricanehrndz/repos",
|
||||
"events_url": "https://api.github.com/users/hurricanehrndz/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/hurricanehrndz/received_events",
|
||||
"type": "User",
|
||||
"site_admin": false
|
||||
},
|
||||
"created": false,
|
||||
"deleted": false,
|
||||
"forced": false,
|
||||
"base_ref": null,
|
||||
"compare": "https://github.com/hurricanehrndz/neovim-snap/compare/66b136c43c12...1bf69c32217c",
|
||||
"commits": [
|
||||
{
|
||||
"id": "1bf69c32217cc455603ce8aa2b5415d9717f0fa2",
|
||||
"tree_id": "62ea83a2349be8c930c45fdc199f71b08bf5927e",
|
||||
"distinct": true,
|
||||
"message": "Build of latest tag",
|
||||
"timestamp": "2020-09-04T14:05:40Z",
|
||||
"url": "https://github.com/hurricanehrndz/neovim-snap/commit/1bf69c32217cc455603ce8aa2b5415d9717f0fa2",
|
||||
"author": {
|
||||
"name": "Carlos Hernandez",
|
||||
"email": "carlos@techbyte.ca",
|
||||
"username": "hurricanehrndz"
|
||||
},
|
||||
"committer": {
|
||||
"name": "Carlos Hernandez",
|
||||
"email": "carlos@techbyte.ca",
|
||||
"username": "hurricanehrndz"
|
||||
},
|
||||
"added": [
|
||||
|
||||
],
|
||||
"removed": [
|
||||
|
||||
],
|
||||
"modified": [
|
||||
"snap/snapcraft.yaml"
|
||||
]
|
||||
}
|
||||
],
|
||||
"head_commit": {
|
||||
"id": "1bf69c32217cc455603ce8aa2b5415d9717f0fa2",
|
||||
"tree_id": "62ea83a2349be8c930c45fdc199f71b08bf5927e",
|
||||
"distinct": true,
|
||||
"message": "Build of latest tag",
|
||||
"timestamp": "2020-09-04T14:05:40Z",
|
||||
"url": "https://github.com/hurricanehrndz/neovim-snap/commit/1bf69c32217cc455603ce8aa2b5415d9717f0fa2",
|
||||
"author": {
|
||||
"name": "Carlos Hernandez",
|
||||
"email": "carlos@techbyte.ca",
|
||||
"username": "hurricanehrndz"
|
||||
},
|
||||
"committer": {
|
||||
"name": "Carlos Hernandez",
|
||||
"email": "carlos@techbyte.ca",
|
||||
"username": "hurricanehrndz"
|
||||
},
|
||||
"added": [
|
||||
|
||||
],
|
||||
"removed": [
|
||||
|
||||
],
|
||||
"modified": [
|
||||
"snap/snapcraft.yaml"
|
||||
]
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
|
||||
RESULT_SNAP=$(find ./ -name "*.snap")
|
||||
|
||||
sudo snap install "$RESULT_SNAP" --dangerous --classic
|
||||
|
||||
/snap/bin/nvim --version
|
||||
|
||||
SHA256=$(sha256sum "$RESULT_SNAP")
|
||||
echo "SHA256: ${SHA256} ."
|
@ -1,39 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
SNAP_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
WEBHOOK_PAYLOAD="$(cat "${SNAP_DIR}/.snapcraft_payload")"
|
||||
PAYLOAD_SIG="${SECRET_SNAP_SIG}"
|
||||
|
||||
|
||||
snap_release_needed() {
|
||||
last_committed_tag="$(git tag -l --sort=refname|head -1)"
|
||||
last_snap_release="$(snap info nvim | awk '$1 == "latest/edge:" { print $2 }' | perl -lpe 's/v\d.\d.\d-//g')"
|
||||
git fetch -f --tags
|
||||
git checkout "${last_committed_tag}" 2> /dev/null
|
||||
last_git_release="$(git describe --first-parent 2> /dev/null | perl -lpe 's/v\d.\d.\d-//g')"
|
||||
|
||||
if [[ -z "$(echo $last_snap_release | perl -ne "print if /${last_git_release}.*/")" ]]; then
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
|
||||
trigger_snapcraft_webhook() {
|
||||
[[ -n "${PAYLOAD_SIG}" ]] || exit
|
||||
echo "Triggering new snap release via webhook..."
|
||||
curl -X POST \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Hub-Signature: sha1=${PAYLOAD_SIG}" \
|
||||
--data "${WEBHOOK_PAYLOAD}" \
|
||||
https://snapcraft.io/nvim/webhook/notify
|
||||
}
|
||||
|
||||
|
||||
if $(snap_release_needed); then
|
||||
echo "New snap release required"
|
||||
trigger_snapcraft_webhook
|
||||
fi
|
@ -1,11 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
sudo apt update
|
||||
sudo usermod -aG lxd $USER
|
||||
sudo /snap/bin/lxd.migrate -yes
|
||||
sudo /snap/bin/lxd waitready
|
||||
sudo /snap/bin/lxd init --auto
|
||||
|
@ -1,8 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
mkdir -p "$CI_BUILD_DIR/snaps-cache"
|
||||
sg lxd -c snapcraft
|
||||
|
Binary file not shown.
@ -15,7 +15,7 @@ find_path(LIBLUV_INCLUDE_DIR luv/luv.h
|
||||
PATHS ${PC_LIBLUV_INCLUDEDIR} ${PC_LIBLUV_INCLUDE_DIRS})
|
||||
|
||||
# Explicitly look for luv.so. #10407
|
||||
list(APPEND LIBLUV_NAMES luv_a luv libluv_a luv${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
list(APPEND LIBLUV_NAMES luv luv${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||
|
||||
find_library(LIBLUV_LIBRARY NAMES ${LIBLUV_NAMES}
|
||||
HINTS ${PC_LIBLUV_LIBDIR} ${PC_LIBLUV_LIBRARY_DIRS})
|
||||
|
@ -75,14 +75,6 @@ if(WIN32)
|
||||
list(APPEND LIBUV_LIBRARIES ws2_32)
|
||||
endif()
|
||||
|
||||
find_package(Threads)
|
||||
if(Threads_FOUND)
|
||||
# TODO: Fix the cmake file to properly handle static deps for bundled builds.
|
||||
# Meanwhile just include the threads library if CMake tells us there's one to
|
||||
# use.
|
||||
list(APPEND LIBUV_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set LIBUV_FOUND to TRUE
|
||||
|
@ -42,7 +42,7 @@ unset(_lua_append_versions)
|
||||
|
||||
# this is a function only to have all the variables inside go away automatically
|
||||
function(_lua_set_version_vars)
|
||||
set(LUA_VERSIONS5 5.4 5.3 5.2 5.1 5.0)
|
||||
set(LUA_VERSIONS5 5.3 5.2 5.1 5.0)
|
||||
|
||||
if (Lua_FIND_VERSION_EXACT)
|
||||
if (Lua_FIND_VERSION_COUNT GREATER 1)
|
||||
|
@ -1,11 +0,0 @@
|
||||
# - Try to find tree-sitter
|
||||
# Once done, this will define
|
||||
#
|
||||
# TreeSitter_FOUND - system has tree-sitter
|
||||
# TreeSitter_INCLUDE_DIRS - the tree-sitter include directories
|
||||
# TreeSitter_LIBRARIES - link these to use tree-sitter
|
||||
|
||||
include(LibFindMacros)
|
||||
|
||||
libfind_pkg_detect(TreeSitter tree-sitter FIND_PATH tree_sitter/api.h FIND_LIBRARY tree-sitter)
|
||||
libfind_process(TreeSitter)
|
@ -3,13 +3,6 @@ function(get_compile_flags _compile_flags)
|
||||
set(compile_flags "<CMAKE_C_COMPILER> <CFLAGS> <BUILD_TYPE_CFLAGS> <COMPILE_OPTIONS><COMPILE_DEFINITIONS> <INCLUDES>")
|
||||
|
||||
# Get C compiler.
|
||||
if(CMAKE_C_COMPILER_ARG1)
|
||||
string(REPLACE
|
||||
"<CMAKE_C_COMPILER>"
|
||||
"<CMAKE_C_COMPILER> ${CMAKE_C_COMPILER_ARG1}"
|
||||
compile_flags
|
||||
"${compile_flags}")
|
||||
endif()
|
||||
string(REPLACE
|
||||
"<CMAKE_C_COMPILER>"
|
||||
"${CMAKE_C_COMPILER}"
|
||||
|
180
cmake/GetGitRevisionDescription.cmake
Normal file
180
cmake/GetGitRevisionDescription.cmake
Normal file
@ -0,0 +1,180 @@
|
||||
# https://github.com/rpavlik/cmake-modules
|
||||
#
|
||||
# - Returns a version string from Git
|
||||
#
|
||||
# These functions force a re-configure on each git commit so that you can
|
||||
# trust the values of the variables in your build system.
|
||||
#
|
||||
# get_git_head_revision(<refspecvar> <hashvar> [<additional arguments to git describe> ...])
|
||||
#
|
||||
# Returns the refspec and sha hash of the current head revision
|
||||
#
|
||||
# git_describe(<var> [<additional arguments to git describe> ...])
|
||||
#
|
||||
# Returns the results of git describe on the source tree, and adjusting
|
||||
# the output so that it tests false if an error occurs.
|
||||
#
|
||||
# git_get_exact_tag(<var> [<additional arguments to git describe> ...])
|
||||
#
|
||||
# Returns the results of git describe --exact-match on the source tree,
|
||||
# and adjusting the output so that it tests false if there was no exact
|
||||
# matching tag.
|
||||
#
|
||||
# Requires CMake 2.6 or newer (uses the 'function' command)
|
||||
#
|
||||
# Original Author:
|
||||
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
|
||||
# http://academic.cleardefinition.com
|
||||
# Iowa State University HCI Graduate Program/VRAC
|
||||
#
|
||||
# Copyright Iowa State University 2009-2010.
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
if(__get_git_revision_description)
|
||||
return()
|
||||
endif()
|
||||
set(__get_git_revision_description YES)
|
||||
|
||||
# We must run the following at "include" time, not at function call time,
|
||||
# to find the path to this module rather than the path to a calling list file
|
||||
get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)
|
||||
|
||||
function(get_git_dir _gitdir)
|
||||
# check FORCED_GIT_DIR first
|
||||
if(FORCED_GIT_DIR)
|
||||
set(${_gitdir} ${FORCED_GIT_DIR} PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# check GIT_DIR in environment
|
||||
set(GIT_DIR $ENV{GIT_DIR})
|
||||
if(NOT GIT_DIR)
|
||||
set(GIT_PARENT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
set(GIT_DIR ${GIT_PARENT_DIR}/.git)
|
||||
endif()
|
||||
# .git dir not found, search parent directories
|
||||
while(NOT EXISTS ${GIT_DIR})
|
||||
set(GIT_PREVIOUS_PARENT ${GIT_PARENT_DIR})
|
||||
get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH)
|
||||
if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT)
|
||||
return()
|
||||
endif()
|
||||
set(GIT_DIR ${GIT_PARENT_DIR}/.git)
|
||||
endwhile()
|
||||
# check if this is a submodule
|
||||
if(NOT IS_DIRECTORY ${GIT_DIR})
|
||||
file(READ ${GIT_DIR} submodule)
|
||||
string(REGEX REPLACE "gitdir: (.*)\n$" "\\1" GIT_DIR_RELATIVE ${submodule})
|
||||
get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH)
|
||||
get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} ABSOLUTE)
|
||||
endif()
|
||||
set(${_gitdir} ${GIT_DIR} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(get_git_head_revision _refspecvar _hashvar)
|
||||
get_git_dir(GIT_DIR)
|
||||
if(NOT GIT_DIR)
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(GIT_DATA ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data)
|
||||
if(NOT EXISTS ${GIT_DATA})
|
||||
file(MAKE_DIRECTORY ${GIT_DATA})
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS ${GIT_DIR}/HEAD)
|
||||
return()
|
||||
endif()
|
||||
set(HEAD_FILE ${GIT_DATA}/HEAD)
|
||||
configure_file(${GIT_DIR}/HEAD ${HEAD_FILE} COPYONLY)
|
||||
|
||||
configure_file(${_gitdescmoddir}/GetGitRevisionDescription.cmake.in
|
||||
${GIT_DATA}/grabRef.cmake
|
||||
@ONLY)
|
||||
include(${GIT_DATA}/grabRef.cmake)
|
||||
|
||||
set(${_refspecvar} ${HEAD_REF} PARENT_SCOPE)
|
||||
set(${_hashvar} ${HEAD_HASH} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(git_describe _var)
|
||||
get_git_dir(GIT_DIR)
|
||||
if(NOT GIT_DIR)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT GIT_FOUND)
|
||||
find_package(Git QUIET)
|
||||
endif()
|
||||
if(NOT GIT_FOUND)
|
||||
set(${_var} "GIT-NOTFOUND" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
get_git_head_revision(refspec hash)
|
||||
if(NOT hash)
|
||||
set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND
|
||||
${GIT_EXECUTABLE}
|
||||
describe
|
||||
${hash}
|
||||
${ARGN}
|
||||
WORKING_DIRECTORY
|
||||
${GIT_DIR}
|
||||
RESULT_VARIABLE
|
||||
res
|
||||
OUTPUT_VARIABLE
|
||||
out
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(NOT res EQUAL 0)
|
||||
set(out "${out}-${res}-NOTFOUND")
|
||||
endif()
|
||||
|
||||
set(${_var} ${out} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(git_timestamp _var)
|
||||
get_git_dir(GIT_DIR)
|
||||
if(NOT GIT_DIR)
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(NOT GIT_FOUND)
|
||||
find_package(Git QUIET)
|
||||
endif()
|
||||
if(NOT GIT_FOUND)
|
||||
return()
|
||||
endif()
|
||||
|
||||
get_git_head_revision(refspec hash)
|
||||
if(NOT hash)
|
||||
set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --format="%ci" ${hash} ${ARGN}
|
||||
WORKING_DIRECTORY ${GIT_DIR}
|
||||
RESULT_VARIABLE res
|
||||
OUTPUT_VARIABLE out
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(res EQUAL 0)
|
||||
string(REGEX REPLACE "[-\" :]" "" out ${out})
|
||||
string(SUBSTRING ${out} 0 12 out)
|
||||
else()
|
||||
set(out "${out}-${res}-NOTFOUND")
|
||||
endif()
|
||||
|
||||
set(${_var} ${out} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(git_get_exact_tag _var)
|
||||
git_describe(out --exact-match ${ARGN})
|
||||
set(${_var} ${out} PARENT_SCOPE)
|
||||
endfunction()
|
38
cmake/GetGitRevisionDescription.cmake.in
Normal file
38
cmake/GetGitRevisionDescription.cmake.in
Normal file
@ -0,0 +1,38 @@
|
||||
#
|
||||
# Internal file for GetGitRevisionDescription.cmake
|
||||
#
|
||||
# Requires CMake 2.6 or newer (uses the 'function' command)
|
||||
#
|
||||
# Original Author:
|
||||
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
|
||||
# http://academic.cleardefinition.com
|
||||
# Iowa State University HCI Graduate Program/VRAC
|
||||
#
|
||||
# Copyright Iowa State University 2009-2010.
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
set(HEAD_HASH)
|
||||
|
||||
file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024)
|
||||
|
||||
string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS)
|
||||
if(HEAD_CONTENTS MATCHES "ref")
|
||||
# named branch
|
||||
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
|
||||
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
|
||||
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
|
||||
elseif(EXISTS "@GIT_DIR@/logs/${HEAD_REF}")
|
||||
configure_file("@GIT_DIR@/logs/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
|
||||
set(HEAD_HASH "${HEAD_REF}")
|
||||
endif()
|
||||
else()
|
||||
# detached HEAD
|
||||
configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
|
||||
endif()
|
||||
|
||||
if(NOT HEAD_HASH)
|
||||
file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
|
||||
string(STRIP "${HEAD_HASH}" HEAD_HASH)
|
||||
endif()
|
@ -154,25 +154,3 @@ function(install_helper)
|
||||
${RENAME})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Without CONFIGURE_DEPENDS globbing reuses cached file tree on rebuild.
|
||||
# For example it will ignore new files.
|
||||
# CONFIGURE_DEPENDS was introduced in 3.12
|
||||
|
||||
function(glob_wrapper outvar)
|
||||
if(${CMAKE_VERSION} VERSION_LESS 3.12)
|
||||
file(GLOB ${outvar} ${ARGN})
|
||||
else()
|
||||
file(GLOB ${outvar} CONFIGURE_DEPENDS ${ARGN})
|
||||
endif()
|
||||
set(${outvar} ${${outvar}} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(globrecurse_wrapper outvar root)
|
||||
if(${CMAKE_VERSION} VERSION_LESS 3.12)
|
||||
file(GLOB_RECURSE ${outvar} RELATIVE ${root} ${ARGN})
|
||||
else()
|
||||
file(GLOB_RECURSE ${outvar} CONFIGURE_DEPENDS RELATIVE ${root} ${ARGN})
|
||||
endif()
|
||||
set(${outvar} ${${outvar}} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
@ -10,7 +10,6 @@ set(ENV{VIMRUNTIME} ${WORKING_DIR}/runtime)
|
||||
set(ENV{NVIM_RPLUGIN_MANIFEST} ${BUILD_DIR}/Xtest_rplugin_manifest)
|
||||
set(ENV{XDG_CONFIG_HOME} ${BUILD_DIR}/Xtest_xdg/config)
|
||||
set(ENV{XDG_DATA_HOME} ${BUILD_DIR}/Xtest_xdg/share)
|
||||
unset(ENV{XDG_DATA_DIRS})
|
||||
|
||||
if(NOT DEFINED ENV{NVIM_LOG_FILE})
|
||||
set(ENV{NVIM_LOG_FILE} ${BUILD_DIR}/.nvimlog)
|
||||
@ -46,21 +45,10 @@ if(DEFINED ENV{TEST_FILTER} AND NOT "$ENV{TEST_FILTER}" STREQUAL "")
|
||||
list(APPEND BUSTED_ARGS --filter $ENV{TEST_FILTER})
|
||||
endif()
|
||||
|
||||
if(DEFINED ENV{TEST_FILTER_OUT} AND NOT "$ENV{TEST_FILTER_OUT}" STREQUAL "")
|
||||
list(APPEND BUSTED_ARGS --filter-out $ENV{TEST_FILTER_OUT})
|
||||
endif()
|
||||
|
||||
# TMPDIR: use relative test path (for parallel test runs / isolation).
|
||||
set(ENV{TMPDIR} "${BUILD_DIR}/Xtest_tmpdir/${TEST_PATH}")
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory $ENV{TMPDIR})
|
||||
|
||||
# HISTFILE: do not write into user's ~/.bash_history
|
||||
set(ENV{HISTFILE} "/dev/null")
|
||||
|
||||
if(NOT DEFINED ENV{TEST_TIMEOUT} OR "$ENV{TEST_TIMEOUT}" STREQUAL "")
|
||||
set(ENV{TEST_TIMEOUT} 1200)
|
||||
endif()
|
||||
|
||||
set(ENV{SYSTEM_NAME} ${CMAKE_HOST_SYSTEM_NAME}) # used by test/helpers.lua.
|
||||
execute_process(
|
||||
COMMAND ${BUSTED_PRG} -v -o test.busted.outputHandlers.${BUSTED_OUTPUT_TYPE}
|
||||
@ -70,7 +58,6 @@ execute_process(
|
||||
--lpath=?.lua
|
||||
${BUSTED_ARGS}
|
||||
${TEST_PATH}
|
||||
TIMEOUT $ENV{TEST_TIMEOUT}
|
||||
WORKING_DIRECTORY ${WORKING_DIR}
|
||||
ERROR_VARIABLE err
|
||||
RESULT_VARIABLE res
|
||||
|
@ -1,21 +0,0 @@
|
||||
if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
|
||||
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
|
||||
endif()
|
||||
|
||||
file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
|
||||
string(REGEX REPLACE "\n" ";" files "${files}")
|
||||
foreach(file ${files})
|
||||
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
|
||||
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||
exec_program(
|
||||
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
|
||||
OUTPUT_VARIABLE rm_out
|
||||
RETURN_VALUE rm_retval
|
||||
)
|
||||
if(NOT "${rm_retval}" STREQUAL 0)
|
||||
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
|
||||
endif()
|
||||
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
|
||||
endif()
|
||||
endforeach()
|
@ -12,6 +12,11 @@ check_type_size("size_t" SIZEOF_SIZE_T)
|
||||
check_type_size("long long" SIZEOF_LONG_LONG)
|
||||
check_type_size("void *" SIZEOF_VOID_PTR)
|
||||
|
||||
if (CMAKE_HOST_SYSTEM_VERSION MATCHES ".*-Microsoft")
|
||||
# Windows Subsystem for Linux
|
||||
set(HAVE_WSL 1)
|
||||
endif()
|
||||
|
||||
check_symbol_exists(_NSGetEnviron crt_externs.h HAVE__NSGETENVIRON)
|
||||
|
||||
# Headers
|
||||
@ -27,7 +32,6 @@ endif()
|
||||
check_include_files(sys/utsname.h HAVE_SYS_UTSNAME_H)
|
||||
check_include_files(termios.h HAVE_TERMIOS_H)
|
||||
check_include_files(sys/uio.h HAVE_SYS_UIO_H)
|
||||
check_include_files(sys/sdt.h HAVE_SYS_SDT_H)
|
||||
|
||||
# Functions
|
||||
check_function_exists(fseeko HAVE_FSEEKO)
|
||||
@ -45,23 +49,8 @@ check_function_exists(readlink HAVE_READLINK)
|
||||
check_function_exists(setpgid HAVE_SETPGID)
|
||||
check_function_exists(setsid HAVE_SETSID)
|
||||
check_function_exists(sigaction HAVE_SIGACTION)
|
||||
check_function_exists(strnlen HAVE_STRNLEN)
|
||||
check_function_exists(strcasecmp HAVE_STRCASECMP)
|
||||
check_function_exists(strncasecmp HAVE_STRNCASECMP)
|
||||
check_function_exists(strptime HAVE_STRPTIME)
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
|
||||
check_c_source_compiles("
|
||||
#include <termios.h>
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
return forkpty(0, NULL, NULL, NULL);
|
||||
}
|
||||
" HAVE_FORKPTY)
|
||||
else()
|
||||
set(HAVE_FORKPTY 1)
|
||||
endif()
|
||||
|
||||
# Symbols
|
||||
check_symbol_exists(FD_CLOEXEC "fcntl.h" HAVE_FD_CLOEXEC)
|
||||
@ -106,7 +95,7 @@ if (NOT "${HAVE_BE64TOH}")
|
||||
# any case and ORDER_BIG_ENDIAN will not be examined.
|
||||
# - CMAKE_CROSSCOMPILING *and* HAVE_BE64TOH are both false. In this case
|
||||
# be64toh function which uses cycle and arithmetic operations is used which
|
||||
# will work regardless of endianness. Function is sub-optimal though.
|
||||
# will work regardless of endianess. Function is sub-optimal though.
|
||||
check_c_source_runs("
|
||||
${SI}
|
||||
${MS}
|
||||
|
@ -30,18 +30,15 @@
|
||||
#cmakedefine HAVE_SETPGID
|
||||
#cmakedefine HAVE_SETSID
|
||||
#cmakedefine HAVE_SIGACTION
|
||||
#cmakedefine HAVE_STRNLEN
|
||||
#cmakedefine HAVE_STRCASECMP
|
||||
#cmakedefine HAVE_STRINGS_H
|
||||
#cmakedefine HAVE_STRNCASECMP
|
||||
#cmakedefine HAVE_STRPTIME
|
||||
#cmakedefine HAVE_SYS_SDT_H
|
||||
#cmakedefine HAVE_SYS_UTSNAME_H
|
||||
#cmakedefine HAVE_SYS_WAIT_H
|
||||
#cmakedefine HAVE_TERMIOS_H
|
||||
#cmakedefine HAVE_WORKING_LIBINTL
|
||||
#cmakedefine HAVE_WSL
|
||||
#cmakedefine UNIX
|
||||
#cmakedefine CASE_INSENSITIVE_FILENAME
|
||||
#cmakedefine USE_FNAME_CASE
|
||||
#cmakedefine HAVE_SYS_UIO_H
|
||||
#ifdef HAVE_SYS_UIO_H
|
||||
@ -50,7 +47,6 @@
|
||||
# undef HAVE_SYS_UIO_H
|
||||
# endif
|
||||
#endif
|
||||
#cmakedefine HAVE_FORKPTY
|
||||
|
||||
#cmakedefine FEAT_TUI
|
||||
|
||||
@ -64,6 +60,5 @@
|
||||
|
||||
#cmakedefine HAVE_EXECINFO_BACKTRACE
|
||||
#cmakedefine HAVE_BUILTIN_ADD_OVERFLOW
|
||||
#cmakedefine HAVE_WIMPLICIT_FALLTHROUGH_FLAG
|
||||
|
||||
#endif // AUTO_CONFIG_H
|
||||
|
@ -3,6 +3,5 @@
|
||||
#include "${PROJECT_SOURCE_DIR}/src/nvim/vim.h"
|
||||
char *default_vim_dir = "${CMAKE_INSTALL_FULL_DATAROOTDIR}/nvim";
|
||||
char *default_vimruntime_dir = "";
|
||||
char *default_lib_dir = "${CMAKE_INSTALL_FULL_LIBDIR}/nvim";
|
||||
char_u *compiled_user = (char_u *)"${USERNAME}";
|
||||
char_u *compiled_sys = (char_u *)"${HOSTNAME}";
|
||||
|
@ -5,11 +5,7 @@
|
||||
#define NVIM_VERSION_MINOR @NVIM_VERSION_MINOR@
|
||||
#define NVIM_VERSION_PATCH @NVIM_VERSION_PATCH@
|
||||
#define NVIM_VERSION_PRERELEASE "@NVIM_VERSION_PRERELEASE@"
|
||||
|
||||
#cmakedefine NVIM_VERSION_MEDIUM "@NVIM_VERSION_MEDIUM@"
|
||||
#ifndef NVIM_VERSION_MEDIUM
|
||||
# include "auto/versiondef_git.h"
|
||||
#endif
|
||||
|
||||
#define NVIM_API_LEVEL @NVIM_API_LEVEL@
|
||||
#define NVIM_API_LEVEL_COMPAT @NVIM_API_LEVEL_COMPAT@
|
||||
|
43
contrib/flake.lock
generated
43
contrib/flake.lock
generated
@ -1,43 +0,0 @@
|
||||
{
|
||||
"nodes": {
|
||||
"flake-utils": {
|
||||
"locked": {
|
||||
"lastModified": 1644229661,
|
||||
"narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1646254136,
|
||||
"narHash": "sha256-8nQx02tTzgYO21BP/dy5BCRopE8OwE8Drsw98j+Qoaw=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "3e072546ea98db00c2364b81491b893673267827",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
@ -1,133 +0,0 @@
|
||||
{
|
||||
description = "Neovim flake";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
{
|
||||
overlay = final: prev:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${prev.system};
|
||||
in
|
||||
rec {
|
||||
neovim = pkgs.neovim-unwrapped.overrideAttrs (oa: {
|
||||
version = "master";
|
||||
src = ../.;
|
||||
});
|
||||
|
||||
# a development binary to help debug issues
|
||||
neovim-debug = let
|
||||
stdenv = if pkgs.stdenv.isLinux then pkgs.llvmPackages_latest.stdenv else pkgs.stdenv;
|
||||
in
|
||||
((neovim.override {
|
||||
lua = pkgs.luajit;
|
||||
inherit stdenv;
|
||||
}).overrideAttrs (oa: {
|
||||
|
||||
dontStrip = true;
|
||||
NIX_CFLAGS_COMPILE = " -ggdb -Og";
|
||||
|
||||
cmakeBuildType = "Debug";
|
||||
cmakeFlags = oa.cmakeFlags ++ [
|
||||
"-DMIN_LOG_LEVEL=0"
|
||||
];
|
||||
|
||||
disallowedReferences = [];
|
||||
}));
|
||||
|
||||
# for neovim developers, beware of the slow binary
|
||||
neovim-developer =
|
||||
let
|
||||
lib = nixpkgs.lib;
|
||||
luacheck = pkgs.luaPackages.luacheck;
|
||||
in
|
||||
(neovim-debug.override ({ doCheck = pkgs.stdenv.isLinux; })).overrideAttrs (oa: {
|
||||
cmakeFlags = oa.cmakeFlags ++ [
|
||||
"-DLUACHECK_PRG=${luacheck}/bin/luacheck"
|
||||
"-DMIN_LOG_LEVEL=0"
|
||||
"-DENABLE_LTO=OFF"
|
||||
] ++ pkgs.lib.optionals pkgs.stdenv.isLinux [
|
||||
# https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
|
||||
# https://clang.llvm.org/docs/AddressSanitizer.html#symbolizing-the-reports
|
||||
"-DCLANG_ASAN_UBSAN=ON"
|
||||
];
|
||||
});
|
||||
};
|
||||
} //
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
overlays = [ self.overlay ];
|
||||
inherit system;
|
||||
};
|
||||
|
||||
pythonEnv = pkgs.python3.withPackages(ps: [
|
||||
ps.msgpack
|
||||
ps.flake8 # for 'make pylint'
|
||||
]);
|
||||
in
|
||||
rec {
|
||||
|
||||
packages = with pkgs; {
|
||||
inherit neovim neovim-debug neovim-developer;
|
||||
};
|
||||
|
||||
checks = {
|
||||
pylint = pkgs.runCommandNoCC "pylint" {
|
||||
nativeBuildInputs = [ pythonEnv ];
|
||||
preferLocalBuild = true;
|
||||
} "make -C ${./..} pylint > $out";
|
||||
|
||||
shlint = pkgs.runCommandNoCC "shlint" {
|
||||
nativeBuildInputs = [ pkgs.shellcheck ];
|
||||
preferLocalBuild = true;
|
||||
} "make -C ${./..} shlint > $out";
|
||||
};
|
||||
|
||||
defaultPackage = pkgs.neovim;
|
||||
|
||||
apps = {
|
||||
nvim = flake-utils.lib.mkApp { drv = pkgs.neovim; name = "nvim"; };
|
||||
nvim-debug = flake-utils.lib.mkApp { drv = pkgs.neovim-debug; name = "nvim"; };
|
||||
};
|
||||
|
||||
defaultApp = apps.nvim;
|
||||
|
||||
devShell = let
|
||||
in
|
||||
pkgs.neovim-developer.overrideAttrs(oa: {
|
||||
|
||||
buildInputs = with pkgs; oa.buildInputs ++ [
|
||||
cmake
|
||||
pythonEnv
|
||||
include-what-you-use # for scripts/check-includes.py
|
||||
jq # jq for scripts/vim-patch.sh -r
|
||||
shellcheck # for `make shlint`
|
||||
doxygen # for script/gen_vimdoc.py
|
||||
clang-tools # for clangd to find the correct headers
|
||||
];
|
||||
|
||||
shellHook = oa.shellHook + ''
|
||||
export NVIM_PYTHON_LOG_LEVEL=DEBUG
|
||||
export NVIM_LOG_FILE=/tmp/nvim.log
|
||||
export ASAN_SYMBOLIZER_PATH=${pkgs.llvm_11}/bin/llvm-symbolizer
|
||||
|
||||
# ASAN_OPTIONS=detect_leaks=1
|
||||
export ASAN_OPTIONS="log_path=./test.log:abort_on_error=1"
|
||||
export UBSAN_OPTIONS=print_stacktrace=1
|
||||
mkdir -p build/runtime/parser
|
||||
# nvim looks into CMAKE_INSTALL_DIR. Hack to avoid errors
|
||||
# when running the functionaltests
|
||||
mkdir -p outputs/out/share/nvim/syntax
|
||||
touch outputs/out/share/nvim/syntax/syntax.vim
|
||||
|
||||
# for treesitter functionaltests
|
||||
mkdir -p runtime/parser
|
||||
cp -f ${pkgs.tree-sitter.builtGrammars.tree-sitter-c}/parser runtime/parser/c.so
|
||||
'';
|
||||
});
|
||||
});
|
||||
}
|
@ -25,12 +25,6 @@
|
||||
#
|
||||
# CMAKE_BUILD_TYPE := Debug
|
||||
|
||||
# With non-Debug builds interprocedural optimization (IPO) (which includes
|
||||
# link-time optimization (LTO)) is enabled by default, which causes the link
|
||||
# step to take a significant amount of time, which is relevant when building
|
||||
# often. You can disable it explicitly:
|
||||
# CMAKE_EXTRA_FLAGS += -DENABLE_LTO=OFF
|
||||
|
||||
# Log levels: 0 (DEBUG), 1 (INFO), 2 (WARNING), 3 (ERROR)
|
||||
# Default is 1 (INFO) unless CMAKE_BUILD_TYPE is Release or RelWithDebInfo.
|
||||
# CMAKE_EXTRA_FLAGS += -DMIN_LOG_LEVEL=1
|
||||
@ -48,7 +42,6 @@
|
||||
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_LUAROCKS=OFF
|
||||
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_MSGPACK=OFF
|
||||
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_UNIBILIUM=OFF
|
||||
# DEPS_CMAKE_FLAGS += -DUSE_BUNDLED_UTF8PROC=OFF
|
||||
#
|
||||
# Or disable all bundled dependencies at once.
|
||||
#
|
||||
|
@ -1,23 +0,0 @@
|
||||
{
|
||||
"runtime.version": "LuaJIT",
|
||||
"diagnostics": {
|
||||
"enable": true,
|
||||
"globals": [
|
||||
"vim",
|
||||
"describe",
|
||||
"it",
|
||||
"before_each",
|
||||
"after_each",
|
||||
"setup",
|
||||
"teardown"
|
||||
]
|
||||
},
|
||||
"workspace": {
|
||||
"library": {
|
||||
"runtime/lua": true
|
||||
},
|
||||
"maxPreload": 2000,
|
||||
"preloadFileSize": 1000
|
||||
},
|
||||
"telemetry.enable": false
|
||||
}
|
1578
contrib/uncrustify.cfg
Normal file
1578
contrib/uncrustify.cfg
Normal file
File diff suppressed because it is too large
Load Diff
14
man/nvim.1
14
man/nvim.1
@ -100,7 +100,7 @@ Useful for scripting because it does NOT start a UI, unlike
|
||||
.Ic :help silent-mode
|
||||
.It Fl d
|
||||
Diff mode.
|
||||
Show the difference between two to eight files, similar to
|
||||
Show the difference between two to four files, similar to
|
||||
.Xr sdiff 1 .
|
||||
.Ic ":help diff"
|
||||
.It Fl R
|
||||
@ -113,6 +113,9 @@ associated with a file.
|
||||
To overwrite a file, add an exclamation mark to the relevant Ex command, such as
|
||||
.Ic :w! .
|
||||
.Ic ":help 'readonly'"
|
||||
.It Fl Z
|
||||
Restricted mode.
|
||||
Disable commands that make use of an external shell.
|
||||
.It Fl m
|
||||
Resets the 'write' option, to disable file modifications.
|
||||
Writing to a file is disabled, but buffers can still be modified.
|
||||
@ -177,7 +180,8 @@ If
|
||||
.Ar vimrc
|
||||
is
|
||||
.Cm NORC ,
|
||||
do not load any initialization files (except plugins).
|
||||
do not load any initialization files (except plugins),
|
||||
and do not attempt to parse environment variables.
|
||||
If
|
||||
.Ar vimrc
|
||||
is
|
||||
@ -200,7 +204,7 @@ Skip loading plugins.
|
||||
Implied by
|
||||
.Cm -u NONE .
|
||||
.It Fl -clean
|
||||
Mimic a fresh install of Nvim. Skip loading non-builtin plugins and shada (viminfo) file.
|
||||
Skip loading plugins and shada (viminfo) file.
|
||||
.It Fl o Ns Op Ar N
|
||||
Open
|
||||
.Ar N
|
||||
@ -326,7 +330,7 @@ Print version information and exit.
|
||||
.Sh ENVIRONMENT
|
||||
.Bl -tag -width Fl
|
||||
.It Ev NVIM_LOG_FILE
|
||||
Low-level log file, usually found at ~/.cache/nvim/log.
|
||||
Low-level log file, usually found at ~/.local/share/nvim/log.
|
||||
:help $NVIM_LOG_FILE
|
||||
.It Ev VIM
|
||||
Used to locate user files, such as init.vim.
|
||||
@ -374,7 +378,7 @@ See also
|
||||
System-global
|
||||
.Nm
|
||||
configuration file.
|
||||
.It Pa $VIM
|
||||
.It Pa /usr/local/share/nvim
|
||||
System-global
|
||||
.Nm
|
||||
runtime directory.
|
||||
|
@ -1,64 +0,0 @@
|
||||
set(CPACK_PACKAGE_NAME "Neovim")
|
||||
set(CPACK_PACKAGE_VENDOR "neovim.io")
|
||||
set(CPACK_PACKAGE_FILE_NAME "nvim")
|
||||
|
||||
# From the GitHub About section
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Vim-fork focused on extensibility and usability.")
|
||||
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
|
||||
|
||||
# Pull the versions defined with the top level CMakeLists.txt
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR ${NVIM_VERSION_MAJOR})
|
||||
set(CPACK_PACKAGE_VERSION_MINOR ${NVIM_VERSION_MINOR})
|
||||
set(CPACK_PACKAGE_VERSION_PATCH ${NVIM_VERSION_PATCH})
|
||||
|
||||
# CPACK_VERBATIM_VARIABLES ensures that the variables prefixed with *CPACK_*
|
||||
# are correctly passed to the cpack program.
|
||||
# This should always be set to true.
|
||||
set(CPACK_VERBATIM_VARIABLES TRUE)
|
||||
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.txt")
|
||||
set(CPACK_RESOURCE_FILE_README ${PROJECT_SOURCE_DIR}/README.md)
|
||||
|
||||
|
||||
if(WIN32)
|
||||
set(CPACK_PACKAGE_FILE_NAME "nvim-win64")
|
||||
set(CPACK_GENERATOR ZIP WIX)
|
||||
|
||||
# WIX
|
||||
# CPACK_WIX_UPGRADE_GUID should be set, but should never change.
|
||||
# CPACK_WIX_PRODUCT_GUID should not be set (leave as default to auto-generate).
|
||||
|
||||
# The following guid is just a randomly generated guid that's been pasted here.
|
||||
# It has no special meaning other than to supply it to WIX.
|
||||
set(CPACK_WIX_UPGRADE_GUID "207A1A70-7B0C-418A-A153-CA6883E38F4D")
|
||||
set(CPACK_WIX_PRODUCT_ICON ${CMAKE_CURRENT_LIST_DIR}/neovim.ico)
|
||||
|
||||
# We use a wix patch to add further options to the installer. At present, it's just to add neovim to the path
|
||||
# on installation, however, it can be extended.
|
||||
# See: https://cmake.org/cmake/help/v3.7/module/CPackWIX.html#variable:CPACK_WIX_PATCH_FILE
|
||||
list(APPEND CPACK_WIX_EXTENSIONS WixUtilExtension)
|
||||
list(APPEND CPACK_WIX_PATCH_FILE ${CMAKE_CURRENT_LIST_DIR}/WixPatch.xml)
|
||||
elseif(APPLE)
|
||||
set(CPACK_PACKAGE_FILE_NAME "nvim-macos")
|
||||
set(CPACK_GENERATOR TGZ)
|
||||
set(CPACK_PACKAGE_ICON ${CMAKE_CURRENT_LIST_DIR}/neovim.icns)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
set(CPACK_PACKAGE_FILE_NAME "nvim-linux64")
|
||||
set(CPACK_GENERATOR TGZ DEB)
|
||||
set(CPACK_DEBIAN_PACKAGE_NAME "Neovim") # required
|
||||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Neovim.io") # required
|
||||
|
||||
# Automatically compute required shared lib dependencies.
|
||||
# Unfortunately, you "just need to know" that this has a hidden
|
||||
# dependency on dpkg-shlibdeps whilst using a debian based host.
|
||||
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS TRUE)
|
||||
else()
|
||||
set(CPACK_GENERATOR TGZ)
|
||||
endif()
|
||||
|
||||
# CPack variables are loaded in on the call to include(CPack). If you set
|
||||
# variables *after* the inclusion, they don't get updated within the CPack
|
||||
# config. Note that some CPack commands should still be run after it, such
|
||||
# as cpack_add_component().
|
||||
include(CPack)
|
@ -1,16 +0,0 @@
|
||||
<CPackWiXPatch>
|
||||
<!-- Fragment ID is from: <your build dir>/_CPack_Packages/win64/WIX/files.wxs -->
|
||||
<CPackWiXFragment Id="CM_CP_bin.nvim.exe">
|
||||
<!-- Note: if we were to specify Value='[INSTALL_ROOT]\bin' - with a backslash, the installer will still
|
||||
use a forward slash in the path. -->
|
||||
<Environment
|
||||
Id='UpdatePath'
|
||||
Name='PATH'
|
||||
Action='set'
|
||||
Permanent='no'
|
||||
System='yes'
|
||||
Part='last'
|
||||
Value='[INSTALL_ROOT]/bin'
|
||||
/>
|
||||
</CPackWiXFragment>
|
||||
</CPackWiXPatch>
|
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 120 KiB |
Binary file not shown.
Before Width: | Height: | Size: 6.6 KiB |
@ -1,147 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:sketch="http://www.bohemiancoding.com/sketch/ns"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="256"
|
||||
height="256"
|
||||
viewBox="0 0 256 256"
|
||||
version="1.1"
|
||||
id="svg4612"
|
||||
sodipodi:docname="neovim.svg"
|
||||
inkscape:version="0.92.4 5da689c313, 2019-01-14">
|
||||
<metadata
|
||||
id="metadata4616">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title>neovim-mark@2x</dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="2560"
|
||||
inkscape:window-height="1333"
|
||||
id="namedview4614"
|
||||
showgrid="false"
|
||||
inkscape:zoom="2.1945358"
|
||||
inkscape:cx="132.84232"
|
||||
inkscape:cy="196.34741"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="34"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg4612" />
|
||||
<title
|
||||
id="title4587">neovim-mark@2x</title>
|
||||
<description>Created with Sketch (http://www.bohemiancoding.com/sketch)</description>
|
||||
<defs
|
||||
id="defs4604">
|
||||
<linearGradient
|
||||
x1="167.95833"
|
||||
y1="-0.46142399"
|
||||
x2="167.95833"
|
||||
y2="335.45523"
|
||||
id="linearGradient-1"
|
||||
gradientTransform="scale(0.46142398,2.1672042)"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop
|
||||
stop-color="#16B0ED"
|
||||
stop-opacity="0.800235524"
|
||||
offset="0%"
|
||||
id="stop4589" />
|
||||
<stop
|
||||
stop-color="#0F59B2"
|
||||
stop-opacity="0.83700023"
|
||||
offset="100%"
|
||||
id="stop4591" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
x1="1118.3427"
|
||||
y1="-0.46586797"
|
||||
x2="1118.3427"
|
||||
y2="338.68604"
|
||||
id="linearGradient-2"
|
||||
gradientTransform="scale(0.46586797,2.1465309)"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop
|
||||
stop-color="#7DB643"
|
||||
offset="0%"
|
||||
id="stop4594" />
|
||||
<stop
|
||||
stop-color="#367533"
|
||||
offset="100%"
|
||||
id="stop4596" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
x1="356.33795"
|
||||
y1="0"
|
||||
x2="356.33795"
|
||||
y2="612.90131"
|
||||
id="linearGradient-3"
|
||||
gradientTransform="scale(0.84189739,1.1877932)"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop
|
||||
stop-color="#88C649"
|
||||
stop-opacity="0.8"
|
||||
offset="0%"
|
||||
id="stop4599" />
|
||||
<stop
|
||||
stop-color="#439240"
|
||||
stop-opacity="0.84"
|
||||
offset="100%"
|
||||
id="stop4601" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g
|
||||
id="Page-1"
|
||||
sketch:type="MSPage"
|
||||
style="fill:none;fill-rule:evenodd;stroke:none;stroke-width:1"
|
||||
transform="matrix(0.34367476,0,0,0.34367476,25.312651,1.7737533)">
|
||||
<g
|
||||
id="mark-copy"
|
||||
sketch:type="MSLayerGroup"
|
||||
transform="translate(2,3)">
|
||||
<path
|
||||
d="M 0,155.5704 155,-1 V 727 L 0,572.23792 Z"
|
||||
id="Left---green"
|
||||
sketch:type="MSShapeGroup"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:url(#linearGradient-1)" />
|
||||
<path
|
||||
d="M 443.0604,156.9824 600,-1 596.81879,727 442,572.21994 Z"
|
||||
id="Right---blue"
|
||||
sketch:type="MSShapeGroup"
|
||||
transform="matrix(-1,0,0,1,1042,0)"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:url(#linearGradient-2)" />
|
||||
<path
|
||||
d="M 154.98629,0 558,615.1897 445.2246,728 42,114.17202 Z"
|
||||
id="Cross---blue"
|
||||
sketch:type="MSShapeGroup"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:url(#linearGradient-3)" />
|
||||
<path
|
||||
d="M 155,283.83232 154.78675,308 31,124.71061 42.461949,113 Z"
|
||||
id="Shadow"
|
||||
sketch:type="MSShapeGroup"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000;fill-opacity:0.12999998" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 4.3 KiB |
@ -21,12 +21,12 @@ add_custom_command(OUTPUT ${GENERATED_SYN_VIM}
|
||||
${FUNCS_DATA}
|
||||
)
|
||||
|
||||
glob_wrapper(PACKAGES ${PROJECT_SOURCE_DIR}/runtime/pack/dist/opt/*)
|
||||
file(GLOB PACKAGES ${PROJECT_SOURCE_DIR}/runtime/pack/dist/opt/*)
|
||||
|
||||
set(GENERATED_PACKAGE_TAGS)
|
||||
foreach(PACKAGE ${PACKAGES})
|
||||
get_filename_component(PACKNAME ${PACKAGE} NAME)
|
||||
glob_wrapper("${PACKNAME}_DOC_FILES" ${PACKAGE}/doc/*.txt)
|
||||
file(GLOB "${PACKNAME}_DOC_FILES" ${PACKAGE}/doc/*.txt)
|
||||
if(${PACKNAME}_DOC_FILES)
|
||||
file(MAKE_DIRECTORY ${GENERATED_PACKAGE_DIR}/${PACKNAME})
|
||||
add_custom_command(OUTPUT "${GENERATED_PACKAGE_DIR}/${PACKNAME}/doc/tags"
|
||||
@ -54,7 +54,7 @@ foreach(PACKAGE ${PACKAGES})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
glob_wrapper(DOCFILES ${PROJECT_SOURCE_DIR}/runtime/doc/*.txt)
|
||||
file(GLOB DOCFILES ${PROJECT_SOURCE_DIR}/runtime/doc/*.txt)
|
||||
|
||||
set(BUILDDOCFILES)
|
||||
foreach(DF ${DOCFILES})
|
||||
@ -111,10 +111,12 @@ if(NOT APPLE)
|
||||
|
||||
install_helper(
|
||||
FILES ${CMAKE_CURRENT_SOURCE_DIR}/nvim.png
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps)
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pixmaps)
|
||||
endif()
|
||||
|
||||
globrecurse_wrapper(RUNTIME_PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR} *.awk *.sh *.bat)
|
||||
file(GLOB_RECURSE RUNTIME_PROGRAMS
|
||||
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
*.awk *.sh *.bat)
|
||||
|
||||
foreach(PROG ${RUNTIME_PROGRAMS})
|
||||
get_filename_component(BASEDIR ${PROG} PATH)
|
||||
@ -122,7 +124,9 @@ foreach(PROG ${RUNTIME_PROGRAMS})
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/${BASEDIR})
|
||||
endforeach()
|
||||
|
||||
globrecurse_wrapper(RUNTIME_FILES ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
file(GLOB_RECURSE RUNTIME_FILES
|
||||
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
rgb.txt
|
||||
*.vim *.lua *.dict *.py *.rb *.ps *.spl *.tutor *.tutor.json)
|
||||
|
||||
foreach(F ${RUNTIME_FILES})
|
||||
|
@ -67,13 +67,13 @@ if exists ('g:ada_with_gnat_project_files')
|
||||
endfor
|
||||
endif
|
||||
|
||||
" Section: add standard exception {{{2
|
||||
" Section: add standart exception {{{2
|
||||
"
|
||||
for Item in ['Constraint_Error', 'Program_Error', 'Storage_Error', 'Tasking_Error', 'Status_Error', 'Mode_Error', 'Name_Error', 'Use_Error', 'Device_Error', 'End_Error', 'Data_Error', 'Layout_Error', 'Length_Error', 'Pattern_Error', 'Index_Error', 'Translation_Error', 'Time_Error', 'Argument_Error', 'Tag_Error', 'Picture_Error', 'Terminator_Error', 'Conversion_Error', 'Pointer_Error', 'Dereference_Error', 'Update_Error']
|
||||
let g:ada#Keywords += [{
|
||||
\ 'word': Item,
|
||||
\ 'menu': 'exception',
|
||||
\ 'info': 'Ada standard exception.',
|
||||
\ 'info': 'Ada standart exception.',
|
||||
\ 'kind': 'x',
|
||||
\ 'icase': 1}]
|
||||
endfor
|
||||
@ -210,7 +210,7 @@ function ada#Word (...)
|
||||
let l:Line = substitute (getline (l:Line_Nr), g:ada#Comment, '', '' )
|
||||
|
||||
" Cope with tag searching for items in comments; if we are, don't loop
|
||||
" backwards looking for previous lines
|
||||
" backards looking for previous lines
|
||||
if l:Column_Nr > strlen(l:Line)
|
||||
" We were in a comment
|
||||
let l:Line = getline(l:Line_Nr)
|
||||
|
@ -14,7 +14,7 @@
|
||||
" 15.10.2006 MK Bram's suggestion for runtime integration
|
||||
" 05.11.2006 MK Bram suggested not to use include protection for
|
||||
" autoload
|
||||
" 05.11.2006 MK Bram suggested against using setlocal omnifunc
|
||||
" 05.11.2006 MK Bram suggested agaist using setlocal omnifunc
|
||||
" 05.11.2006 MK Bram suggested to save on spaces
|
||||
" Help Page: ft-ada-omni
|
||||
"------------------------------------------------------------------------------
|
||||
|
@ -1,13 +1,13 @@
|
||||
" Vim completion script
|
||||
" Language: C
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2020 Nov 14
|
||||
" Last Change: 2018 Aug 20
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" This function is used for the 'omnifunc' option.
|
||||
func ccomplete#Complete(findstart, base)
|
||||
function! ccomplete#Complete(findstart, base)
|
||||
if a:findstart
|
||||
" Locate the start of the item, including ".", "->" and "[...]".
|
||||
let line = getline('.')
|
||||
@ -244,7 +244,7 @@ func ccomplete#Complete(findstart, base)
|
||||
return map(res, 's:Tagline2item(v:val, brackets)')
|
||||
endfunc
|
||||
|
||||
func s:GetAddition(line, match, memarg, bracket)
|
||||
function! s:GetAddition(line, match, memarg, bracket)
|
||||
" Guess if the item is an array.
|
||||
if a:bracket && match(a:line, a:match . '\s*\[') > 0
|
||||
return '['
|
||||
@ -260,13 +260,13 @@ func s:GetAddition(line, match, memarg, bracket)
|
||||
endif
|
||||
endif
|
||||
return ''
|
||||
endfunc
|
||||
endfunction
|
||||
|
||||
" Turn the tag info "val" into an item for completion.
|
||||
" "val" is is an item in the list returned by taglist().
|
||||
" If it is a variable we may add "." or "->". Don't do it for other types,
|
||||
" such as a typedef, by not including the info that s:GetAddition() uses.
|
||||
func s:Tag2item(val)
|
||||
function! s:Tag2item(val)
|
||||
let res = {'match': a:val['name']}
|
||||
|
||||
let res['extra'] = s:Tagcmd2extra(a:val['cmd'], a:val['name'], a:val['filename'])
|
||||
@ -289,10 +289,10 @@ func s:Tag2item(val)
|
||||
endif
|
||||
|
||||
return res
|
||||
endfunc
|
||||
endfunction
|
||||
|
||||
" Use all the items in dictionary for the "info" entry.
|
||||
func s:Dict2info(dict)
|
||||
function! s:Dict2info(dict)
|
||||
let info = ''
|
||||
for k in sort(keys(a:dict))
|
||||
let info .= k . repeat(' ', 10 - len(k))
|
||||
@ -307,7 +307,7 @@ func s:Dict2info(dict)
|
||||
endfunc
|
||||
|
||||
" Parse a tag line and return a dictionary with items like taglist()
|
||||
func s:ParseTagline(line)
|
||||
function! s:ParseTagline(line)
|
||||
let l = split(a:line, "\t")
|
||||
let d = {}
|
||||
if len(l) >= 3
|
||||
@ -334,12 +334,12 @@ func s:ParseTagline(line)
|
||||
endif
|
||||
|
||||
return d
|
||||
endfunc
|
||||
endfunction
|
||||
|
||||
" Turn a match item "val" into an item for completion.
|
||||
" "val['match']" is the matching item.
|
||||
" "val['tagline']" is the tagline in which the last part was found.
|
||||
func s:Tagline2item(val, brackets)
|
||||
function! s:Tagline2item(val, brackets)
|
||||
let line = a:val['tagline']
|
||||
let add = s:GetAddition(line, a:val['match'], [a:val], a:brackets == '')
|
||||
let res = {'word': a:val['match'] . a:brackets . add }
|
||||
@ -377,10 +377,10 @@ func s:Tagline2item(val, brackets)
|
||||
let res['menu'] = s:Tagcmd2extra(s, a:val['match'], matchstr(line, '[^\t]*\t\zs[^\t]*\ze\t'))
|
||||
endif
|
||||
return res
|
||||
endfunc
|
||||
endfunction
|
||||
|
||||
" Turn a command from a tag line to something that is useful in the menu
|
||||
func s:Tagcmd2extra(cmd, name, fname)
|
||||
function! s:Tagcmd2extra(cmd, name, fname)
|
||||
if a:cmd =~ '^/^'
|
||||
" The command is a search command, useful to see what it is.
|
||||
let x = matchstr(a:cmd, '^/^\s*\zs.*\ze$/')
|
||||
@ -395,13 +395,13 @@ func s:Tagcmd2extra(cmd, name, fname)
|
||||
let x = a:cmd . ' - ' . a:fname
|
||||
endif
|
||||
return x
|
||||
endfunc
|
||||
endfunction
|
||||
|
||||
" Find composing type in "lead" and match items[0] with it.
|
||||
" Repeat this recursively for items[1], if it's there.
|
||||
" When resolving typedefs "depth" is used to avoid infinite recursion.
|
||||
" Return the list of matches.
|
||||
func s:Nextitem(lead, items, depth, all)
|
||||
function! s:Nextitem(lead, items, depth, all)
|
||||
|
||||
" Use the text up to the variable name and split it in tokens.
|
||||
let tokens = split(a:lead, '\s\+\|\<')
|
||||
@ -485,7 +485,7 @@ func s:Nextitem(lead, items, depth, all)
|
||||
endfor
|
||||
|
||||
return res
|
||||
endfunc
|
||||
endfunction
|
||||
|
||||
|
||||
" Search for members of structure "typename" in tags files.
|
||||
@ -493,7 +493,7 @@ endfunc
|
||||
" Each match is a dictionary with "match" and "tagline" entries.
|
||||
" When "all" is non-zero find all, otherwise just return 1 if there is any
|
||||
" member.
|
||||
func s:StructMembers(typename, items, all)
|
||||
function! s:StructMembers(typename, items, all)
|
||||
" Todo: What about local structures?
|
||||
let fnames = join(map(tagfiles(), 'escape(v:val, " \\#%")'))
|
||||
if fnames == ''
|
||||
@ -586,12 +586,12 @@ func s:StructMembers(typename, items, all)
|
||||
|
||||
" Failed to find anything.
|
||||
return []
|
||||
endfunc
|
||||
endfunction
|
||||
|
||||
" For matching members, find matches for following items.
|
||||
" When "all" is non-zero find all, otherwise just return 1 if there is any
|
||||
" member.
|
||||
func s:SearchMembers(matches, items, all)
|
||||
function! s:SearchMembers(matches, items, all)
|
||||
let res = []
|
||||
for i in range(len(a:matches))
|
||||
let typename = ''
|
||||
@ -635,5 +635,3 @@ endfunc
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: noet sw=2 sts=2
|
||||
|
File diff suppressed because one or more lines are too long
@ -4,7 +4,7 @@
|
||||
" plus CSS Speech Module <http://www.w3.org/TR/css3-speech/>
|
||||
" Maintainer: Kao, Wei-Ko(othree) ( othree AT gmail DOT com )
|
||||
" Original Author: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||
" Last Change: 2021 Sep 21
|
||||
" Last Change: 2018 Jul 02
|
||||
|
||||
let s:values = split("all additive-symbols align-content align-items align-self animation animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function backface-visibility background background-attachment background-blend-mode background-clip background-color background-image background-origin background-position background-repeat background-size block-size border border-block-end border-block-end-color border-block-end-style border-block-end-width border-block-start border-block-start-color border-block-start-style border-block-start-width border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-style border-bottom-width border-collapse border-color border-image border-image-outset border-image-repeat border-image-slice border-image-source border-image-width border-inline-end border-inline-end-color border-inline-end-style border-inline-end-width border-inline-start border-inline-start-color border-inline-start-style border-inline-start-width border-left border-left-color border-left-style border-left-width border-radius border-right border-right-color border-right-style border-right-width border-spacing border-style border-top border-top-color border-top-left-radius border-top-right-radius border-top-style border-top-width border-width bottom box-decoration-break box-shadow box-sizing break-after break-before break-inside caption-side clear clip clip-path color columns column-count column-fill column-gap column-rule column-rule-color column-rule-style column-rule-width column-span column-width content counter-increment counter-reset cue cue-before cue-after cursor direction display empty-cells fallback filter flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap float font font-family font-feature-settings font-kerning font-language-override font-size font-size-adjust font-stretch font-style font-synthesis font-variant font-variant-alternates font-variant-caps font-variant-east-asian font-variant-ligatures font-variant-numeric font-variant-position font-weight grid grid-area grid-auto-columns grid-auto-flow grid-auto-position grid-auto-rows grid-column grid-column-start grid-column-end grid-row grid-row-start grid-row-end grid-template grid-template-areas grid-template-rows grid-template-columns height hyphens image-rendering image-resolution image-orientation ime-mode inline-size isolation justify-content left letter-spacing line-break line-height list-style list-style-image list-style-position list-style-type margin margin-block-end margin-block-start margin-bottom margin-inline-end margin-inline-start margin-left margin-right margin-top marks mask mask-type max-block-size max-height max-inline-size max-width max-zoom min-block-size min-height min-inline-size min-width min-zoom mix-blend-mode negative object-fit object-position offset-block-end offset-block-start offset-inline-end offset-inline-start opacity order orientation orphans outline outline-color outline-offset outline-style outline-width overflow overflow-wrap overflow-x overflow-y pad padding padding-block-end padding-block-start padding-bottom padding-inline-end padding-inline-start padding-left padding-right padding-top page-break-after page-break-before page-break-inside pause-before pause-after pause perspective perspective-origin pointer-events position prefix quotes range resize rest rest-before rest-after right ruby-align ruby-merge ruby-position scroll-behavior scroll-snap-coordinate scroll-snap-destination scroll-snap-points-x scroll-snap-points-y scroll-snap-type scroll-snap-type-x scroll-snap-type-y shape-image-threshold shape-margin shape-outside speak speak-as suffix symbols system table-layout tab-size text-align text-align-last text-combine-upright text-decoration text-decoration-color text-decoration-line text-emphasis text-emphasis-color text-emphasis-position text-emphasis-style text-indent text-orientation text-overflow text-rendering text-shadow text-transform text-underline-position top touch-action transform transform-box transform-origin transform-style transition transition-delay transition-duration transition-property transition-timing-function unicode-bidi unicode-range user-zoom vertical-align visibility voice-balance voice-duration voice-family voice-pitch voice-rate voice-range voice-stress voice-volume white-space widows width will-change word-break word-spacing word-wrap writing-mode z-index zoom")
|
||||
|
||||
@ -38,12 +38,12 @@ function! csscomplete#CompleteCSS(findstart, base)
|
||||
if exists("b:compl_context")
|
||||
let line = getline('.')
|
||||
let compl_begin = col('.') - 2
|
||||
let b:after = line[compl_begin:]
|
||||
let after = line[compl_begin:]
|
||||
let line = b:compl_context
|
||||
unlet! b:compl_context
|
||||
else
|
||||
let line = a:base
|
||||
let b:after = ''
|
||||
let after = ''
|
||||
endif
|
||||
|
||||
let res = []
|
||||
@ -311,7 +311,7 @@ function! csscomplete#CompleteCSS(findstart, base)
|
||||
let values = ["normal", "italic", "oblique", "small-caps", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900", "xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "larger", "smaller", "sans-serif", "serif", "monospace", "cursive", "fantasy", "caption", "icon", "menu", "message-box", "small-caption", "status-bar"]
|
||||
elseif prop =~ '^\%(height\|width\)$'
|
||||
let values = ["auto", "border-box", "content-box", "max-content", "min-content", "available", "fit-content"]
|
||||
elseif prop =~ '^\%(left\|right\)$'
|
||||
elseif prop =~ '^\%(left\|rigth\)$'
|
||||
let values = ["auto"]
|
||||
elseif prop == 'image-rendering'
|
||||
let values = ["auto", "crisp-edges", "pixelated"]
|
||||
|
@ -23,9 +23,9 @@ endif
|
||||
|
||||
function decada#Unit_Name () dict " {{{1
|
||||
" Convert filename into acs unit:
|
||||
" 1: remove the file extension.
|
||||
" 1: remove the file extenstion.
|
||||
" 2: replace all double '_' or '-' with an dot (which denotes a separate)
|
||||
" 3: remove a trailing '_' (which denotes a specification)
|
||||
" 3: remove a trailing '_' (wich denotes a specification)
|
||||
return substitute (substitute (expand ("%:t:r"), '__\|-', ".", "g"), '_$', "", '')
|
||||
endfunction decada#Unit_Name " }}}1
|
||||
|
||||
|
296
runtime/autoload/dist/ft.vim
vendored
296
runtime/autoload/dist/ft.vim
vendored
@ -1,7 +1,7 @@
|
||||
" Vim functions for file type detection
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2022 Apr 06
|
||||
" Last Change: 2019 Mar 08
|
||||
|
||||
" These functions are moved here from runtime/filetype.vim to make startup
|
||||
" faster.
|
||||
@ -67,32 +67,13 @@ func dist#ft#FTasmsyntax()
|
||||
endif
|
||||
endfunc
|
||||
|
||||
let s:ft_visual_basic_content = '\cVB_Name\|Begin VB\.\(Form\|MDIForm\|UserControl\)'
|
||||
|
||||
" See FTfrm() for Visual Basic form file detection
|
||||
func dist#ft#FTbas()
|
||||
if exists("g:filetype_bas")
|
||||
exe "setf " . g:filetype_bas
|
||||
return
|
||||
endif
|
||||
|
||||
" most frequent FreeBASIC-specific keywords in distro files
|
||||
let fb_keywords = '\c^\s*\%(extern\|var\|enum\|private\|scope\|union\|byref\|operator\|constructor\|delete\|namespace\|public\|property\|with\|destructor\|using\)\>\%(\s*[:=(]\)\@!'
|
||||
let fb_preproc = '\c^\s*\%(#\a\+\|option\s\+\%(byval\|dynamic\|escape\|\%(no\)\=gosub\|nokeyword\|private\|static\)\>\)'
|
||||
let fb_comment = "^\\s*/'"
|
||||
" OPTION EXPLICIT, without the leading underscore, is common to many dialects
|
||||
let qb64_preproc = '\c^\s*\%($\a\+\|option\s\+\%(_explicit\|_\=explicitarray\)\>\)'
|
||||
|
||||
let lines = getline(1, min([line("$"), 100]))
|
||||
|
||||
if match(lines, fb_preproc) > -1 || match(lines, fb_comment) > -1 || match(lines, fb_keywords) > -1
|
||||
setf freebasic
|
||||
elseif match(lines, qb64_preproc) > -1
|
||||
setf qb64
|
||||
elseif match(lines, s:ft_visual_basic_content) > -1
|
||||
" Check if one of the first five lines contains "VB_Name". In that case it is
|
||||
" probably a Visual Basic file. Otherwise it's assumed to be "alt" filetype.
|
||||
func dist#ft#FTVB(alt)
|
||||
if getline(1).getline(2).getline(3).getline(4).getline(5) =~? 'VB_Name\|Begin VB\.\(Form\|MDIForm\|UserControl\)'
|
||||
setf vb
|
||||
else
|
||||
setf basic
|
||||
exe "setf " . a:alt
|
||||
endif
|
||||
endfunc
|
||||
|
||||
@ -112,25 +93,6 @@ func dist#ft#BindzoneCheck(default)
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" Returns true if file content looks like RAPID
|
||||
func IsRapid(sChkExt = "")
|
||||
if a:sChkExt == "cfg"
|
||||
return getline(1) =~? '\v^%(EIO|MMC|MOC|PROC|SIO|SYS):CFG'
|
||||
endif
|
||||
" called from FTmod, FTprg or FTsys
|
||||
return getline(nextnonblank(1)) =~? '\v^\s*%(\%{3}|module\s+\k+\s*%(\(|$))'
|
||||
endfunc
|
||||
|
||||
func dist#ft#FTcfg()
|
||||
if exists("g:filetype_cfg")
|
||||
exe "setf " .. g:filetype_cfg
|
||||
elseif IsRapid("cfg")
|
||||
setf rapid
|
||||
else
|
||||
setf cfg
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func dist#ft#FTlpc()
|
||||
if exists("g:lpc_syntax_for_c")
|
||||
let lnum = 1
|
||||
@ -192,7 +154,7 @@ endfunc
|
||||
|
||||
func dist#ft#FTent()
|
||||
" This function checks for valid cl syntax in the first five lines.
|
||||
" Look for either an opening comment, '#', or a block start, '{'.
|
||||
" Look for either an opening comment, '#', or a block start, '{".
|
||||
" If not found, assume SGML.
|
||||
let lnum = 1
|
||||
while lnum < 6
|
||||
@ -210,17 +172,6 @@ func dist#ft#FTent()
|
||||
setf dtd
|
||||
endfunc
|
||||
|
||||
func dist#ft#ExCheck()
|
||||
let lines = getline(1, min([line("$"), 100]))
|
||||
if exists('g:filetype_euphoria')
|
||||
exe 'setf ' . g:filetype_euphoria
|
||||
elseif match(lines, '^--\|^ifdef\>\|^include\>') > -1
|
||||
setf euphoria3
|
||||
else
|
||||
setf elixir
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func dist#ft#EuphoriaCheck()
|
||||
if exists('g:filetype_euphoria')
|
||||
exe 'setf ' . g:filetype_euphoria
|
||||
@ -230,10 +181,6 @@ func dist#ft#EuphoriaCheck()
|
||||
endfunc
|
||||
|
||||
func dist#ft#DtraceCheck()
|
||||
if did_filetype()
|
||||
" Filetype was already detected
|
||||
return
|
||||
endif
|
||||
let lines = getline(1, min([line("$"), 100]))
|
||||
if match(lines, '^module\>\|^import\>') > -1
|
||||
" D files often start with a module and/or import statement.
|
||||
@ -261,38 +208,6 @@ func dist#ft#FTe()
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func dist#ft#FTfrm()
|
||||
if exists("g:filetype_frm")
|
||||
exe "setf " . g:filetype_frm
|
||||
return
|
||||
endif
|
||||
|
||||
let lines = getline(1, min([line("$"), 5]))
|
||||
|
||||
if match(lines, s:ft_visual_basic_content) > -1
|
||||
setf vb
|
||||
else
|
||||
setf form
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" Distinguish between Forth and F#.
|
||||
" Provided by Doug Kearns.
|
||||
func dist#ft#FTfs()
|
||||
if exists("g:filetype_fs")
|
||||
exe "setf " . g:filetype_fs
|
||||
else
|
||||
let line = getline(nextnonblank(1))
|
||||
" comments and colon definitions
|
||||
if line =~ '^\s*\.\=( ' || line =~ '^\s*\\G\= ' || line =~ '^\\$'
|
||||
\ || line =~ '^\s*: \S'
|
||||
setf forth
|
||||
else
|
||||
setf fsharp
|
||||
endif
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" Distinguish between HTML, XHTML and Django
|
||||
func dist#ft#FThtml()
|
||||
let n = 1
|
||||
@ -338,16 +253,6 @@ func dist#ft#ProtoCheck(default)
|
||||
endfunc
|
||||
|
||||
func dist#ft#FTm()
|
||||
if exists("g:filetype_m")
|
||||
exe "setf " . g:filetype_m
|
||||
return
|
||||
endif
|
||||
|
||||
" excluding end(for|function|if|switch|while) common to Murphi
|
||||
let octave_block_terminators = '\<end\%(_try_catch\|classdef\|enumeration\|events\|methods\|parfor\|properties\)\>'
|
||||
|
||||
let objc_preprocessor = '^\s*#\s*\%(import\|include\|define\|if\|ifn\=def\|undef\|line\|error\|pragma\)\>'
|
||||
|
||||
let n = 1
|
||||
let saw_comment = 0 " Whether we've seen a multiline comment leader.
|
||||
while n < 100
|
||||
@ -358,16 +263,10 @@ func dist#ft#FTm()
|
||||
" anything more definitive.
|
||||
let saw_comment = 1
|
||||
endif
|
||||
if line =~ '^\s*//' || line =~ '^\s*@import\>' || line =~ objc_preprocessor
|
||||
if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|//\)'
|
||||
setf objc
|
||||
return
|
||||
endif
|
||||
if line =~ '^\s*\%(#\|%!\)' || line =~ '^\s*unwind_protect\>' ||
|
||||
\ line =~ '\%(^\|;\)\s*' .. octave_block_terminators
|
||||
setf octave
|
||||
return
|
||||
endif
|
||||
" TODO: could be Matlab or Octave
|
||||
if line =~ '^\s*%'
|
||||
setf matlab
|
||||
return
|
||||
@ -388,15 +287,18 @@ func dist#ft#FTm()
|
||||
" or Murphi based on the comment leader. Assume the former as it is more
|
||||
" common.
|
||||
setf objc
|
||||
elseif exists("g:filetype_m")
|
||||
" Use user specified default filetype for .m
|
||||
exe "setf " . g:filetype_m
|
||||
else
|
||||
" Default is Matlab
|
||||
" Default is matlab
|
||||
setf matlab
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func dist#ft#FTmms()
|
||||
let n = 1
|
||||
while n < 20
|
||||
while n < 10
|
||||
let line = getline(n)
|
||||
if line =~ '^\s*\(%\|//\)' || line =~ '^\*'
|
||||
setf mmix
|
||||
@ -423,7 +325,7 @@ endfunc
|
||||
|
||||
func dist#ft#FTmm()
|
||||
let n = 1
|
||||
while n < 20
|
||||
while n < 10
|
||||
let line = getline(n)
|
||||
if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\)'
|
||||
setf objcpp
|
||||
@ -434,36 +336,6 @@ func dist#ft#FTmm()
|
||||
setf nroff
|
||||
endfunc
|
||||
|
||||
" Returns true if file content looks like LambdaProlog
|
||||
func IsLProlog()
|
||||
" skip apparent comments and blank lines, what looks like
|
||||
" LambdaProlog comment may be RAPID header
|
||||
let l = nextnonblank(1)
|
||||
while l > 0 && l < line('$') && getline(l) =~ '^\s*%' " LambdaProlog comment
|
||||
let l = nextnonblank(l + 1)
|
||||
endwhile
|
||||
" this pattern must not catch a go.mod file
|
||||
return getline(l) =~ '\<module\s\+\w\+\s*\.\s*\(%\|$\)'
|
||||
endfunc
|
||||
|
||||
" Determine if *.mod is ABB RAPID, LambdaProlog, Modula-2, Modsim III or go.mod
|
||||
func dist#ft#FTmod()
|
||||
if exists("g:filetype_mod")
|
||||
exe "setf " .. g:filetype_mod
|
||||
elseif IsLProlog()
|
||||
setf lprolog
|
||||
elseif getline(nextnonblank(1)) =~ '\%(\<MODULE\s\+\w\+\s*;\|^\s*(\*\)'
|
||||
setf modula2
|
||||
elseif IsRapid()
|
||||
setf rapid
|
||||
elseif expand("<afile>") =~ '\<go.mod$'
|
||||
setf gomod
|
||||
else
|
||||
" Nothing recognized, assume modsim3
|
||||
setf modsim3
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func dist#ft#FTpl()
|
||||
if exists("g:filetype_pl")
|
||||
exe "setf " . g:filetype_pl
|
||||
@ -490,10 +362,6 @@ func dist#ft#FTinc()
|
||||
setf aspvbs
|
||||
elseif lines =~ "<?"
|
||||
setf php
|
||||
" Pascal supports // comments but they're vary rarely used for file
|
||||
" headers so assume POV-Ray
|
||||
elseif lines =~ '^\s*\%({\|(\*\)' || lines =~? s:ft_pascal_keywords
|
||||
setf pascal
|
||||
else
|
||||
call dist#ft#FTasmsyntax()
|
||||
if exists("b:asmsyntax")
|
||||
@ -540,9 +408,6 @@ func dist#ft#FTprogress_asm()
|
||||
setf progress
|
||||
endfunc
|
||||
|
||||
let s:ft_pascal_comments = '^\s*\%({\|(\*\|//\)'
|
||||
let s:ft_pascal_keywords = '^\s*\%(program\|unit\|library\|uses\|begin\|procedure\|function\|const\|type\|var\)\>'
|
||||
|
||||
func dist#ft#FTprogress_pascal()
|
||||
if exists("g:filetype_p")
|
||||
exe "setf " . g:filetype_p
|
||||
@ -554,7 +419,8 @@ func dist#ft#FTprogress_pascal()
|
||||
let lnum = 1
|
||||
while lnum <= 10 && lnum < line('$')
|
||||
let line = getline(lnum)
|
||||
if line =~ s:ft_pascal_comments || line =~? s:ft_pascal_keywords
|
||||
if line =~ '^\s*\(program\|unit\|procedure\|function\|const\|type\|var\)\>'
|
||||
\ || line =~ '^\s*{' || line =~ '^\s*(\*'
|
||||
setf pascal
|
||||
return
|
||||
elseif line !~ '^\s*$' || line =~ '^/\*'
|
||||
@ -567,31 +433,6 @@ func dist#ft#FTprogress_pascal()
|
||||
setf progress
|
||||
endfunc
|
||||
|
||||
func dist#ft#FTpp()
|
||||
if exists("g:filetype_pp")
|
||||
exe "setf " . g:filetype_pp
|
||||
else
|
||||
let line = getline(nextnonblank(1))
|
||||
if line =~ s:ft_pascal_comments || line =~? s:ft_pascal_keywords
|
||||
setf pascal
|
||||
else
|
||||
setf puppet
|
||||
endif
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" Determine if *.prg is ABB RAPID. Can also be Clipper, FoxPro or eviews
|
||||
func dist#ft#FTprg()
|
||||
if exists("g:filetype_prg")
|
||||
exe "setf " .. g:filetype_prg
|
||||
elseif IsRapid()
|
||||
setf rapid
|
||||
else
|
||||
" Nothing recognized, assume Clipper
|
||||
setf clipper
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func dist#ft#FTr()
|
||||
let max = line("$") > 50 ? 50 : line("$")
|
||||
|
||||
@ -734,7 +575,7 @@ endfunc
|
||||
let s:ft_rules_udev_rules_pattern = '^\s*\cudev_rules\s*=\s*"\([^"]\{-1,}\)/*".*'
|
||||
func dist#ft#FTRules()
|
||||
let path = expand('<amatch>:p')
|
||||
if path =~ '/\(etc/udev/\%(rules\.d/\)\=.*\.rules\|\%(usr/\)\=lib/udev/\%(rules\.d/\)\=.*\.rules\)$'
|
||||
if path =~ '^/\(etc/udev/\%(rules\.d/\)\=.*\.rules\|lib/udev/\%(rules\.d/\)\=.*\.rules\)$'
|
||||
setf udevrules
|
||||
return
|
||||
endif
|
||||
@ -773,28 +614,6 @@ func dist#ft#SQL()
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" This function checks the first 25 lines of file extension "sc" to resolve
|
||||
" detection between scala and SuperCollider
|
||||
func dist#ft#FTsc()
|
||||
for lnum in range(1, min([line("$"), 25]))
|
||||
if getline(lnum) =~# '[A-Za-z0-9]*\s:\s[A-Za-z0-9]\|var\s<\|classvar\s<\|\^this.*\||\w*|\|+\s\w*\s{\|\*ar\s'
|
||||
setf supercollider
|
||||
return
|
||||
endif
|
||||
endfor
|
||||
setf scala
|
||||
endfunc
|
||||
|
||||
" This function checks the first line of file extension "scd" to resolve
|
||||
" detection between scdoc and SuperCollider
|
||||
func dist#ft#FTscd()
|
||||
if getline(1) =~# '\%^\S\+(\d[0-9A-Za-z]*)\%(\s\+\"[^"]*\"\%(\s\+\"[^"]*\"\)\=\)\=$'
|
||||
setf scdoc
|
||||
else
|
||||
setf supercollider
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" If the file has an extension of 't' and is in a directory 't' or 'xt' then
|
||||
" it is almost certainly a Perl test file.
|
||||
" If the first line starts with '#' and contains 'perl' it's probably a Perl
|
||||
@ -813,7 +632,7 @@ func dist#ft#FTperl()
|
||||
endif
|
||||
let save_cursor = getpos('.')
|
||||
call cursor(1,1)
|
||||
let has_use = search('^use\s\s*\k', 'c', 30) > 0
|
||||
let has_use = search('^use\s\s*\k', 'c', 30)
|
||||
call setpos('.', save_cursor)
|
||||
if has_use
|
||||
setf perl
|
||||
@ -822,16 +641,6 @@ func dist#ft#FTperl()
|
||||
return 0
|
||||
endfunc
|
||||
|
||||
func dist#ft#FTsys()
|
||||
if exists("g:filetype_sys")
|
||||
exe "setf " .. g:filetype_sys
|
||||
elseif IsRapid()
|
||||
setf rapid
|
||||
else
|
||||
setf bat
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" Choose context, plaintex, or tex (LaTeX) based on these rules:
|
||||
" 1. Check the first line of the file for "%&<format>".
|
||||
" 2. Check the first 1000 non-comment lines for LaTeX or ConTeXt keywords.
|
||||
@ -855,8 +664,7 @@ func dist#ft#FTtex()
|
||||
let save_cursor = getpos('.')
|
||||
call cursor(1,1)
|
||||
let firstNC = search('^\s*[^[:space:]%]', 'c', 1000)
|
||||
if firstNC > 0
|
||||
" Check the next thousand lines for a LaTeX or ConTeXt keyword.
|
||||
if firstNC " Check the next thousand lines for a LaTeX or ConTeXt keyword.
|
||||
let lpat = 'documentclass\>\|usepackage\>\|begin{\|newcommand\>\|renewcommand\>'
|
||||
let cpat = 'start\a\+\|setup\a\+\|usemodule\|enablemode\|enableregime\|setvariables\|useencoding\|usesymbols\|stelle\a\+\|verwende\a\+\|stel\a\+\|gebruik\a\+\|usa\a\+\|imposta\a\+\|regle\a\+\|utilisemodule\>'
|
||||
let kwline = search('^\s*\\\%(' . lpat . '\)\|^\s*\\\(' . cpat . '\)',
|
||||
@ -943,72 +751,6 @@ func dist#ft#Redif()
|
||||
endwhile
|
||||
endfunc
|
||||
|
||||
" This function is called for all files under */debian/patches/*, make sure not
|
||||
" to non-dep3patch files, such as README and other text files.
|
||||
func dist#ft#Dep3patch()
|
||||
if expand('%:t') ==# 'series'
|
||||
return
|
||||
endif
|
||||
|
||||
for ln in getline(1, 100)
|
||||
if ln =~# '^\%(Description\|Subject\|Origin\|Bug\|Forwarded\|Author\|From\|Reviewed-by\|Acked-by\|Last-Updated\|Applied-Upstream\):'
|
||||
setf dep3patch
|
||||
return
|
||||
elseif ln =~# '^---'
|
||||
" end of headers found. stop processing
|
||||
return
|
||||
endif
|
||||
endfor
|
||||
endfunc
|
||||
|
||||
" This function checks the first 15 lines for appearance of 'FoamFile'
|
||||
" and then 'object' in a following line.
|
||||
" In that case, it's probably an OpenFOAM file
|
||||
func dist#ft#FTfoam()
|
||||
let ffile = 0
|
||||
let lnum = 1
|
||||
while lnum <= 15
|
||||
if getline(lnum) =~# '^FoamFile'
|
||||
let ffile = 1
|
||||
elseif ffile == 1 && getline(lnum) =~# '^\s*object'
|
||||
setf foam
|
||||
return
|
||||
endif
|
||||
let lnum = lnum + 1
|
||||
endwhile
|
||||
endfunc
|
||||
|
||||
" Determine if a *.tf file is TF mud client or terraform
|
||||
func dist#ft#FTtf()
|
||||
let numberOfLines = line('$')
|
||||
for i in range(1, numberOfLines)
|
||||
let currentLine = trim(getline(i))
|
||||
let firstCharacter = currentLine[0]
|
||||
if firstCharacter !=? ";" && firstCharacter !=? "/" && firstCharacter !=? ""
|
||||
setf terraform
|
||||
return
|
||||
endif
|
||||
endfor
|
||||
setf tf
|
||||
endfunc
|
||||
|
||||
" Determine if a *.src file is Kuka Robot Language
|
||||
func dist#ft#FTsrc()
|
||||
if exists("g:filetype_src")
|
||||
exe "setf " .. g:filetype_src
|
||||
elseif getline(nextnonblank(1)) =~? '^\s*\%(&\w\+\|\%(global\s\+\)\?def\>\)'
|
||||
setf krl
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" Determine if a *.dat file is Kuka Robot Language
|
||||
func dist#ft#FTdat()
|
||||
if exists("g:filetype_dat")
|
||||
exe "setf " .. g:filetype_dat
|
||||
elseif getline(nextnonblank(1)) =~? '^\s*\%(&\w\+\|defdat\>\)'
|
||||
setf krl
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" Restore 'cpoptions'
|
||||
let &cpo = s:cpo_save
|
||||
|
@ -1,41 +0,0 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: FreeBASIC
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2021 Mar 16
|
||||
|
||||
" Dialects can be one of fb, qb, fblite, or deprecated
|
||||
" Precedence is forcelang > #lang > lang
|
||||
function! freebasic#GetDialect() abort
|
||||
if exists("g:freebasic_forcelang")
|
||||
return g:freebasic_forcelang
|
||||
endif
|
||||
|
||||
if exists("g:freebasic_lang")
|
||||
let dialect = g:freebasic_lang
|
||||
else
|
||||
let dialect = "fb"
|
||||
endif
|
||||
|
||||
" override with #lang directive or metacommand
|
||||
|
||||
let skip = "has('syntax_items') && synIDattr(synID(line('.'), col('.'), 1), 'name') =~ 'Comment$'"
|
||||
let pat = '\c^\s*\%(#\s*lang\s\+\|''\s*$lang\s*:\s*\)"\([^"]*\)"'
|
||||
|
||||
let save_cursor = getcurpos()
|
||||
call cursor(1, 1)
|
||||
let lnum = search(pat, 'n', '', '', skip)
|
||||
call setpos('.', save_cursor)
|
||||
|
||||
if lnum
|
||||
let word = matchlist(getline(lnum), pat)[1]
|
||||
if word =~? '\%(fb\|deprecated\|fblite\|qb\)'
|
||||
let dialect = word
|
||||
else
|
||||
echomsg "freebasic#GetDialect: Invalid lang, found '" .. word .. "' at line " .. lnum .. " " .. getline(lnum)
|
||||
endif
|
||||
endif
|
||||
|
||||
return dialect
|
||||
endfunction
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:
|
@ -2,7 +2,7 @@
|
||||
" Language: Haskell
|
||||
" Maintainer: Daniel Campoverde <alx@sillybytes.net>
|
||||
" URL: https://github.com/alx741/haskellcomplete.vim
|
||||
" Last Change: 2019 May 14
|
||||
" Last Change: 2018 Aug 26
|
||||
|
||||
" Usage: setlocal omnifunc=haskellcomplete#Complete
|
||||
|
||||
@ -54,7 +54,7 @@ function! haskellcomplete#Complete(findstart, base)
|
||||
|
||||
if b:completingLangExtension
|
||||
if a:base ==? ""
|
||||
" Return all possible Lang extensions
|
||||
" Return all posible Lang extensions
|
||||
return s:langExtensions
|
||||
else
|
||||
let l:matches = []
|
||||
@ -63,14 +63,13 @@ function! haskellcomplete#Complete(findstart, base)
|
||||
call add(l:matches, extension)
|
||||
endif
|
||||
endfor
|
||||
let b:completingLangExtension = 0
|
||||
return l:matches
|
||||
endif
|
||||
|
||||
|
||||
elseif b:completingOptionsGHC
|
||||
if a:base ==? ""
|
||||
" Return all possible GHC options
|
||||
" Return all posible GHC options
|
||||
return s:optionsGHC
|
||||
else
|
||||
let l:matches = []
|
||||
@ -79,14 +78,13 @@ function! haskellcomplete#Complete(findstart, base)
|
||||
call add(l:matches, flag)
|
||||
endif
|
||||
endfor
|
||||
let b:completingOptionsGHC = 0
|
||||
return l:matches
|
||||
endif
|
||||
|
||||
|
||||
elseif b:completingModule
|
||||
if a:base ==? ""
|
||||
" Return all possible modules
|
||||
" Return all posible modules
|
||||
return s:commonModules
|
||||
else
|
||||
let l:matches = []
|
||||
@ -95,7 +93,6 @@ function! haskellcomplete#Complete(findstart, base)
|
||||
call add(l:matches, module)
|
||||
endif
|
||||
endfor
|
||||
let b:completingModule = 0
|
||||
return l:matches
|
||||
endif
|
||||
|
||||
|
@ -1,64 +1,79 @@
|
||||
function! s:enhance_syntax() abort
|
||||
syntax case match
|
||||
|
||||
syntax keyword healthError ERROR[:]
|
||||
\ containedin=markdownCodeBlock,mkdListItemLine
|
||||
highlight default link healthError Error
|
||||
|
||||
syntax keyword healthWarning WARNING[:]
|
||||
\ containedin=markdownCodeBlock,mkdListItemLine
|
||||
highlight default link healthWarning WarningMsg
|
||||
|
||||
syntax keyword healthSuccess OK[:]
|
||||
\ containedin=markdownCodeBlock,mkdListItemLine
|
||||
highlight default healthSuccess guibg=#5fff00 guifg=#080808 ctermbg=82 ctermfg=232
|
||||
|
||||
syntax match healthHelp "|.\{-}|" contains=healthBar
|
||||
\ containedin=markdownCodeBlock,mkdListItemLine
|
||||
syntax match healthBar "|" contained conceal
|
||||
highlight default link healthHelp Identifier
|
||||
|
||||
" We do not care about markdown syntax errors in :checkhealth output.
|
||||
highlight! link markdownError Normal
|
||||
endfunction
|
||||
|
||||
" Runs the specified healthchecks.
|
||||
" Runs all discovered healthchecks if a:plugin_names is empty.
|
||||
function! health#check(plugin_names) abort
|
||||
let healthchecks = empty(a:plugin_names)
|
||||
\ ? s:discover_healthchecks()
|
||||
\ : s:get_healthcheck(a:plugin_names)
|
||||
\ ? s:discover_health_checks()
|
||||
\ : s:to_fn_names(a:plugin_names)
|
||||
|
||||
" create scratch-buffer
|
||||
execute 'tab sbuffer' nvim_create_buf(v:true, v:true)
|
||||
setfiletype checkhealth
|
||||
tabnew
|
||||
setlocal wrap breakindent linebreak
|
||||
setlocal filetype=markdown
|
||||
setlocal conceallevel=2 concealcursor=nc
|
||||
setlocal keywordprg=:help
|
||||
let &l:iskeyword='!-~,^*,^|,^",192-255'
|
||||
call s:enhance_syntax()
|
||||
|
||||
if empty(healthchecks)
|
||||
call setline(1, 'ERROR: No healthchecks found.')
|
||||
else
|
||||
redraw|echo 'Running healthchecks...'
|
||||
for name in sort(keys(healthchecks))
|
||||
let [func, type] = healthchecks[name]
|
||||
let s:output = []
|
||||
for c in healthchecks
|
||||
let output = ''
|
||||
call append('$', split(printf("\n%s\n%s", c, repeat('=',72)), "\n"))
|
||||
try
|
||||
if func == ''
|
||||
throw 'healthcheck_not_found'
|
||||
endif
|
||||
eval type == 'v' ? call(func, []) : luaeval(func)
|
||||
" in the event the healthcheck doesn't return anything
|
||||
" (the plugin author should avoid this possibility)
|
||||
if len(s:output) == 0
|
||||
throw 'healthcheck_no_return_value'
|
||||
endif
|
||||
let output = "\n\n".execute('call '.c.'()')
|
||||
catch
|
||||
let s:output = [] " Clear the output
|
||||
if v:exception =~# 'healthcheck_not_found'
|
||||
call health#report_error('No healthcheck found for "'.name.'" plugin.')
|
||||
elseif v:exception =~# 'healthcheck_no_return_value'
|
||||
call health#report_error('The healthcheck report for "'.name.'" plugin is empty.')
|
||||
if v:exception =~# '^Vim\%((\a\+)\)\=:E117.*\V'.c
|
||||
let output = execute(
|
||||
\ 'call health#report_error(''No healthcheck found for "'
|
||||
\ .s:to_plugin_name(c)
|
||||
\ .'" plugin.'')')
|
||||
else
|
||||
call health#report_error(printf(
|
||||
\ "Failed to run healthcheck for \"%s\" plugin. Exception:\n%s\n%s",
|
||||
\ name, v:throwpoint, v:exception))
|
||||
let output = execute(
|
||||
\ 'call health#report_error(''Failed to run healthcheck for "'
|
||||
\ .s:to_plugin_name(c)
|
||||
\ .'" plugin. Exception:''."\n".v:throwpoint."\n".v:exception)')
|
||||
endif
|
||||
endtry
|
||||
let header = [name. ': ' . func, repeat('=', 72)]
|
||||
" remove empty line after header from report_start
|
||||
let s:output = s:output[0] == '' ? s:output[1:] : s:output
|
||||
let s:output = header + s:output + ['']
|
||||
call append('$', s:output)
|
||||
call append('$', split(output, "\n") + [''])
|
||||
redraw
|
||||
endfor
|
||||
endif
|
||||
|
||||
" needed for plasticboy/vim-markdown, because it uses fdm=expr
|
||||
normal! zR
|
||||
setlocal nomodified
|
||||
setlocal bufhidden=hide
|
||||
redraw|echo ''
|
||||
endfunction
|
||||
|
||||
function! s:collect_output(output)
|
||||
let s:output += split(a:output, "\n", 1)
|
||||
endfunction
|
||||
|
||||
" Starts a new report.
|
||||
function! health#report_start(name) abort
|
||||
call s:collect_output("\n## " . a:name)
|
||||
echo "\n## " . a:name
|
||||
endfunction
|
||||
|
||||
" Indents lines *except* line 1 of a string if it contains newlines.
|
||||
@ -104,21 +119,21 @@ endfunction " }}}
|
||||
|
||||
" Use {msg} to report information in the current section
|
||||
function! health#report_info(msg) abort " {{{
|
||||
call s:collect_output(s:format_report_message('INFO', a:msg))
|
||||
echo s:format_report_message('INFO', a:msg)
|
||||
endfunction " }}}
|
||||
|
||||
" Reports a successful healthcheck.
|
||||
function! health#report_ok(msg) abort " {{{
|
||||
call s:collect_output(s:format_report_message('OK', a:msg))
|
||||
echo s:format_report_message('OK', a:msg)
|
||||
endfunction " }}}
|
||||
|
||||
" Reports a health warning.
|
||||
" a:1: Optional advice (string or list)
|
||||
function! health#report_warn(msg, ...) abort " {{{
|
||||
if a:0 > 0
|
||||
call s:collect_output(s:format_report_message('WARNING', a:msg, a:1))
|
||||
echo s:format_report_message('WARNING', a:msg, a:1)
|
||||
else
|
||||
call s:collect_output(s:format_report_message('WARNING', a:msg))
|
||||
echo s:format_report_message('WARNING', a:msg)
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
@ -126,73 +141,37 @@ endfunction " }}}
|
||||
" a:1: Optional advice (string or list)
|
||||
function! health#report_error(msg, ...) abort " {{{
|
||||
if a:0 > 0
|
||||
call s:collect_output(s:format_report_message('ERROR', a:msg, a:1))
|
||||
echo s:format_report_message('ERROR', a:msg, a:1)
|
||||
else
|
||||
call s:collect_output(s:format_report_message('ERROR', a:msg))
|
||||
echo s:format_report_message('ERROR', a:msg)
|
||||
endif
|
||||
endfunction " }}}
|
||||
|
||||
" From a path return a list [{name}, {func}, {type}] representing a healthcheck
|
||||
function! s:filepath_to_healthcheck(path) abort
|
||||
if a:path =~# 'vim$'
|
||||
let name = matchstr(a:path, '\zs[^\/]*\ze\.vim$')
|
||||
let func = 'health#'.name.'#check'
|
||||
let type = 'v'
|
||||
else
|
||||
let base_path = substitute(a:path,
|
||||
\ '.*lua[\/]\(.\{-}\)[\/]health\([\/]init\)\?\.lua$',
|
||||
\ '\1', '')
|
||||
let name = substitute(base_path, '[\/]', '.', 'g')
|
||||
let func = 'require("'.name.'.health").check()'
|
||||
let type = 'l'
|
||||
endif
|
||||
return [name, func, type]
|
||||
function! s:filepath_to_function(name) abort
|
||||
return substitute(substitute(substitute(a:name, '.*autoload[\/]', '', ''),
|
||||
\ '\.vim', '#check', ''), '[\/]', '#', 'g')
|
||||
endfunction
|
||||
|
||||
function! s:discover_healthchecks() abort
|
||||
return s:get_healthcheck('*')
|
||||
function! s:discover_health_checks() abort
|
||||
let healthchecks = globpath(&runtimepath, 'autoload/health/*.vim', 1, 1)
|
||||
let healthchecks = map(healthchecks, '<SID>filepath_to_function(v:val)')
|
||||
return healthchecks
|
||||
endfunction
|
||||
|
||||
" Returns Dictionary {name: [func, type], ..} representing healthchecks
|
||||
function! s:get_healthcheck(plugin_names) abort
|
||||
let health_list = s:get_healthcheck_list(a:plugin_names)
|
||||
let healthchecks = {}
|
||||
for c in health_list
|
||||
let normalized_name = substitute(c[0], '-', '_', 'g')
|
||||
let existent = get(healthchecks, normalized_name, [])
|
||||
" Prefer Lua over vim entries
|
||||
if existent != [] && existent[2] == 'l'
|
||||
continue
|
||||
else
|
||||
let healthchecks[normalized_name] = c
|
||||
endif
|
||||
endfor
|
||||
let output = {}
|
||||
for v in values(healthchecks)
|
||||
let output[v[0]] = v[1:]
|
||||
endfor
|
||||
return output
|
||||
endfunction
|
||||
|
||||
" Returns list of lists [ [{name}, {func}, {type}] ] representing healthchecks
|
||||
function! s:get_healthcheck_list(plugin_names) abort
|
||||
" Translates a list of plugin names to healthcheck function names.
|
||||
function! s:to_fn_names(plugin_names) abort
|
||||
let healthchecks = []
|
||||
let plugin_names = type('') == type(a:plugin_names)
|
||||
\ ? split(a:plugin_names, ' ', v:false)
|
||||
let plugin_names = type('') ==# type(a:plugin_names)
|
||||
\ ? split(a:plugin_names, '', v:false)
|
||||
\ : a:plugin_names
|
||||
for p in plugin_names
|
||||
" support vim/lsp/health{/init/}.lua as :checkhealth vim.lsp
|
||||
let p = substitute(p, '\.', '/', 'g')
|
||||
let p = substitute(p, '*$', '**', 'g') " find all submodule e.g vim*
|
||||
let paths = nvim_get_runtime_file('autoload/health/'.p.'.vim', v:true)
|
||||
\ + nvim_get_runtime_file('lua/**/'.p.'/health/init.lua', v:true)
|
||||
\ + nvim_get_runtime_file('lua/**/'.p.'/health.lua', v:true)
|
||||
if len(paths) == 0
|
||||
let healthchecks += [[p, '', '']] " healthcheck not found
|
||||
else
|
||||
let healthchecks += map(uniq(sort(paths)),
|
||||
\'<SID>filepath_to_healthcheck(v:val)')
|
||||
end
|
||||
call add(healthchecks, 'health#'.p.'#check')
|
||||
endfor
|
||||
return healthchecks
|
||||
endfunction
|
||||
|
||||
" Extracts 'foo' from 'health#foo#check'.
|
||||
function! s:to_plugin_name(fn_name) abort
|
||||
return substitute(a:fn_name,
|
||||
\ '\v.*health\#(.+)\#check.*', '\1', '')
|
||||
endfunction
|
||||
|
@ -41,27 +41,10 @@ function! s:check_config() abort
|
||||
\ 'Check `:verbose set paste?` to see if a plugin or script set the option.', ])
|
||||
endif
|
||||
|
||||
let writeable = v:true
|
||||
let shadafile = empty(&shada) ? &shada : substitute(matchstr(
|
||||
\ split(&shada, ',')[-1], '^n.\+'), '^n', '', '')
|
||||
let shadafile = empty(&shadafile) ? empty(shadafile) ?
|
||||
\ stdpath('data').'/shada/main.shada' : expand(shadafile)
|
||||
\ : &shadafile ==# 'NONE' ? '' : &shadafile
|
||||
if !empty(shadafile) && empty(glob(shadafile))
|
||||
" Since this may be the first time neovim has been run, we will try to
|
||||
" create a shada file
|
||||
try
|
||||
wshada
|
||||
catch /.*/
|
||||
let writeable = v:false
|
||||
endtry
|
||||
endif
|
||||
if !writeable || (!empty(shadafile) &&
|
||||
\ (!filereadable(shadafile) || !filewritable(shadafile)))
|
||||
let shadafile = (empty(&shadafile) || &shadafile ==# 'NONE') ? stdpath('data').'/shada/main.shada' : &shadafile
|
||||
if !empty(shadafile) && (!filereadable(shadafile) || !filewritable(shadafile))
|
||||
let ok = v:false
|
||||
call health#report_error('shada file is not '.
|
||||
\ ((!writeable || filereadable(shadafile)) ?
|
||||
\ 'writeable' : 'readable').":\n".shadafile)
|
||||
call health#report_error('shada file is not '.(filereadable(shadafile) ? 'writeable' : 'readable').":\n".shadafile)
|
||||
endif
|
||||
|
||||
if ok
|
||||
@ -104,8 +87,8 @@ function! s:check_rplugin_manifest() abort
|
||||
if !has_key(existing_rplugins, script)
|
||||
let msg = printf('"%s" is not registered.', fnamemodify(path, ':t'))
|
||||
if python_version ==# 'pythonx'
|
||||
if !has('python3')
|
||||
let msg .= ' (python3 not available)'
|
||||
if !has('python2') && !has('python3')
|
||||
let msg .= ' (python2 and python3 not available)'
|
||||
endif
|
||||
elseif !has(python_version)
|
||||
let msg .= printf(' (%s not available)', python_version)
|
||||
@ -146,25 +129,6 @@ function! s:check_performance() abort
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:get_tmux_option(option) abort
|
||||
let cmd = 'tmux show-option -qvg '.a:option " try global scope
|
||||
let out = system(split(cmd))
|
||||
let val = substitute(out, '\v(\s|\r|\n)', '', 'g')
|
||||
if v:shell_error
|
||||
call health#report_error('command failed: '.cmd."\n".out)
|
||||
return 'error'
|
||||
elseif empty(val)
|
||||
let cmd = 'tmux show-option -qvgs '.a:option " try session scope
|
||||
let out = system(split(cmd))
|
||||
let val = substitute(out, '\v(\s|\r|\n)', '', 'g')
|
||||
if v:shell_error
|
||||
call health#report_error('command failed: '.cmd."\n".out)
|
||||
return 'error'
|
||||
endif
|
||||
endif
|
||||
return val
|
||||
endfunction
|
||||
|
||||
function! s:check_tmux() abort
|
||||
if empty($TMUX) || !executable('tmux')
|
||||
return
|
||||
@ -172,41 +136,30 @@ function! s:check_tmux() abort
|
||||
call health#report_start('tmux')
|
||||
|
||||
" check escape-time
|
||||
let suggestions = ["set escape-time in ~/.tmux.conf:\nset-option -sg escape-time 10",
|
||||
let suggestions = ["Set escape-time in ~/.tmux.conf:\nset-option -sg escape-time 10",
|
||||
\ s:suggest_faq]
|
||||
let tmux_esc_time = s:get_tmux_option('escape-time')
|
||||
if tmux_esc_time !=# 'error'
|
||||
if empty(tmux_esc_time)
|
||||
call health#report_error('`escape-time` is not set', suggestions)
|
||||
elseif tmux_esc_time > 300
|
||||
call health#report_error(
|
||||
\ '`escape-time` ('.tmux_esc_time.') is higher than 300ms', suggestions)
|
||||
else
|
||||
call health#report_ok('escape-time: '.tmux_esc_time)
|
||||
endif
|
||||
endif
|
||||
|
||||
" check focus-events
|
||||
let suggestions = ["(tmux 1.9+ only) Set `focus-events` in ~/.tmux.conf:\nset-option -g focus-events on"]
|
||||
let tmux_focus_events = s:get_tmux_option('focus-events')
|
||||
call health#report_info('Checking stuff')
|
||||
if tmux_focus_events !=# 'error'
|
||||
if empty(tmux_focus_events) || tmux_focus_events !=# 'on'
|
||||
call health#report_warn(
|
||||
\ "`focus-events` is not enabled. |'autoread'| may not work.", suggestions)
|
||||
else
|
||||
call health#report_ok('focus-events: '.tmux_focus_events)
|
||||
endif
|
||||
let cmd = 'tmux show-option -qvgs escape-time'
|
||||
let out = system(cmd)
|
||||
let tmux_esc_time = substitute(out, '\v(\s|\r|\n)', '', 'g')
|
||||
if v:shell_error
|
||||
call health#report_error('command failed: '.cmd."\n".out)
|
||||
elseif empty(tmux_esc_time)
|
||||
call health#report_error('escape-time is not set', suggestions)
|
||||
elseif tmux_esc_time > 300
|
||||
call health#report_error(
|
||||
\ 'escape-time ('.tmux_esc_time.') is higher than 300ms', suggestions)
|
||||
else
|
||||
call health#report_ok('escape-time: '.tmux_esc_time.'ms')
|
||||
endif
|
||||
|
||||
" check default-terminal and $TERM
|
||||
call health#report_info('$TERM: '.$TERM)
|
||||
let cmd = 'tmux show-option -qvg default-terminal'
|
||||
let out = system(split(cmd))
|
||||
let out = system(cmd)
|
||||
let tmux_default_term = substitute(out, '\v(\s|\r|\n)', '', 'g')
|
||||
if empty(tmux_default_term)
|
||||
let cmd = 'tmux show-option -qvgs default-terminal'
|
||||
let out = system(split(cmd))
|
||||
let out = system(cmd)
|
||||
let tmux_default_term = substitute(out, '\v(\s|\r|\n)', '', 'g')
|
||||
endif
|
||||
|
||||
@ -225,7 +178,7 @@ function! s:check_tmux() abort
|
||||
endif
|
||||
|
||||
" check for RGB capabilities
|
||||
let info = system(['tmux', 'server-info'])
|
||||
let info = system('tmux server-info')
|
||||
let has_tc = stridx(info, " Tc: (flag) true") != -1
|
||||
let has_rgb = stridx(info, " RGB: (flag) true") != -1
|
||||
if !has_tc && !has_rgb
|
||||
@ -242,21 +195,17 @@ function! s:check_terminal() abort
|
||||
endif
|
||||
call health#report_start('terminal')
|
||||
let cmd = 'infocmp -L'
|
||||
let out = system(split(cmd))
|
||||
let out = system(cmd)
|
||||
let kbs_entry = matchstr(out, 'key_backspace=[^,[:space:]]*')
|
||||
let kdch1_entry = matchstr(out, 'key_dc=[^,[:space:]]*')
|
||||
|
||||
if v:shell_error
|
||||
\ && (!has('win32')
|
||||
\ || empty(matchstr(out,
|
||||
\ 'infocmp: couldn''t open terminfo file .\+'
|
||||
\ ..'\%(conemu\|vtpcon\|win32con\)')))
|
||||
call health#report_error('command failed: '.cmd."\n".out)
|
||||
else
|
||||
call health#report_info('key_backspace (kbs) terminfo entry: '
|
||||
\ .(empty(kbs_entry) ? '? (not found)' : kbs_entry))
|
||||
\ .(empty(kbs_entry) ? '? (not found)' : kbs_entry))
|
||||
call health#report_info('key_dc (kdch1) terminfo entry: '
|
||||
\ .(empty(kbs_entry) ? '? (not found)' : kdch1_entry))
|
||||
\ .(empty(kbs_entry) ? '? (not found)' : kdch1_entry))
|
||||
endif
|
||||
for env_var in ['XTERM_VERSION', 'VTE_VERSION', 'TERM_PROGRAM', 'COLORTERM', 'SSH_TTY']
|
||||
if exists('$'.env_var)
|
||||
|
@ -38,10 +38,9 @@ endfunction
|
||||
" Handler for s:system() function.
|
||||
function! s:system_handler(jobid, data, event) dict abort
|
||||
if a:event ==# 'stderr'
|
||||
if self.add_stderr_to_output
|
||||
let self.stderr .= join(a:data, '')
|
||||
if !self.ignore_stderr
|
||||
let self.output .= join(a:data, '')
|
||||
else
|
||||
let self.stderr .= join(a:data, '')
|
||||
endif
|
||||
elseif a:event ==# 'stdout'
|
||||
let self.output .= join(a:data, '')
|
||||
@ -65,7 +64,7 @@ function! s:system(cmd, ...) abort
|
||||
let stdin = a:0 ? a:1 : ''
|
||||
let ignore_error = a:0 > 2 ? a:3 : 0
|
||||
let opts = {
|
||||
\ 'add_stderr_to_output': a:0 > 1 ? a:2 : 0,
|
||||
\ 'ignore_stderr': a:0 > 1 ? a:2 : 0,
|
||||
\ 'output': '',
|
||||
\ 'stderr': '',
|
||||
\ 'on_stdout': function('s:system_handler'),
|
||||
@ -90,15 +89,8 @@ function! s:system(cmd, ...) abort
|
||||
call health#report_error(printf('Command timed out: %s', s:shellify(a:cmd)))
|
||||
call jobstop(jobid)
|
||||
elseif s:shell_error != 0 && !ignore_error
|
||||
let emsg = printf("Command error (job=%d, exit code %d): `%s` (in %s)",
|
||||
\ jobid, s:shell_error, s:shellify(a:cmd), string(getcwd()))
|
||||
if !empty(opts.output)
|
||||
let emsg .= "\noutput: " . opts.output
|
||||
end
|
||||
if !empty(opts.stderr)
|
||||
let emsg .= "\nstderr: " . opts.stderr
|
||||
end
|
||||
call health#report_error(emsg)
|
||||
call health#report_error(printf("Command error (job=%d, exit code %d): `%s` (in %s)\nOutput: %s\nStderr: %s",
|
||||
\ jobid, s:shell_error, s:shellify(a:cmd), string(getcwd()), opts.output, opts.stderr))
|
||||
endif
|
||||
|
||||
return opts.output
|
||||
@ -163,7 +155,7 @@ function! s:check_clipboard() abort
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Get the latest Nvim Python client (pynvim) version from PyPI.
|
||||
" Get the latest Neovim Python client (pynvim) version from PyPI.
|
||||
function! s:latest_pypi_version() abort
|
||||
let pypi_version = 'unable to get pypi response'
|
||||
let pypi_response = s:download('https://pypi.python.org/pypi/pynvim/json')
|
||||
@ -180,7 +172,7 @@ endfunction
|
||||
|
||||
" Get version information using the specified interpreter. The interpreter is
|
||||
" used directly in case breaking changes were introduced since the last time
|
||||
" Nvim's Python client was updated.
|
||||
" Neovim's Python client was updated.
|
||||
"
|
||||
" Returns: [
|
||||
" {python executable version},
|
||||
@ -202,8 +194,7 @@ function! s:version_info(python) abort
|
||||
|
||||
let nvim_path = s:trim(s:system([
|
||||
\ a:python, '-c',
|
||||
\ 'import sys; ' .
|
||||
\ 'sys.path = list(filter(lambda x: x != "", sys.path)); ' .
|
||||
\ 'import sys; sys.path.remove(""); ' .
|
||||
\ 'import neovim; print(neovim.__file__)']))
|
||||
if s:shell_error || empty(nvim_path)
|
||||
return [python_version, 'unable to load neovim Python module', pypi_version,
|
||||
@ -224,7 +215,7 @@ function! s:version_info(python) abort
|
||||
\ 'print("{}.{}.{}{}".format(v.major, v.minor, v.patch, v.prerelease))'],
|
||||
\ '', 1, 1)
|
||||
if empty(nvim_version)
|
||||
let nvim_version = 'unable to find pynvim module version'
|
||||
let nvim_version = 'unable to find neovim Python module version'
|
||||
let base = fnamemodify(nvim_path, ':h')
|
||||
let metas = glob(base.'-*/METADATA', 1, 1)
|
||||
\ + glob(base.'-*/PKG-INFO', 1, 1)
|
||||
@ -266,33 +257,18 @@ function! s:check_bin(bin) abort
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
" Check "loaded" var for given a:provider.
|
||||
" Returns 1 if the caller should return (skip checks).
|
||||
function! s:disabled_via_loaded_var(provider) abort
|
||||
let loaded_var = 'g:loaded_'.a:provider.'_provider'
|
||||
if exists(loaded_var) && !exists('*provider#'.a:provider.'#Call')
|
||||
let v = eval(loaded_var)
|
||||
if 0 is v
|
||||
call health#report_info('Disabled ('.loaded_var.'='.v.').')
|
||||
return 1
|
||||
else
|
||||
call health#report_info('Disabled ('.loaded_var.'='.v.'). This might be due to some previous error.')
|
||||
endif
|
||||
endif
|
||||
return 0
|
||||
endfunction
|
||||
function! s:check_python(version) abort
|
||||
call health#report_start('Python ' . a:version . ' provider (optional)')
|
||||
|
||||
function! s:check_python() abort
|
||||
call health#report_start('Python 3 provider (optional)')
|
||||
|
||||
let pyname = 'python3'
|
||||
let pyname = 'python'.(a:version == 2 ? '' : '3')
|
||||
let python_exe = ''
|
||||
let venv = exists('$VIRTUAL_ENV') ? resolve($VIRTUAL_ENV) : ''
|
||||
let host_prog_var = pyname.'_host_prog'
|
||||
let loaded_var = 'g:loaded_'.pyname.'_provider'
|
||||
let python_multiple = []
|
||||
|
||||
if s:disabled_via_loaded_var(pyname)
|
||||
return
|
||||
if exists(loaded_var) && !exists('*provider#'.pyname.'#Call')
|
||||
call health#report_info('Disabled ('.loaded_var.'='.eval(loaded_var).'). This might be due to some previous error.')
|
||||
endif
|
||||
|
||||
let [pyenv, pyenv_root] = s:check_for_pyenv()
|
||||
@ -301,7 +277,7 @@ function! s:check_python() abort
|
||||
call health#report_info(printf('Using: g:%s = "%s"', host_prog_var, get(g:, host_prog_var)))
|
||||
endif
|
||||
|
||||
let [pyname, pythonx_warnings] = provider#pythonx#Detect(3)
|
||||
let [pyname, pythonx_errors] = provider#pythonx#Detect(a:version)
|
||||
|
||||
if empty(pyname)
|
||||
call health#report_warn('No Python executable found that can `import neovim`. '
|
||||
@ -310,10 +286,9 @@ function! s:check_python() abort
|
||||
let python_exe = pyname
|
||||
endif
|
||||
|
||||
" No Python executable could `import neovim`, or host_prog_var was used.
|
||||
if !empty(pythonx_warnings)
|
||||
call health#report_warn(pythonx_warnings, ['See :help provider-python for more information.',
|
||||
\ 'You may disable this provider (and warning) by adding `let g:loaded_python3_provider = 0` to your init.vim'])
|
||||
" No Python executable could `import neovim`.
|
||||
if !empty(pythonx_errors)
|
||||
call health#report_error('Python provider error:', pythonx_errors)
|
||||
|
||||
elseif !empty(pyname) && empty(python_exe)
|
||||
if !exists('g:'.host_prog_var)
|
||||
@ -364,7 +339,7 @@ function! s:check_python() abort
|
||||
\ && !empty(pyenv_root) && resolve(python_exe) !~# '^'.pyenv_root.'/'
|
||||
call health#report_warn('pyenv is not set up optimally.', [
|
||||
\ printf('Create a virtualenv specifically '
|
||||
\ . 'for Nvim using pyenv, and set `g:%s`. This will avoid '
|
||||
\ . 'for Neovim using pyenv, and set `g:%s`. This will avoid '
|
||||
\ . 'the need to install the pynvim module in each '
|
||||
\ . 'version/virtualenv.', host_prog_var)
|
||||
\ ])
|
||||
@ -378,7 +353,7 @@ function! s:check_python() abort
|
||||
if resolve(python_exe) !~# '^'.venv_root.'/'
|
||||
call health#report_warn('Your virtualenv is not set up optimally.', [
|
||||
\ printf('Create a virtualenv specifically '
|
||||
\ . 'for Nvim and use `g:%s`. This will avoid '
|
||||
\ . 'for Neovim and use `g:%s`. This will avoid '
|
||||
\ . 'the need to install the pynvim module in each '
|
||||
\ . 'virtualenv.', host_prog_var)
|
||||
\ ])
|
||||
@ -393,6 +368,18 @@ function! s:check_python() abort
|
||||
let python_exe = ''
|
||||
endif
|
||||
|
||||
" Check if $VIRTUAL_ENV is valid.
|
||||
if exists('$VIRTUAL_ENV') && !empty(python_exe)
|
||||
if $VIRTUAL_ENV ==# matchstr(python_exe, '^\V'.$VIRTUAL_ENV)
|
||||
call health#report_info('$VIRTUAL_ENV matches executable')
|
||||
else
|
||||
call health#report_warn(
|
||||
\ '$VIRTUAL_ENV exists but appears to be inactive. '
|
||||
\ . 'This could lead to unexpected results.',
|
||||
\ [ 'If you are using Zsh, see: http://vi.stackexchange.com/a/7654' ])
|
||||
endif
|
||||
endif
|
||||
|
||||
" Diagnostic output
|
||||
call health#report_info('Executable: ' . (empty(python_exe) ? 'Not found' : python_exe))
|
||||
if len(python_multiple)
|
||||
@ -401,30 +388,36 @@ function! s:check_python() abort
|
||||
endfor
|
||||
endif
|
||||
|
||||
let pip = 'pip' . (a:version == 2 ? '' : '3')
|
||||
|
||||
if empty(python_exe)
|
||||
" No Python executable can import 'neovim'. Check if any Python executable
|
||||
" can import 'pynvim'. If so, that Python failed to import 'neovim' as
|
||||
" well, which is most probably due to a failed pip upgrade:
|
||||
" https://github.com/neovim/neovim/wiki/Following-HEAD#20181118
|
||||
let [pynvim_exe, errors] = provider#pythonx#DetectByModule('pynvim', 3)
|
||||
let [pynvim_exe, errors] = provider#pythonx#DetectByModule('pynvim', a:version)
|
||||
if !empty(pynvim_exe)
|
||||
call health#report_error(
|
||||
\ 'Detected pip upgrade failure: Python executable can import "pynvim" but '
|
||||
\ . 'not "neovim": '. pynvim_exe,
|
||||
\ "Use that Python version to reinstall \"pynvim\" and optionally \"neovim\".\n"
|
||||
\ . pynvim_exe ." -m pip uninstall pynvim neovim\n"
|
||||
\ . pynvim_exe ." -m pip install pynvim\n"
|
||||
\ . pynvim_exe ." -m pip install neovim # only if needed by third-party software")
|
||||
\ . pip ." uninstall pynvim neovim\n"
|
||||
\ . pip ." install pynvim\n"
|
||||
\ . pip ." install neovim # only if needed by third-party software")
|
||||
endif
|
||||
else
|
||||
let [majorpyversion, current, latest, status] = s:version_info(python_exe)
|
||||
let [pyversion, current, latest, status] = s:version_info(python_exe)
|
||||
|
||||
if 3 != str2nr(majorpyversion)
|
||||
if a:version != str2nr(pyversion)
|
||||
call health#report_warn('Unexpected Python version.' .
|
||||
\ ' This could lead to confusing error messages.')
|
||||
endif
|
||||
|
||||
call health#report_info('Python version: ' . majorpyversion)
|
||||
if a:version == 3 && str2float(pyversion) < 3.3
|
||||
call health#report_warn('Python 3.3+ is recommended.')
|
||||
endif
|
||||
|
||||
call health#report_info('Python version: ' . pyversion)
|
||||
|
||||
if s:is_bad_response(status)
|
||||
call health#report_info(printf('pynvim version: %s (%s)', current, status))
|
||||
@ -435,7 +428,7 @@ function! s:check_python() abort
|
||||
if s:is_bad_response(current)
|
||||
call health#report_error(
|
||||
\ "pynvim is not installed.\nError: ".current,
|
||||
\ ['Run in shell: '. python_exe .' -m pip install pynvim'])
|
||||
\ ['Run in shell: '. pip .' install pynvim'])
|
||||
endif
|
||||
|
||||
if s:is_bad_response(latest)
|
||||
@ -480,83 +473,12 @@ function! s:check_for_pyenv() abort
|
||||
return [pyenv_path, pyenv_root]
|
||||
endfunction
|
||||
|
||||
" Resolves Python executable path by invoking and checking `sys.executable`.
|
||||
function! s:python_exepath(invocation) abort
|
||||
return s:normalize_path(system(fnameescape(a:invocation)
|
||||
\ . ' -c "import sys; sys.stdout.write(sys.executable)"'))
|
||||
endfunction
|
||||
|
||||
" Checks that $VIRTUAL_ENV Python executables are found at front of $PATH in
|
||||
" Nvim and subshells.
|
||||
function! s:check_virtualenv() abort
|
||||
call health#report_start('Python virtualenv')
|
||||
if !exists('$VIRTUAL_ENV')
|
||||
call health#report_ok('no $VIRTUAL_ENV')
|
||||
return
|
||||
endif
|
||||
let errors = []
|
||||
" Keep hints as dict keys in order to discard duplicates.
|
||||
let hints = {}
|
||||
" The virtualenv should contain some Python executables, and those
|
||||
" executables should be first both on Nvim's $PATH and the $PATH of
|
||||
" subshells launched from Nvim.
|
||||
let bin_dir = has('win32') ? '/Scripts' : '/bin'
|
||||
let venv_bins = glob($VIRTUAL_ENV . bin_dir . '/python*', v:true, v:true)
|
||||
" XXX: Remove irrelevant executables found in bin/.
|
||||
let venv_bins = filter(venv_bins, 'v:val !~# "python-config"')
|
||||
if len(venv_bins)
|
||||
for venv_bin in venv_bins
|
||||
let venv_bin = s:normalize_path(venv_bin)
|
||||
let py_bin_basename = fnamemodify(venv_bin, ':t')
|
||||
let nvim_py_bin = s:python_exepath(exepath(py_bin_basename))
|
||||
let subshell_py_bin = s:python_exepath(py_bin_basename)
|
||||
if venv_bin !=# nvim_py_bin
|
||||
call add(errors, '$PATH yields this '.py_bin_basename.' executable: '.nvim_py_bin)
|
||||
let hint = '$PATH ambiguities arise if the virtualenv is not '
|
||||
\.'properly activated prior to launching Nvim. Close Nvim, activate the virtualenv, '
|
||||
\.'check that invoking Python from the command line launches the correct one, '
|
||||
\.'then relaunch Nvim.'
|
||||
let hints[hint] = v:true
|
||||
endif
|
||||
if venv_bin !=# subshell_py_bin
|
||||
call add(errors, '$PATH in subshells yields this '
|
||||
\.py_bin_basename . ' executable: '.subshell_py_bin)
|
||||
let hint = '$PATH ambiguities in subshells typically are '
|
||||
\.'caused by your shell config overriding the $PATH previously set by the '
|
||||
\.'virtualenv. Either prevent them from doing so, or use this workaround: '
|
||||
\.'https://vi.stackexchange.com/a/34996'
|
||||
let hints[hint] = v:true
|
||||
endif
|
||||
endfor
|
||||
else
|
||||
call add(errors, 'no Python executables found in the virtualenv '.bin_dir.' directory.')
|
||||
endif
|
||||
|
||||
let msg = '$VIRTUAL_ENV is set to: '.$VIRTUAL_ENV
|
||||
if len(errors)
|
||||
if len(venv_bins)
|
||||
let msg .= "\nAnd its ".bin_dir.' directory contains: '
|
||||
\.join(map(venv_bins, "fnamemodify(v:val, ':t')"), ', ')
|
||||
endif
|
||||
let conj = "\nBut "
|
||||
for error in errors
|
||||
let msg .= conj.error
|
||||
let conj = "\nAnd "
|
||||
endfor
|
||||
let msg .= "\nSo invoking Python may lead to unexpected results."
|
||||
call health#report_warn(msg, keys(hints))
|
||||
else
|
||||
call health#report_info(msg)
|
||||
call health#report_info('Python version: '
|
||||
\.system('python -c "import platform, sys; sys.stdout.write(platform.python_version())"'))
|
||||
call health#report_ok('$VIRTUAL_ENV provides :!python.')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:check_ruby() abort
|
||||
call health#report_start('Ruby provider (optional)')
|
||||
|
||||
if s:disabled_via_loaded_var('ruby')
|
||||
let loaded_var = 'g:loaded_ruby_provider'
|
||||
if exists(loaded_var) && !exists('*provider#ruby#Call')
|
||||
call health#report_info('Disabled. '.loaded_var.'='.eval(loaded_var))
|
||||
return
|
||||
endif
|
||||
|
||||
@ -566,21 +488,20 @@ function! s:check_ruby() abort
|
||||
\ ['Install Ruby and verify that `ruby` and `gem` commands work.'])
|
||||
return
|
||||
endif
|
||||
call health#report_info('Ruby: '. s:system(['ruby', '-v']))
|
||||
call health#report_info('Ruby: '. s:system('ruby -v'))
|
||||
|
||||
let [host, err] = provider#ruby#Detect()
|
||||
let host = provider#ruby#Detect()
|
||||
if empty(host)
|
||||
call health#report_warn('`neovim-ruby-host` not found.',
|
||||
\ ['Run `gem install neovim` to ensure the neovim RubyGem is installed.',
|
||||
\ 'Run `gem environment` to ensure the gem bin directory is in $PATH.',
|
||||
\ 'If you are using rvm/rbenv/chruby, try "rehashing".',
|
||||
\ 'See :help g:ruby_host_prog for non-standard gem installations.',
|
||||
\ 'You may disable this provider (and warning) by adding `let g:loaded_ruby_provider = 0` to your init.vim'])
|
||||
\ 'See :help g:ruby_host_prog for non-standard gem installations.'])
|
||||
return
|
||||
endif
|
||||
call health#report_info('Host: '. host)
|
||||
|
||||
let latest_gem_cmd = has('win32') ? 'cmd /c gem list -ra "^^neovim$"' : 'gem list -ra ^neovim$'
|
||||
let latest_gem_cmd = has('win32') ? 'cmd /c gem list -ra ^^neovim$' : 'gem list -ra ^neovim$'
|
||||
let latest_gem = s:system(split(latest_gem_cmd))
|
||||
if s:shell_error || empty(latest_gem)
|
||||
call health#report_error('Failed to run: '. latest_gem_cmd,
|
||||
@ -588,13 +509,13 @@ function! s:check_ruby() abort
|
||||
\ 'Are you behind a firewall or proxy?'])
|
||||
return
|
||||
endif
|
||||
let latest_gem = get(split(latest_gem, 'neovim (\|, \|)$' ), 0, 'not found')
|
||||
let latest_gem = get(split(latest_gem, 'neovim (\|, \|)$' ), 1, 'not found')
|
||||
|
||||
let current_gem_cmd = [host, '--version']
|
||||
let current_gem_cmd = host .' --version'
|
||||
let current_gem = s:system(current_gem_cmd)
|
||||
if s:shell_error
|
||||
call health#report_error('Failed to run: '. join(current_gem_cmd),
|
||||
\ ['Report this issue with the output of: ', join(current_gem_cmd)])
|
||||
call health#report_error('Failed to run: '. current_gem_cmd,
|
||||
\ ['Report this issue with the output of: ', current_gem_cmd])
|
||||
return
|
||||
endif
|
||||
|
||||
@ -611,7 +532,9 @@ endfunction
|
||||
function! s:check_node() abort
|
||||
call health#report_start('Node.js provider (optional)')
|
||||
|
||||
if s:disabled_via_loaded_var('node')
|
||||
let loaded_var = 'g:loaded_node_provider'
|
||||
if exists(loaded_var) && !exists('*provider#node#Call')
|
||||
call health#report_info('Disabled. '.loaded_var.'='.eval(loaded_var))
|
||||
return
|
||||
endif
|
||||
|
||||
@ -621,10 +544,10 @@ function! s:check_node() abort
|
||||
\ ['Install Node.js and verify that `node` and `npm` (or `yarn`) commands work.'])
|
||||
return
|
||||
endif
|
||||
let node_v = get(split(s:system(['node', '-v']), "\n"), 0, '')
|
||||
let node_v = get(split(s:system('node -v'), "\n"), 0, '')
|
||||
call health#report_info('Node.js: '. node_v)
|
||||
if s:shell_error || s:version_cmp(node_v[1:], '6.0.0') < 0
|
||||
call health#report_warn('Nvim node.js host does not support '.node_v)
|
||||
if !s:shell_error && s:version_cmp(node_v[1:], '6.0.0') < 0
|
||||
call health#report_warn('Neovim node.js host does not support '.node_v)
|
||||
" Skip further checks, they are nonsense if nodejs is too old.
|
||||
return
|
||||
endif
|
||||
@ -632,15 +555,14 @@ function! s:check_node() abort
|
||||
call health#report_warn('node.js on this system does not support --inspect-brk so $NVIM_NODE_HOST_DEBUG is ignored.')
|
||||
endif
|
||||
|
||||
let [host, err] = provider#node#Detect()
|
||||
let host = provider#node#Detect()
|
||||
if empty(host)
|
||||
call health#report_warn('Missing "neovim" npm (or yarn) package.',
|
||||
\ ['Run in shell: npm install -g neovim',
|
||||
\ 'Run in shell (if you use yarn): yarn global add neovim',
|
||||
\ 'You may disable this provider (and warning) by adding `let g:loaded_node_provider = 0` to your init.vim'])
|
||||
\ 'Run in shell (if you use yarn): yarn global add neovim'])
|
||||
return
|
||||
endif
|
||||
call health#report_info('Nvim node.js host: '. host)
|
||||
call health#report_info('Neovim node.js host: '. host)
|
||||
|
||||
let manager = executable('npm') ? 'npm' : 'yarn'
|
||||
let latest_npm_cmd = has('win32') ?
|
||||
@ -653,18 +575,20 @@ function! s:check_node() abort
|
||||
\ 'Are you behind a firewall or proxy?'])
|
||||
return
|
||||
endif
|
||||
try
|
||||
let pkg_data = json_decode(latest_npm)
|
||||
catch /E474/
|
||||
return 'error: '.latest_npm
|
||||
endtry
|
||||
let latest_npm = get(get(pkg_data, 'dist-tags', {}), 'latest', 'unable to parse')
|
||||
if !empty(latest_npm)
|
||||
try
|
||||
let pkg_data = json_decode(latest_npm)
|
||||
catch /E474/
|
||||
return 'error: '.latest_npm
|
||||
endtry
|
||||
let latest_npm = get(get(pkg_data, 'dist-tags', {}), 'latest', 'unable to parse')
|
||||
endif
|
||||
|
||||
let current_npm_cmd = ['node', host, '--version']
|
||||
let current_npm = s:system(current_npm_cmd)
|
||||
if s:shell_error
|
||||
call health#report_error('Failed to run: '. join(current_npm_cmd),
|
||||
\ ['Report this issue with the output of: ', join(current_npm_cmd)])
|
||||
call health#report_error('Failed to run: '. string(current_npm_cmd),
|
||||
\ ['Report this issue with the output of: ', string(current_npm_cmd)])
|
||||
return
|
||||
endif
|
||||
|
||||
@ -679,85 +603,10 @@ function! s:check_node() abort
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:check_perl() abort
|
||||
call health#report_start('Perl provider (optional)')
|
||||
|
||||
if s:disabled_via_loaded_var('perl')
|
||||
return
|
||||
endif
|
||||
|
||||
let [perl_exec, perl_warnings] = provider#perl#Detect()
|
||||
if empty(perl_exec)
|
||||
if !empty(perl_warnings)
|
||||
call health#report_warn(perl_warnings, ['See :help provider-perl for more information.',
|
||||
\ 'You may disable this provider (and warning) by adding `let g:loaded_perl_provider = 0` to your init.vim'])
|
||||
else
|
||||
call health#report_warn('No usable perl executable found')
|
||||
endif
|
||||
return
|
||||
endif
|
||||
|
||||
call health#report_info('perl executable: '. perl_exec)
|
||||
|
||||
" we cannot use cpanm that is on the path, as it may not be for the perl
|
||||
" set with g:perl_host_prog
|
||||
call s:system([perl_exec, '-W', '-MApp::cpanminus', '-e', ''])
|
||||
if s:shell_error
|
||||
return [perl_exec, '"App::cpanminus" module is not installed']
|
||||
endif
|
||||
|
||||
let latest_cpan_cmd = [perl_exec,
|
||||
\ '-MApp::cpanminus::fatscript', '-e',
|
||||
\ 'my $app = App::cpanminus::script->new;
|
||||
\ $app->parse_options ("--info", "-q", "Neovim::Ext");
|
||||
\ exit $app->doit']
|
||||
|
||||
let latest_cpan = s:system(latest_cpan_cmd)
|
||||
if s:shell_error || empty(latest_cpan)
|
||||
call health#report_error('Failed to run: '. join(latest_cpan_cmd, " "),
|
||||
\ ["Make sure you're connected to the internet.",
|
||||
\ 'Are you behind a firewall or proxy?'])
|
||||
return
|
||||
elseif latest_cpan[0] ==# '!'
|
||||
let cpanm_errs = split(latest_cpan, '!')
|
||||
if cpanm_errs[0] =~# "Can't write to "
|
||||
call health#report_warn(cpanm_errs[0], cpanm_errs[1:-2])
|
||||
" Last line is the package info
|
||||
let latest_cpan = cpanm_errs[-1]
|
||||
else
|
||||
call health#report_error('Unknown warning from command: ' . latest_cpan_cmd, cpanm_errs)
|
||||
return
|
||||
endif
|
||||
endif
|
||||
let latest_cpan = matchstr(latest_cpan, '\(\.\?\d\)\+')
|
||||
if empty(latest_cpan)
|
||||
call health#report_error('Cannot parse version number from cpanm output: ' . latest_cpan)
|
||||
return
|
||||
endif
|
||||
|
||||
let current_cpan_cmd = [perl_exec, '-W', '-MNeovim::Ext', '-e', 'print $Neovim::Ext::VERSION']
|
||||
let current_cpan = s:system(current_cpan_cmd)
|
||||
if s:shell_error
|
||||
call health#report_error('Failed to run: '. join(current_cpan_cmd),
|
||||
\ ['Report this issue with the output of: ', join(current_cpan_cmd)])
|
||||
return
|
||||
endif
|
||||
|
||||
if s:version_cmp(current_cpan, latest_cpan) == -1
|
||||
call health#report_warn(
|
||||
\ printf('Module "Neovim::Ext" is out-of-date. Installed: %s, latest: %s',
|
||||
\ current_cpan, latest_cpan),
|
||||
\ ['Run in shell: cpanm -n Neovim::Ext'])
|
||||
else
|
||||
call health#report_ok('Latest "Neovim::Ext" cpan module is installed: '. current_cpan)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! health#provider#check() abort
|
||||
call s:check_clipboard()
|
||||
call s:check_python()
|
||||
call s:check_virtualenv()
|
||||
call s:check_python(2)
|
||||
call s:check_python(3)
|
||||
call s:check_ruby()
|
||||
call s:check_node()
|
||||
call s:check_perl()
|
||||
endfunction
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user