Conversation
| {B7222544-B13F-48C8-85E3-6BFD3D44702A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {B7222544-B13F-48C8-85E3-6BFD3D44702A}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {B7222544-B13F-48C8-85E3-6BFD3D44702A}.Release|Any CPU.ActiveCfg = Release|Any CPU |
There was a problem hiding this comment.
Changes in this file don't make sense. We simply moved this 3 lines 4 lines further. Please revert
| <ErrorReport>prompt</ErrorReport> | ||
| <WarningLevel>4</WarningLevel> | ||
| <CodeAnalysisRuleSet /> | ||
| <AllowUnsafeBlocks>true</AllowUnsafeBlocks> |
There was a problem hiding this comment.
Why do we need this property?
VSRAD.Build/VSRAD.Build.csproj
Outdated
| <RemoveDir Directories="$(ProjectDir)..\$(ConfigurationName)"/> | ||
| </Target> | ||
| </Project> No newline at end of file | ||
| </Project> |
There was a problem hiding this comment.
Why do we need this line in diff?
| var sendSize = Math.Min(bytesToSend, BUFFER_SIZE); | ||
|
|
||
| var readCount = reader.Read(buffer, 0, Convert.ToInt32(sendSize)); | ||
|
|
||
| if (readCount == 0) throw new IOException("SendFileAsync file read error"); | ||
|
|
||
| writer.Write(buffer, 0, readCount); | ||
|
|
||
| bytesToSend -= readCount; |
There was a problem hiding this comment.
Codestyle: why emptyline between every line of code?
| public string relativePath_ { get; set; } | ||
|
|
||
| public DateTime lastWriteTimeUtc_ { get; set; } | ||
|
|
||
| public bool isDirectory_ { get; set; } |
There was a problem hiding this comment.
Codestyle: what case is this and why is it chosen?
There was a problem hiding this comment.
I believe we use PascalCase for public properties.
| namespace VSRAD.DebugServer.SharedUtils | ||
| { | ||
|
|
||
| public class FileMetadata// : IEquatable<FileMetadata> |
There was a problem hiding this comment.
So IEquatable should not be implemented?
| <Version>$([System.Text.RegularExpressions.Regex]::Match($([System.Text.RegularExpressions.Regex]::Match($([System.IO.File]::ReadAllText("$(MSBuildProjectDirectory)\..\VSRAD.Package\source.extension.vsixmanifest")), `Version=\"[0-9,.]+\" Language=`).ToString()),`[0-9,.]+`).ToString())</Version> | ||
| </PropertyGroup> | ||
| <Message Importance="High" Text="Debug server version: $(Version)"/> | ||
| <Message Importance="High" Text="Debug server version: $(Version)" /> |
There was a problem hiding this comment.
We do not need this line in diff.
upd: fixed in 034f908 |
|
For example, |
johnny-keker
left a comment
There was a problem hiding this comment.
⚠ Show stopper ⚠
Current manual approach to paths handling doesn't work for Windows host -> Linux remote situation. Next image illustrates problem, Windows host is on the left, Linux remote on the right
Personally I am not very fond of whole PathExtension.cs thing, I'll try to come out with better suggestion ASAP
| case SendFileCommand _: | ||
| var send_command = (SendFileCommand)command; | ||
| var sendPath = Path.Combine(send_command.SrcPath, send_command.Metadata.relativePath_); | ||
| return await SendFileAsync(writer, sendPath, send_command.UseCompression).ConfigureAwait(false); | ||
| case GetFileCommand _: | ||
| var receive_command = (GetFileCommand)command; | ||
| var receivePath = Path.Combine(receive_command.DstPath, receive_command.Metadata.relativePath_); | ||
| return await ReceiveFileAsync(writer, receivePath, receive_command.UseCompression); |
There was a problem hiding this comment.
In this chunk of code switch already does conversion for us, however we discard it using _, only to do it again manually in the next line. Also, we do not use snake case anywhere in project (as far as I know)
I suggest rewriting this switch like this:
case SendFileCommand sf:
var sendPath = Path.Combine(sf.SrcPath, sf.Metadata.relativePath_);
return await SendFileAsync(writer, sendPath, sf.UseCompression).ConfigureAwait(false);
case GetFileCommand gf:
var receivePath = Path.Combine(gf.DstPath, gf.Metadata.relativePath_);
return await ReceiveFileAsync(writer, receivePath, gf.UseCompression);
default:
break;| public String ToString() | ||
| { | ||
| var props = this.GetType().GetProperties(); | ||
| var sb = new StringBuilder(); | ||
| foreach (var p in props) | ||
| { | ||
| sb.AppendLine(p.Name + ": " + p.GetValue(this, null)); | ||
| } | ||
| return sb.ToString(); | ||
| } |
There was a problem hiding this comment.
Do we really need to use reflection to iterate over 3 properties?
Also, readability can be improved. I would suggest maybe something more like
public override string ToString() => string.Join(Environment.NewLine, new string[]
{
"Metadata = [",
$"\tRelative Path : {relativePath_}",
$"\tLast Write Time UTC : {lastWriteTimeUtc_}",
$"\tIs Directory : {isDirectory_}",
"]"
});
VSRAD.DebugServer/IPC/Responses.cs
Outdated
| private static XmlSerializer getFormatter() | ||
| { | ||
| return new XmlSerializer(typeof(List<FileMetadata>)); | ||
| } |
There was a problem hiding this comment.
Do we really don't have other options to serialize a List of FileMetadata but using XmlSerializer?
It seems off to me, since we never used such format before anywhere in project.
Also, this declaration clearly suggests that it was originated in some Java code, in C# we use PascalCase in such places.
034f908 to
53f3b2a
Compare
c7ba63e to
efc0e20
Compare
johnny-keker
left a comment
There was a problem hiding this comment.
Checked new version with server on Ubuntu. Old problem (#348 (review)) is not resolved, and now I have a new problem when new directory path contain full windows path from host
| private static XmlSerializer GetFormatter() | ||
| { | ||
| return new XmlSerializer(typeof(List<FileMetadata>)); | ||
| } |
There was a problem hiding this comment.
Same as #348 (comment)
Do we really need XmlSerializer?
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
efc0e20 to
e70eb36
Compare
| { | ||
| var rootPath = Path.Combine(_environment.LocalWorkDir, step.SourcePath); | ||
| var localInfos = new List<FileMetadata>(); | ||
| foreach (var info in PathExtension.TraverseFileInfoTree(rootPath)) |
There was a problem hiding this comment.
This function will return an empty list in case we specified path of the particular file, and we won't send nothing. Expected behavior would be sending one specified file.
Client handles server ststuses for file copy commands
Block length now has same size on both connection sides
in compressed file transfers




Copy File step can now copy directories