mirror of https://github.com/buggins/dlangide.git
Send the editor content instead of the file name to dcd
This commit is contained in:
parent
ec9b0a2147
commit
6b5e307753
|
@ -297,7 +297,7 @@ class ExternalProcess {
|
||||||
params ~= _program;
|
params ~= _program;
|
||||||
params ~= _args;
|
params ~= _args;
|
||||||
if (!_stderr)
|
if (!_stderr)
|
||||||
redirect = Redirect.stdout | Redirect.stderrToStdout; //Redirect.stdin |
|
redirect = Redirect.stdout | Redirect.stderrToStdout | Redirect.stdin;
|
||||||
else
|
else
|
||||||
redirect = Redirect.all;
|
redirect = Redirect.all;
|
||||||
Log.i("Trying to run program ", _program, " with args ", _args);
|
Log.i("Trying to run program ", _program, " with args ", _args);
|
||||||
|
@ -393,4 +393,14 @@ class ExternalProcess {
|
||||||
}
|
}
|
||||||
return _state;
|
return _state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void write(dstring data) {
|
||||||
|
if(_state == ExternalProcessState.Error || _state == ExternalProcessState.None || _state == ExternalProcessState.Stopped) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
_pipes.stdin.write(data);
|
||||||
|
_pipes.stdin.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,12 +9,13 @@ class DCDInterface {
|
||||||
this() {
|
this() {
|
||||||
dcdProcess = new ExternalProcess();
|
dcdProcess = new ExternalProcess();
|
||||||
}
|
}
|
||||||
bool execute(char[][] arguments ,ref dstring output) {
|
bool execute(char[][] arguments ,ref dstring output, dstring input) {
|
||||||
ProtectedTextStorage stdoutTarget = new ProtectedTextStorage();
|
ProtectedTextStorage stdoutTarget = new ProtectedTextStorage();
|
||||||
ExternalProcess dcdProcess = new ExternalProcess();
|
ExternalProcess dcdProcess = new ExternalProcess();
|
||||||
//TODO: Working Directory, where is that?
|
//TODO: Working Directory, where is that?
|
||||||
//TODO: Inform user when dcd-client is not available.
|
//TODO: Inform user when dcd-client is not available.
|
||||||
dcdProcess.run("dcd-client".dup, arguments, "/usr/bin".dup, stdoutTarget);
|
dcdProcess.run("dcd-client".dup, arguments, "/usr/bin".dup, stdoutTarget);
|
||||||
|
dcdProcess.write(input);
|
||||||
|
|
||||||
while(dcdProcess.poll() == ExternalProcessState.Running){ }
|
while(dcdProcess.poll() == ExternalProcessState.Running){ }
|
||||||
|
|
||||||
|
|
|
@ -28,10 +28,10 @@ class DEditorTool : EditorTool
|
||||||
|
|
||||||
char[][] arguments = ["-l".dup, "-c".dup];
|
char[][] arguments = ["-l".dup, "-c".dup];
|
||||||
arguments ~= [to!(char[])(byteOffset)];
|
arguments ~= [to!(char[])(byteOffset)];
|
||||||
arguments ~= [to!(char[])(editor.projectSourceFile.filename())];
|
//arguments ~= [to!(char[])(editor.projectSourceFile.filename())];
|
||||||
|
|
||||||
dstring output;
|
dstring output;
|
||||||
_dcd.execute(arguments, output);
|
_dcd.execute(arguments, output, content);
|
||||||
|
|
||||||
string[] outputLines = to!string(output).splitLines();
|
string[] outputLines = to!string(output).splitLines();
|
||||||
Log.d("DCD:", outputLines);
|
Log.d("DCD:", outputLines);
|
||||||
|
@ -70,10 +70,10 @@ class DEditorTool : EditorTool
|
||||||
|
|
||||||
char[][] arguments = ["-c".dup];
|
char[][] arguments = ["-c".dup];
|
||||||
arguments ~= [to!(char[])(byteOffset)];
|
arguments ~= [to!(char[])(byteOffset)];
|
||||||
arguments ~= [to!(char[])(editor.projectSourceFile.filename())];
|
//arguments ~= [to!(char[])(editor.projectSourceFile.filename())];
|
||||||
|
|
||||||
dstring output;
|
dstring output;
|
||||||
_dcd.execute(arguments, output);
|
_dcd.execute(arguments, output, content);
|
||||||
|
|
||||||
char[] state = "".dup;
|
char[] state = "".dup;
|
||||||
dstring[] suggestions;
|
dstring[] suggestions;
|
||||||
|
|
Loading…
Reference in New Issue