Created
July 23, 2014 21:31
-
-
Save natemcmaster/c43c394c8b8473c9f220 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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