build: renaming to sourcetrail

This commit is contained in:
Andreas Stallinger
2017-04-07 13:19:09 +02:00
parent 8391a6da57
commit 045a259b2e
224 changed files with 885 additions and 4271 deletions
@@ -1,85 +0,0 @@
import sublime
import sublime_plugin
import threading
import socket
import os.path
import encodings.idna
try: # use this for Sublime Text 2
import SocketServer
except ImportError: # use this for Sublime Text 3
import socketserver as SocketServer
MESSAGE_SPLIT_STRING = ">>"
# Handling Coati to Sublime communication
def setCursorPosition(filePath, row, col):
if (os.path.exists(filePath)):
sublime.active_window().open_file(filePath + ":" + str(row) + ":" + str(col), sublime.ENCODED_POSITION)
else:
sublime.error_message("Coati is trying to jump to a file that does not exist: " + filePath)
class ConnectionHandler(SocketServer.BaseRequestHandler): # This class is instantiated once per connection to the server
def handle(self):
data = self.request.recv(1024).strip()
text = data.decode('utf-8')
eom_index = text.find("<EOM>")
if (not eom_index == 0):
message_string = text[0:eom_index]
message_fields = message_string.split(MESSAGE_SPLIT_STRING)
if (message_fields[0] == "moveCursor"):
sublime.set_timeout(lambda: setCursorPosition(message_fields[1], int(message_fields[2]), int(message_fields[3]) + 1), 0)
class ServerThreadHandler(threading.Thread):
def __init__ (self, ip, port):
self.ip = ip
self.port = port
threading.Thread.__init__(self)
def run(self):
server = SocketServer.TCPServer((self.ip, self.port), ConnectionHandler)
server.serve_forever()
class ServerStartupListener(sublime_plugin.EventListener):
def __init__(self):
self.running = False
def on_activated(self, view):
if (not self.running):
self.running = True
settings = sublime.load_settings('CoatiPlugin.sublime-settings')
host_ip = settings.get('host_ip')
coati_to_plugin_port = settings.get('coati_to_sublime_port')
networkListener = ServerThreadHandler(host_ip, coati_to_plugin_port)
networkListener.start()
# Handling Sublime to Coati communication
class SetActiveTokenCommand(sublime_plugin.TextCommand):
def run(self, edit):
filePath = self.view.file_name();
selectionPos = self.view.sel()[0].begin()
(row, col) = self.view.rowcol(selectionPos)
col += 1 # cols returned by rowcol() are 0-based.
row += 1 # rows returned by rowcol() are 0-based.
text = "setActiveToken" + MESSAGE_SPLIT_STRING + filePath + MESSAGE_SPLIT_STRING + str(row) + MESSAGE_SPLIT_STRING + str(col) + "<EOM>"
data = text.encode()
settings = sublime.load_settings('CoatiPlugin.sublime-settings')
host_ip = settings.get('host_ip')
plugin_to_coati_port = settings.get('sublime_to_coati_port')
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host_ip, plugin_to_coati_port))
s.send(data)
s.close()
@@ -1,5 +0,0 @@
{
"host_ip": "localhost",
"coati_to_sublime_port": 6666,
"sublime_to_coati_port": 6667
}
@@ -1,4 +0,0 @@
[
{ "caption": "-", "id": "coati" },
{ "command": "set_active_token", "caption": "Coati - Set active Token" }
]
+5
View File
@@ -0,0 +1,5 @@
#sublime-sourcetrail
The Sublime plugin is hosted at Github.
Link to the repository: [sublime-sourcetrail](https://github.com/CoatiSoftware/sublime-sourcetrail).
-5
View File
@@ -1,5 +0,0 @@
How to Install:
Just copy and past this "CoatiPlugin" folder into your Packages folder of Sublime Text. (You can find
that folder from within Sublime via the menu: Preferences -> Browse Packages...). Restart Sublime before
starting to use the plugin.