Skip to content

Commit e70b9b9

Browse files
committed
feat: add LSP support and Vim Help files, Vim Snippet files
1 parent 6b1b328 commit e70b9b9

18 files changed

+1454
-25
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
7+
charset = utf-8
8+
indent_style = space
9+
indent_size = 2
10+
11+
[Makefile]
12+
indent_style = tab
13+
indent_size = 8

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
out/**/*

.eslintrc

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": [
3+
"eslint-config-egg/typescript"
4+
],
5+
"parserOptions": {
6+
"project": "./tsconfig.json"
7+
},
8+
"rules": {
9+
"@typescript-eslint/ban-types": "off"
10+
}
11+
}

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,5 @@ typings/
6060
# next.js build output
6161
.next
6262

63-
*.vsix
63+
*.vsix
64+
out

.vscode/settings.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"eslint.validate": [
3+
"javascript",
4+
"javascriptreact",
5+
{
6+
"language": "typescript",
7+
"autoFix": true
8+
},
9+
]
10+
}

.vscode/tasks.json

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"tasks": [
3+
{
4+
"type": "typescript",
5+
"tsconfig": "tsconfig.json",
6+
"option": "watch",
7+
"presentation": {
8+
"echo": true,
9+
"reveal": "silent",
10+
"focus": false,
11+
"panel": "shared"
12+
},
13+
"isBackground": true,
14+
"runOptions": {
15+
"runOn": "folderOpen"
16+
},
17+
"problemMatcher": [
18+
"$tsc-watch"
19+
],
20+
"group": {
21+
"kind": "build",
22+
"isDefault": true
23+
}
24+
}
25+
]
26+
}

.vscodeignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.vscode/**
22
.gitignore
3-
node_modules
43

5-
*.vsix
4+
*.vsix
5+
src

Makefile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
UPDATE_GRAMMAR_BIN = ./node_modules/.bin/update-grammar
2+
3+
.PHONY: update_grammar pack
4+
5+
update-grammar:
6+
$(UPDATE_GRAMMAR_BIN) Alhadis/language-viml grammars/viml.cson syntaxes/viml.tmLanguage.json
7+
$(UPDATE_GRAMMAR_BIN) Alhadis/language-viml grammars/help.cson syntaxes/help.tmLanguage.json
8+
$(UPDATE_GRAMMAR_BIN) Alhadis/language-viml grammars/snippet.cson syntaxes/snippet.tmLanguage.json
9+
10+
pack:
11+
npm install
12+
npm run compile
13+
rm -rf node_modules
14+
npm install --prod

README.md

+15-7
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,26 @@ Vim Script language support for VSCode.
1010
1111
## Features
1212

13-
+ Syntax highlighting for VimL files.
13+
+ Syntax highlighting for VimL files;
14+
+ Syntax highlighting for Vim Help files and Vim Snippet files;
1415
+ By default, the following file types will be highlighted:
1516
- `*.vim`
16-
- `*.vimrc`
17+
- `*.vimrc` / `_vimrc`
1718
- `*.gvimrc`
1819
- `*.ideavim` / `.ideavim` / `.ideavimrc`
1920
- `*.exrc`
20-
21-
## TODO
22-
23-
+ Code Completion
24-
+ Code Validation
21+
+ Language Server Protocol (By https://github.com/iamcco/vim-language-server)
22+
- Auto completion;
23+
- Funciton signature help;
24+
- Hover document;
25+
- Go to definition;
26+
- Go to references;
27+
- Document symbols;
28+
- Folding range;
29+
- Select range;
30+
- Rename;
31+
- Snippets;
32+
- Diagnostic.
2533

2634
## Contribution
2735

cgmanifest.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
"git": {
77
"name": "Alhadis/language-viml",
88
"repositoryUrl": "https://github.com/Alhadis/language-viml",
9-
"commitHash": "5030985ab9f5a84a3a18d999d7c3a82f581b0283"
9+
"commitHash": "a8e1770846b4d994ab2be04371f7d97a16b1a08f"
1010
},
1111
"license": "MIT",
1212
"description": "Vim Script language support for Atom"
1313
},
14-
"version": "1.2.3"
14+
"version": "1.2.2"
1515
}
1616
]
1717
}

package.json

+55-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
{
22
"name": "viml",
33
"displayName": "VimL (Vim Language, Vim Script)",
4-
"version": "1.1.1",
4+
"version": "2.0.0",
55
"description": "Vim Script language support for VSCode.",
66
"scripts": {
7-
"update-grammar": "update-grammar Alhadis/language-viml grammars/viml.cson syntaxes/viml.tmLanguage.json",
8-
"update-changelog": "auto-changelog -p"
7+
"update-grammar": "make update-grammar",
8+
"update-changelog": "auto-changelog -p",
9+
"postinstall": "rm -f package-lock.json",
10+
"compile": "tsc -p ./",
11+
"vscode:prepublish": "make pack"
912
},
1013
"engines": {
1114
"vscode": "^1.20.0"
@@ -30,15 +33,40 @@
3033
},
3134
"icon": "assets/logo.png",
3235
"devDependencies": {
36+
"@types/node": "^17.0.21",
37+
"@types/vscode": "^1.20.0",
3338
"auto-changelog": "^2.4.0",
39+
"eslint": "^8.0.0",
40+
"eslint-config-egg": "^11.0.0",
41+
"typescript": "^4.6.2",
3442
"vscode-update-grammar-tool": "^1.0.0"
3543
},
3644
"contributes": {
45+
"configuration": {
46+
"title": "VimL",
47+
"properties": {
48+
"viml.highVimHelpIndentStylePriority": {
49+
"type": "boolean",
50+
"default": true,
51+
"description": "Force use 8-spaces-size and tab as Vim Help file's indentation style (Even higher priority than EditorConfig, etc.)"
52+
}
53+
}
54+
},
3755
"grammars": [
3856
{
3957
"language": "viml",
4058
"scopeName": "source.viml",
4159
"path": "./syntaxes/viml.tmLanguage.json"
60+
},
61+
{
62+
"language": "vim-help",
63+
"scopeName": "text.vim-help",
64+
"path": "./syntaxes/help.tmLanguage.json"
65+
},
66+
{
67+
"language": "vim-snippet",
68+
"scopeName": "source.vim-snippet",
69+
"path": "./syntaxes/snippet.tmLanguage.json"
4270
}
4371
],
4472
"languages": [
@@ -62,8 +90,31 @@
6290
".ideavim",
6391
".ideavimrc"
6492
],
65-
"configuration": "./language-configuration.json"
93+
"configuration": "./syntaxes/viml.language-configuration.json"
94+
},
95+
{
96+
"id": "vim-help",
97+
"aliases": [ "Vim Help" ],
98+
"configuration": "./syntaxes/help.language-configuration.json"
99+
},
100+
{
101+
"id": "vim-snippet",
102+
"aliases": [ "Vim Snippet" ],
103+
"extensions": [
104+
".snip",
105+
".snippet",
106+
".snippets"
107+
],
108+
"configuration": "./syntaxes/snippet.language-configuration.json"
66109
}
67110
]
111+
},
112+
"activationEvents": [
113+
"onStartupFinished"
114+
],
115+
"main": "./out/extension.js",
116+
"dependencies": {
117+
"vim-language-server": "^2.2.6",
118+
"vscode-languageclient": "^7.0.0"
68119
}
69120
}

0 commit comments

Comments
 (0)