-
Notifications
You must be signed in to change notification settings - Fork 3
/
notes.txt
113 lines (67 loc) · 2.15 KB
/
notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
## Notes on Development with Vim and YCMD
Make sure to put the YouCompleteMe directory in ~/.vim/bundle
I achieved with a symlink to my development directory.
Additionally, my YCMD fork, is symlinked into YouCompleteMe
## Accessing the latest log:
vim /var/folders/9q/40k26bk91j14s13tgl05dfkh0000gn/T/`ls -tr
/var/folders/9q/40k26bk91j14s13tgl05dfkh0000gn/T/ | grep jedi | tail -1`
# Code and Run
It is possible to edit the python code and just restart the server, without
building!
# Diagnostics
These only work when editor open follows an editor replacetext command
# Errors
We can't get a correct import for foundation
## Build System
SSVI uses CMake to build
# Using CMake
The main target, `http_server` can be built with CMake
```
mkdir -p build
cd build
cmake -G "Unix Makefiles" ..
```
And then make
```
make
``
Optionally, you can use Xcode or your favorite IDE with CMake generators, but
that would be ironic since this is a vim plugin.
## HTTP Server
SSVI http backed is build ontop of Boost.ASIO and Beast HTTP.
Start up the server after building
```
build/http_server
```
The HTTP server uses a JSON post body
Its easy to test with Curl.
```
curl -H "Content-Type: application/json" -X POST -d '{"test-key":"test-value"}' http://0.0.0.0:8080/
```
Completions
```
curl -H "Content-Type: application/json" -X POST -d '{\
"flags":["-foo"],\
"unsaved_files":["some foo"],\
"line":19,\
"column":15,\
"file_name":"/path/to/foo",\
}' http://0.0.0.0:8080/completions
```
```
curl -H "Content-Type: application/json" -X P
OST -d '{"line":19,"column":15,"file_name":"a", "unsaved_files": ["f4"]
, "flags": ["ja"]}' http://0.0.0.0:8080/completions
``
## Setting up Vim.
CMake already has the ability to generate compile commands
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 "Unix Makefiles" ..
The compile commands are in build/compile_commands.json
## Making sure file type is working
YCM uses the vim file type in the current buffer to identify what completion engine to use and more.
Assert this is set to the correct value
:set ft?
manually set
:set ft=swift
Set automatically in your vimrc
autocmd BufNewFile,BufRead *.swift set filetype=swift