Skip to content

Instantly share code, notes, and snippets.

@natemcmaster
Created July 23, 2014 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save natemcmaster/c43c394c8b8473c9f220 to your computer and use it in GitHub Desktop.
Save natemcmaster/c43c394c8b8473c9f220 to your computer and use it in GitHub Desktop.
import sublime, sublime_plugin, os, sys
import subprocess
class CBluntEventlistener(sublime_plugin.EventListener):
"""docstring for CBluntEventlistener"""
def on_query_completions(self, view, prefix, locations):
pos = locations[0]
scopes = view.scope_name(pos).split()
if "source.cs" not in scopes:
return []
documenttext = view.substr(sublime.Region(0,view.size()))
#exec('SimpleRoslyn.exe {0} {1}',pos,documenttext)
args = [r'completer/ConsoleApplication2.exe', str(pos), documenttext]
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False, creationflags=subprocess.SW_HIDE)
output = p.communicate()[0].decode('utf-8');
rec = output.split("\r\n")
ac=[]
for r in rec:
ac.append((r,r))
return ac
#output = subprocess.check_output(args)
#print(output)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment