Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove .vim files. They'll be released independently. See README.mark…

…down
  • Loading branch information...
commit ab6cd75161b058317f7fd0d7c8cc416a57ec54b2 1 parent d9194d5
@MarcWeber MarcWeber authored nominolo committed
View
92 README.markdown
@@ -192,97 +192,7 @@ convenient to start the server from within Emacs:
Vim
===
-## Installation
-
-Vim mode requires Python support (version 2.4 or later). Vim 7.2 or
-later have Python support enabled by default. However, not every
-distribution of Vim includes a recent enough version of Python.
-Notably, MacVim is only linked against version 2.3.5 to be compatible
-with OS X 10.4. You will need to build it from source, which is
-however reasonably fast.
-
-To check for python support the following should return `1`:
-
- :echo has('python')
-
-To find out the version use:
-
- :py import sys
- :py print sys.version
-
-Add the following to your `~/.vimrc` (or only `~/.gvimrc` if you have
-different Vim versions). If Vim should start the Scion server itself
-(recommended):
-
- " recommended: vim spawns a scion instance itself:
- let g:scion_connection_setting = [ 'scion', "<path/to/scion-server>"]
-
-Note that there may be problems using "~" in the path, so better
-specify the absolute path.
-
-If you want to connect to a running instance of the server via TCP,
-add (where `4005` is the port number used by the scion server):
-
- " use socket or TCP/IP connection instead:
- let g:scion_connection_setting = [ 'socket', ["localhost", 4005] ]
-
-Add the following independently of which connection mode you prefer:
-
- set runtimepath+=<home>/.cabal/share/scion-<version>/vim_runtime_path/
-
-Depending on your Vim config you will need to add the following lines
-as well:
-
- :filetype plugin on
- :source <home>/.cabal/share/scion-<version>/vim_runtime_path/plugin/haskell_scion.vim
-
-You store certain settings in a configuration file. (Note: This
-feature is currently experimental and details may change in future
-Scion releases.) To generate an initial configuration file run
-
- :WriteSampleConfigScion
-
-Keep only these lines:
-
- {"type":"build-configuration", "dist-dir":"dist-scion", "extra-args": []}
- {"scion-default-cabal-config":"dist-scion"}
-
-## Usage
-
-To load a component (a Cabal library or executable, or just a single
-file) use one of:
-
- :LoadComponentScion library
- :LoadComponentScion executable:cabal_executable_name
- :LoadComponentScion file:cabal_executable_name
- :LoadComponentScion
-
-The last one is a shortcut for `file:<this buf>`. You can use completion.
-
-At this point you should already get some compilation errors. After
-modifying the file, use
-
- :BackgroundTypecheckFileScion
-
-to re-typecheck just the current file.
-
-If the file typechecks you can move the cursor onto an identifier and
-use the command
-
- :ThingAtPointScion
-
-You should see something like this, which is the (instantiated) type
-of the identifier at the point:
-
- {'Just': 'print :: [Char] -> IO ()'}
-
-Have a look at `vim_runtime_path/ftplugin/haskell.vim` to see a list of all
-commands which are implemented yet.
-
-`BackgroundTypecheckFileScion` should be called automatically after
-buf write. If you don't like this set `g:dont_check_on_buf_write` or
-overwrite `g:haskell_qf_hook` to change open/close quickfix and jump to
-first *error* behaviour.
+Vim backend code is hosted on http://github.com/MarcWeber/scion-backend-vim
Discussion
==========
View
3  scion.cabal
@@ -24,9 +24,6 @@ cabal-version: >= 1.6
extra-source-files: README.markdown
data-files:
emacs/*.el
- vim_runtime_path/autoload/*.vim
- vim_runtime_path/ftplugin/*.vim
- vim_runtime_path/plugin/*.vim
flag testing
description: Enable Debugging things like QuickCheck properties, etc.
View
367 vim_runtime_path/autoload/haskellcomplete.vim
@@ -1,367 +0,0 @@
-" This file contains the code necessary to talk to the scion server
-" -> haskellcomplete#EvalScion )
-"
-" This implementation requires has('python') support
-
-" You can look up some use cases in the ftplugin file.
-"
-" This code is based on the initial implementation found in shim by Benedikt Schmidt
-" The server side code can be found in src-scion-server/Scion/Server/ProtocolVim.hs
-
-if exists('g:tovl')
- fun! s:Log(level, msg)
- call tovl#log#Log("haskellcomplete",a:level, type(a:msg) == type("") ? a:msg : string(a:msg))
- endf
-else
- fun! s:Log(level, msg)
- echoe a:msg
- endf
-endif
-
-" require python or exit
-if !has('python') | call s:Log(0, "Error: scion requires vim compiled with +python") | finish | endif
-
-let g:vim_scion_protocol_version = "0"
-
-fun! haskellcomplete#LoadComponent(set_cabal_project, component)
- let result = haskellcomplete#EvalScion(0, 'load', { 'component' : a:component})
- if has_key(result,'error')
- if result['error']['message'] == "NoCurrentCabalProject" && a:set_cabal_project
- let cabal_project = haskellcomplete#SetCurrentCabalProject()
- return haskellcomplete#LoadComponent(0, a:component)
- else
- throw "can't handle this failure: ".string(result['error'])
- endif
- endif
- return result['result']
-endf
-
-fun! haskellcomplete#SetCurrentCabalProject()
- let configs = haskellcomplete#EvalScion(1,'list-cabal-configurations',
- \ { 'cabal-file' : haskellcomplete#CabalFile()
- \ , 'scion-default': json#IntToBool(get(g:scion_config, "use_default_scion_cabal_dist_dir", 1)) })
- let config = haskellcomplete#ChooseFromList(configs, 'select a cabal configuration')
- let result = haskellcomplete#EvalScion(1,'open-cabal-project'
- \ ,{'root-dir' : getcwd()
- \ ,'dist-dir' : config['dist-dir']
- \ ,'extra-args' : config['extra-args'] }
- \ )
-endf
-
-fun! haskellcomplete#ScionResultToErrorList(action, func, result)
- let qflist = []
- for dict in a:result['notes']
- let loc = dict['location']
- if has_key(loc, 'no-location')
- " using no-location so that we have an item to jump to.
- " ef we don't use that dummy file SaneHook won't see any errors!
- call add(qflist, { 'filename' : 'no-location'
- \ ,'lnum' : 0
- \ ,'col' : 0
- \ ,'text' : loc['no-location']
- \ ,'type' : dict['kind'] == "error" ? "E" : "W"
- \ })
- else
- call add(qflist, { 'filename' : loc['file']
- \ ,'lnum' : loc['region'][0]
- \ ,'col' : loc['region'][1]
- \ ,'text' : ''
- \ ,'type' : dict['kind'] == "error" ? "E" : "W"
- \ })
- endif
- for msgline in split(dict['message'],"\n")
- call add(qflist, {'text': msgline})
- endfor
- endfor
-
- call call(a:func, [qflist])
- if exists('g:haskell_qf_hook')
- exec g:haskell_qf_hook
- endif
- if (len(qflist) == 0)
- return printf(a:action." success. compilationTime: %s", string(a:result['duration']))
- else
- return printf(a:action." There are errors. compilationTime: %s", string(a:result['duration']))
- endif
-endfun
-
-
-" if there is item take it, if there are more than one ask user which one to
-" use.. -- don't think cabal allows multiple .cabal files.. At least the user
-" is notified that there are more than one .cabal files
-fun! haskellcomplete#ChooseFromList(list, ...)
- let msg = a:0 > 0 ? a:1 : "choose from list"
- if empty(a:list)
- return
- elseif len(a:list) == 1
- return a:list[0]
- else
- let l = []
- let i = 1
- for line in a:list
- let line2 = type(line) != type('') ? string(line) : line
- call add(l, i.': '.line2)
- let i = i + 1
- unlet line
- endfor
- return a:list[inputlist(l)-1]
- endif
-endf
-
-fun! haskellcomplete#CabalFile()
- if !exists('g:cabal_file')
- let list = split(glob('*.cabal'),"\n")
- if empty(list)
- throw "no cabal file found"
- endif
- let g:cabal_file = getcwd().'/'.haskellcomplete#ChooseFromList(list)
- endif
- return g:cabal_file
-endf
-
-fun! haskellcomplete#List(what)
- return haskellcomplete#EvalScion(1,'list-'.a:what, {})
-endf
-
-fun! haskellcomplete#OpenCabalProject(method, ...)
- return haskellcomplete#EvalScion(1,a:method
- \ ,{'root-dir' : getcwd()
- \ ,'dist-dir' : a:1
- \ ,'extra-args' : a:000[1:] }
- \ )
-endf
-
-fun! haskellcomplete#compToV(...)
- let component = a:0 > 0 ? a:1 : 'file:'.expand('%:p')
- let m = matchstr(component, '^executable:\zs.*')
- if m != '' | return {'executable' : m} | endif
- let m = matchstr(component, '^library$')
- if m != '' | return {'library' : json#NULL()} | endif
- let m = matchstr(component, '^file:\zs.*')
- if m != '' | return {'file' : m} | endif
- throw "invalid component".component
-endfun
-
-fun! haskellcomplete#WriteSampleConfig(...)
- let file = a:0 > 0 ? a:1 : ".scion-config"
- let file = fnamemodify(file, ":p")
- return haskellcomplete#EvalScion(1, 'write-sample-config', {'file' : file})
-endf
-
-" if there are errors open quickfix and jump to first error (ignoring warning)
-" if not close it
-fun! haskellcomplete#SaneHook()
- let list = getqflist()
- let nr = 0
- let open = 0
- let firstError = 0
- for i in getqflist()
- let nr = nr +1
- if i['bufnr'] == 0 | continue | endif
- if i['type'] == "E" && firstError == 0
- let firstError = nr
- endif
- let open = 1
- endfor
- if open
- cope " open
- " move to first error
- if firstError > 0 | exec "crewind ".firstError | endif
- else
- cclose
- endif
-endf
-
-" use this to connect to a socket
-" connection settings: see strings in connectscion
-
-" returns string part before and after cursor
-function! haskellcomplete#BcAc()
- let pos = col('.') -1
- let line = getline('.')
- return [strpart(line,0,pos), strpart(line, pos, len(line)-pos)]
-endfunction
-
-" completion functions
-if !exists('g:haskellcompleteAll')
- let g:haskellcompleteAll='' " '' or '-all' '-all' means complete from the set of all function exported by all modules found in all used packages
-endif
-
-fun! haskellcomplete#CompletModule(findstart, base)
- if a:findstart
- let [bc,ac] = haskellcomplete#BcAc()
- return len(bc)-len(matchstr(bc,'\S*$'))
- else
- let [bc,ac] = haskellcomplete#BcAc()
- let addImport = bc !~ 'import\s\+\S*$'
- let matches = haskellcomplete#EvalScion(
- \ { 'request' : 'cmdModuleCompletion'
- \ , 'camelCase' : 'True'
- \ , 'short' : a:base
- \ })
- if addImport
- call map(matches, string('import ').'.v:val')
- endif
- return matches
- endif
-endf
-
-let g:scion_request_id = 1
-
-" name: method name
-" params: params to method
-" optional argument: continuation function (not yet implemented)
-" returns: nothing when continuation function is given
-" reply else
-function! haskellcomplete#EvalScion(fail_on_error, method, params, ...)
- if a:0 > 0
- let continuation a:0
- endif
- let g:scion_request_id = g:scion_request_id + 1
- let request = { 'method' : a:method, 'params' : a:params, 'id' : g:scion_request_id }
- " the first string converts the vim object into a string, the second
- " converts this string into a python string
- let g:scion_arg = json#Encode(request)
- py evalscionAssign(vim.eval('g:scion_arg'))
- " warnings
- for w in get(g:scion_result, 'warnings', [])
- call s:Log(1, w) | echo w
- endfor
- " errors
-
- if !a:fail_on_error
- return g:scion_result
- endif
-
- if has_key(g:scion_result,'error')
- call s:Log(0, g:scion_result['error'])
- throw "There was a scion server error :".string(g:scion_result['error'])
- else
- return g:scion_result['result']
- endif
-endfunction
-
-function! s:DefPython()
-python << PYTHONEOF
-import sys, tokenize, cStringIO, types, socket, string, vim, popen2, os
-from subprocess import Popen, PIPE
-
-scion_log_stdout = vim.eval('exists("g:scion_log_stdout") && g:scion_log_stdout')
-scion_stdout = []
-
-class ScionServerConnection:
- """base of a server connection. They all provide two methods: send and receive bothe sending or receiving a single line separated by \\n"""
- def send(self, line):
- self.scion_i.write("%s\n"%line)
- self.scion_i.flush()
- def receive(self):
- s = self.scion_o.readline()
- if s == "":
- raise "EOF, stderr lines: \n%s"%self.scion_err.read()
- else:
- return s[:-1]
-
-class ScionServerConnectionStdinOut(ScionServerConnection):
- """this connection launches the server and connects to its stdin and stdout streams"""
- def __init__(self, scion_executable):
- #self.scion_o,self.scion_i,e = popen2.popen3('%s -i -f /tmp/scion-log-%s' % (scion_executable, os.getcwd().replace('/','_').replace('\\','_'))
- p = Popen([scion_executable,"-i","-f", "/tmp/scion-log-%s"%(os.getcwd().replace('/','_').replace('\\','_'))], \
- shell = False, bufsize = 1, stdin = PIPE, stdout = PIPE, stderr = PIPE)
- self.scion_o = p.stdout
- self.scion_i = p.stdin
- self.scion_err = p.stderr
-
- def receive(self):
- global scion_log_stdout, scion_stdout
- s = ScionServerConnection.receive(self)
-
- # ghc doesn't always use the ghc API to print statements.. so ignore all
- # lines not marked by "scion:" at the beginning
- # see README.markdown
- while s[:6] != "scion:":
- # throw away non "scion:" line and try again
- if scion_log_stdout:
- scion_stdout.append(s)
- scion_stdout = scion_stdout[-200:]
- # should this be printed? It doesn't hurt much but might be useful when
- # trouble shooting..
- print "ignoring line", s
- s = ScionServerConnection.receive(self)
-
- return s[6:]
-
-class ScionServerConnectionSocket(ScionServerConnection):
- """connects to the scion server by either TCP/IP or socketfile"""
- def __init__(self, connection):
- if type(connection) == type([]):
- # array [ host, port ]
- # vim.eval always returns strings!
- connection = (connection[0], string.atoi(connection[1]))
- print "connection is now %s" % connection.__str__()
- su = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- else: # must be path -> file socket
- print "else "
- su = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
- su.settimeout(10)
- su.connect(connection)
- # making file to use readline()
- self.scion_o = su.makefile('rw')
- self.scion_i = self.scion_o
-
-server_connection = None
-told_user_about_missing_configuration = 0
-lastScionResult = "";
-def connectscion():
- # check that connection method has been defined
- global server_connection
- global told_user_about_missing_configuration
- if 0 == told_user_about_missing_configuration:
- try:
- # use connection form vim value so that python is used as lazily as possible
- scionConnectionSetting = vim.eval('g:scion_connection_setting')
- print "connecting to scion %s"%scionConnectionSetting.__str__()
- except NameError:
- vim.command("sp")
- b = vim.current.buffer
- b.append( "you haven't defined g:scion_connection_setting")
- b.append( "Do so by adding one of the following lines to your .vimrc:")
- b.append( "TCP/IP, socket, stdio")
- b.append( "let g:scion_connection_setting = ['socket', \"socket file location\"] # socket connection")
- b.append( "let g:scion_connection_setting = ['socket', ['localhost', 4005]] # host, port TCIP/IP connection")
- b.append( "let g:scion_connection_setting = ['scion', \"scion_server location\"] # stdio connection ")
- told_user_about_missing_configuration = 1
-
- if scionConnectionSetting[0] == "socket":
- server_connection = ScionServerConnectionSocket(scionConnectionSetting[1])
- else:
- server_connection = ScionServerConnectionStdinOut(scionConnectionSetting[1])
- # tell server than vim doesn't like true, false, null
- vim.command('call haskellcomplete#EvalScion(1, "client-identify", {"name":"vim"})')
-
-# sends a command and returns the returned line
-def evalscion(str):
- global server_connection
- try:
- server_connection.send(str)
- except:
- vim.command('echom "%s"'% ("(re)connecting to scion"))
- connectscion()
- server_connection.send(str)
- return server_connection.receive()
-
-# str see EvalScion
-def evalscionAssign(str):
- global lastScionResult
- """assigns scion result to g:scion_result, result should either be
- { "result" : ..., "error" : [String] }"""
- vim.command("silent! unlet g:scion_result")
- lastScionResult = evalscion(str)
- vim.command("silent! let g:scion_result = %s" % lastScionResult)
- vim.command("if !exists('g:scion_result') | let g:scion_result = {'error' : \"couldn't parse scion result.\n%s\nTry :py print lastScionResult to see full server response\" } | endif " % str[:80])
-
-# sys.path.extend(['.','..'])
-PYTHONEOF
-endfunction
-
-call s:DefPython()
-" vim: set et ts=4:
View
44 vim_runtime_path/autoload/json.vim
@@ -1,44 +0,0 @@
-" vim encodes strings using ''. JSON requires ".
-
-" dummy type which is used to encode "null"
-" same could be done for true / false. But we don't use those yet
-fun! json#NULL()
- return function("json#NULL")
-endf
-fun! json#True()
- return function("json#True")
-endf
-fun! json#False()
- return function("json#False")
-endf
-fun! json#IntToBool(i)
- return a:i == 1 ? json#True() : json#False()
-endf
-
-fun! json#Encode(thing)
- if type(a:thing) == type("")
- return '"'.escape(a:thing,'"').'"'
- elseif type(a:thing) == type({})
- let pairs = []
- for [Key, Value] in items(a:thing)
- call add(pairs, json#Encode(Key).':'.json#Encode(Value))
- unlet Key | unlet Value
- endfor
- return "{".join(pairs, ",")."}"
- elseif type(a:thing) == type(0)
- return a:thing
- elseif type(a:thing) == type([])
- return '['.join(map(a:thing, "json#Encode(v:val)"),",").']'
- return
- elseif string(a:thing) == string(json#NULL())
- return "null"
- elseif string(a:thing) == string(json#True())
- return "true"
- elseif string(a:thing) == string(json#False())
- return "false"
- else
- throw "unexpected new thing: ".string(a:thing)
- endif
-endf
-
-" usage example: echo json#Encode({'method': 'connection-info', 'id': 0, 'params': [3]})
View
124 vim_runtime_path/ftplugin/haskell.vim
@@ -1,124 +0,0 @@
-if exists('g:dont_load_haskell_scion_interface_simple')
- finish
-endif
-
-" r = scion result with error locations
-" func : either setqflist or setloclist
-if !exists('g:haskell_qf_hook')
- let g:haskell_qf_hook = 'call haskellcomplete#SaneHook()'
-endif
-
-" very simple user interface to expose scion functionality
-" I'll implement a better interface in tovl.
-" (http://github.com/MarcWeber/theonevimlib)
-
-fun! s:BackgroundTypecheckFile(...)
- " no file given defaults to current buffer
- let file = a:0 > 0 ? a:1 : expand('%:p')
- let r = haskellcomplete#EvalScion(1, 'background-typecheck-file', {'file' : file})
- if has_key(r,'Right')
- echo haskellcomplete#ScionResultToErrorList('file check', 'setqflist', r['Right'])
- else
- call setqflist([{'text' : r['Left']}])
- cope
- " isn't shown because silent is used below.. and silent is used so that
- " <cr> need not to be pressed over and over again
- echo "this file could not be checked, reason: ".r['Left']."(-> backgroundTypecheckFile)"
- endif
-endf
-
-fun! s:FlagCompletion(A,L,P)
- let beforeC= a:L[:a:P-1]
- let word = matchstr(beforeC, '\zs\S*$')
- let list = haskellcomplete#List("supported-flags")
- "allow glob patterns:
- call filter(list, 'v:val =~ '.string('^'.substitute(word,'*','.*','g')))
- return list
-endf
-
-fun! s:ListCabalConfigurations(...)
- let params = { 'cabal-file' : haskellcomplete#CabalFile()}
- if a:0 > 0
- let params['type'] = a:1
- endif
- return haskellcomplete#EvalScion(1,'list-cabal-configurations', params)
-endf
-
-" intentionally suffixing commands by "Scion"
-" This way you have less typing. You can still get a list of Scion commands by
-" :*Scion<c-d>
-
-" ===== you don't need any project for these: =============
-command! -buffer ConnectionInfoScion
- \ echo haskellcomplete#EvalScion(1,'connection-info',{})
-
-" list supported languages
-command! -buffer ListSupportedLanguagesScion
- \ echo haskellcomplete#List('supported-languages')
-
-" list supported pragmas
-command! -buffer ListSupportedPragmasScion
- \ echo haskellcomplete#List('supported-pragmas')
-
-command! -buffer ListSupportedFlagsScion
- \ echo haskellcomplete#List('supported-flags')
-
-command! -buffer ListRdrNamesInScopeScion
- \ echo haskellcomplete#List('rdr-names-in-scope')
-
-command! -buffer ListCabalComponentsScion
- \ echo haskellcomplete#EvalScion(1,'list-cabal-components',{'cabal-file': haskellcomplete#CabalFile()})
-
-command! -buffer ListExposedModulesScion
- \ echo haskellcomplete#List('exposed-modules')
-
-command! -nargs=* ListCabalConfigurationsScion
- \ echo s:ListCabalConfigurations(<f-args>)
-
-command! -nargs=1 SetGHCVerbosityScion
- \ echo haskellcomplete#EvalScion(1,'set-ghc-verbosity',{'level': 1*<f-args>})
-
-command! -nargs=1 SetVerbosityScion
- \ echo haskellcomplete#EvalScion(1,'set-verbosity',{'level': 1*<f-args>})
-
-command! -nargs=0 GetVerbosityScion
- \ echo haskellcomplete#EvalScion(1,'get-verbosity',{})
-
-command! -nargs=0 CurrentComponentScion
- \ echo haskellcomplete#EvalScion(1,'current-component',{})
-
-" command! -nargs=0 CurrentCabalFileScion
-" \ echo haskellcomplete#EvalScion(1,'current-cabal-file',{})
-
-command! -nargs=0 DumpDefinedNamesScion
- \ echo haskellcomplete#EvalScion(1,'dump-defined-names',{})
-
-command! -nargs=0 DefinedNamesScion
- \ echo haskellcomplete#EvalScion(1,'defined-names',{})
-
-command! -nargs=1 NameDefinitions
- \ echo haskellcomplete#EvalScion(1,'name-definitions',{'name' : <f-args>})
-
-command! -buffer -nargs=* -complete=file BackgroundTypecheckFileScion
- \ call s:BackgroundTypecheckFile(<f-args>)
-
-command! -nargs=0 ForceUnloadScion
- \ echo haskellcomplete#EvalScion(1,'force-unload',{})
-
-command! -nargs=0 DumpSourcesScion
- \ echo haskellcomplete#EvalScion(1,'dump-sources',{})
-
-command! -nargs=1 -complete=customlist,s:FlagCompletion -buffer AddCommandLineFlagScion
- \ echo haskellcomplete#EvalScion(1,'add-command-line-flag',{'flags': [<f-args>]})
-
-" ===== loading a cabal project: ============================
-
-" assuming pwd is current cabal directory containing the .cabal file
-" optional argument specifies the cabal build (dist) directory
-command! -buffer -nargs=* -complete=file OpenCabalProjectScion
- \ echo haskellcomplete#OpenCabalProject('open-cabal-project',<f-args>)
-command! -buffer -nargs=* -complete=file ConfigureCabalProjectScion
- \ echo haskellcomplete#OpenCabalProject('configure-cabal-project', <f-args>)
-
-command! -buffer ThingAtPointScion
- \ echo haskellcomplete#EvalScion(1,'thing-at-point', {'file' : expand('%:p'), 'line' : 1*line('.'), 'column' : 1*col('.')})
View
46 vim_runtime_path/plugin/haskell_scion.vim
@@ -1,46 +0,0 @@
-if !exists('g:scion_config')
- let g:scion_config = {}
- " let g:scion_config['use_default_scion_cabal_dist_dir'] = 0
-endif
-" probably more commands should be moved from haskell.vim into this file so
-" that the commands can be run even when not editing a haskell file.
-
-fun! s:LoadComponentCompletion(A,L,P)
- let beforeC= a:L[:a:P-1]
- let word = matchstr(beforeC, '\zs\S*$')
-
- let result = []
- for item in haskellcomplete#EvalScion(1,'list-cabal-components',{'cabal-file': haskellcomplete#CabalFile()})
- if has_key(item, 'library')
- call add(result, 'library') " there can only be one
- elseif has_key(item, 'executable')
- call add(result, 'executable:'. item['executable'])
- else
- " component type File will never be returned ?
- throw "unexpected item ".string(item)
- endif
- endfor
- return result
-endf
-
-fun! s:LoadComponentScion(...)
- let result = haskellcomplete#LoadComponent(1,call('haskellcomplete#compToV', a:000))
- echo haskellcomplete#ScionResultToErrorList('load component finished: ','setqflist', result)
-
- " start checking file on buf write
- if !exists('g:dont_check_on_buf_write')
- augroup HaskellScion
- au BufWritePost *.hs,*.hsc,*.lhs silent! BackgroundTypecheckFile
- augroup end
- endif
-endf
-
-
-" arg either "library", "executable:name" or "file:Setup.hs"
-" no args: file:<current file>
-command! -nargs=? -complete=customlist,s:LoadComponentCompletion
- \ LoadComponentScion
- \ call s:LoadComponentScion(<f-args>)
-
-command! -nargs=* -complete=file -buffer WriteSampleConfigScion
- \ echo haskellcomplete#WriteSampleConfig(<f-args>) | e .scion-config
View
4 vim_test/Setup.hs
@@ -1,4 +0,0 @@
-#!/usr/bin/env runhaskell
-import Distribution.Simple
-main :: IO ()
-main = defaultMain
View
3  vim_test/src/Test.hs
@@ -1,3 +0,0 @@
-module Test where
-
-test = print "success"
View
22 vim_test/vim_scion_test_project.cabal
@@ -1,22 +0,0 @@
-name: vim-scion-test-project
-version: 0.1
-license: BSD3
-license-file: LICENSE
-author: Marc Weber <marco-oweber@gmx.de>
-maintainer: Marc Weber <marco-oweber@gmx.de>
-homepage: http://github.com/nominolo/scion
-description: a very simple haskell project for testing the scion vim backend
-synopsis: Haskell IDE library
-category: Development
-stability: provisional
-build-type: Simple
-cabal-version: >= 1.4
--- tested-with: GHC ==6.10.1
-extra-source-files: README.markdown emacs/scion.el
-
-library
- build-depends: base == 4.*
- hs-source-dirs: src
- extensions: CPP
- exposed-modules:
- Test
Please sign in to comment.
Something went wrong with that request. Please try again.