Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit bcefb0e

Browse files
Prepare for every rb file
1 parent 60ccb11 commit bcefb0e

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

‎ftplugin/ruby.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
"setlocal completefunc=solargraph#CompleteSolar
22
setlocal omnifunc=solargraph#CompleteSolar
3+
"call RubySolarPrepare()
4+
execute RubySolarPrepare()

‎plugin/main.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
class VimSolargraph
55
def initialize(workspace)
6-
VIM::message "Parsing files..."
6+
#VIM::message "Parsing Ruby files..."
77
@cw = VIM::Window.current
88
@cb = VIM::Buffer.current
99

@@ -25,6 +25,15 @@ def initialize(workspace)
2525
end
2626

2727

28+
def prepare
29+
#puts "Parsing Ruby files..."
30+
#VIM::evaluate( "echomParsing Ruby files...")
31+
VIM::message "Parsing Ruby files..."
32+
RestClient.post "http://localhost:7657/prepare", {"workspace": @workspace}
33+
return nil
34+
end
35+
36+
2837
def suggest
2938
#RestClient.post "http://localhost:7657/prepare"
3039
data = RestClient.post "http://localhost:7657/suggest",

‎plugin/solargraph.vim

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ function! RubySolar()
3535
EOF
3636
endfunction
3737

38+
function! RubySolarPrepare()
39+
ruby << EOF
40+
ko = VimSolargraph.new( VIM::evaluate("s:Setcwd()") )
41+
ko.prepare
42+
EOF
43+
endfunction
3844

3945

4046
function! solargraph#CompleteSolar(findstart, base)
@@ -58,3 +64,7 @@ function! solargraph#CompleteSolar(findstart, base)
5864
return res
5965
endif
6066
endfun
67+
68+
function! HAHA()
69+
execute 'silent echomsg "SKATA"'
70+
endfun

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /