Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change txt files formatting to Markdown #45

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions HackingOnVsChromium.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
Walkthrough for your first time hacking on vs-chromium.

It's pretty easy actually, but newbie guides like this (which folks rarely
consulted more than once) tends to fall out of date. So if you're following this
guide and hit trouble, please try to fix what you see -- as you (the newbie) are
a better position than anyone else to do so.

### Prereqs
Obtain a Community, Professional or better edition of Visual Studio 2013. The
Express edition does not support vs-chromium.

Download and install the Visual Studio 2013 SDK

This SDK enables development of IDE extensions like vs-chromium.

http://www.microsoft.com/en-us/download/details.aspx?id=40758

### Get the code
cd D:\src\ (or some such)
git clone https://github.com/chromium/vs-chromium.git

### Building and running the code.
Open `vs-chromium\src\vs-chromium.sln`

Maybe start by building everything (Debug config) via `F7`. If you get errors,
try figuring out the problem and don't forget to update this guide with the
missing prereq.

Find the VsChromium project. This builds to the .vsix binary that is the
extension installer.

Find the Tests project. This builds to a VS unit test (not gtest) dll.

These tests can be run via the top-level Test menu in the IDE:

`[Test -> Run -> All Tests (Ctrl+R, A)]`

The results show up in the Test Explorer window:

`[Test -> Windows -> Test Explorer]`

Clicking around (and right clicking) lets you interact with failures.

To debug the extension, set VsChromium as your start-up project and start a
debugging session via F5. This will spin up an experimental instance of
Visual Studio running the extension. The first launch is markedly slow as
the profile or something is created, but subsequent launches are faster.
You'll be able to debug the code that runs inside the visual studio project,
but vs-chromium also spins up a server process to do file system indexing,
and you may want to debug inside that process too. To do so:

1. Start by setting a breakpoint in
`ServerProxyProcess.cs!AfterProxyCreated`. This should hit (in your
devenv.exe process) shortly after the server process is launched.

2. When the breakpoint is hit, do `Ctrl+Alt+P` to open the "attach to
process" dialog. The server process is named `VsChromium.Server.exe`.
Attach to it.

3. Now your breakpoints in the child process will work too.

### Profiling or Debugging the server process
The easiest option for debugging is to simply run the VsChromium project
as usual, then Attach the VS Debugger to the `VsChromium.Server.exe` process

To Debug startup code (or to run the Server from an external profile such as
DotMemory), follow these steps:
1. Setup the solution as in the previous section
2. Rename the "PROFILE_SERVER2" to "PROFILE_SERVER" "Conditional compilation symbol"
in the "Properties" of the VsChromium project
3. Build
4. Run Visual Studio with experimental root suffix from a command prompt
(it seems that it is required to use an "Admin" command prompt)

Ex: `"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe" /rootSuffix Exp`
4. Run the "Server" project (ensure the command line argument is set to `63300`
which is the default TCP port to use when debugging
69 changes: 0 additions & 69 deletions HackingOnVsChromium.txt

This file was deleted.

4 changes: 2 additions & 2 deletions new_feature_ideas.txt → NewFeatureIdeas.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Search UI
### Search UI

* Expand all
* Hook up Next/Prev Find Ref
* Support replace
* Support replace
5 changes: 5 additions & 0 deletions NewReleaseChecklist.txt → NewReleaseChecklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ When making a new release
Master branch
=============
1. Update version # in all files:

* "Find In Files": "0.9.xx", "Entire Solution"

* src\Core\VsChromiumVersion.cs
* src\VsChromium\source.extension.vsixmanifest (PackageManifest\Metadata\Identity\@Version)
* src\Native\version.rc
* "Find In Files": "0,9,xx", "Entire Solution"

* src\Native\version.rc

2. Build
Expand All @@ -17,6 +20,7 @@ Master branch
4. Commit and push to github

5. Create a release named "vx.y.x" (e.g. v0.2.2) on github

* Create the tag "vx.y.z"
* Attach the vsix file built in step 2.

Expand All @@ -29,6 +33,7 @@ gh-pages branch
2. Update the file "latest_version.txt" with the new version # and new URL

version: x.y.z

url: https://github.com/chromium/vs-chromium/releases/tag/vx.y.z

3. Commit and push.
11 changes: 10 additions & 1 deletion src/Core/Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,22 @@
<Compile Include="Ipc\IpcEvent.cs" />
<Compile Include="Ipc\IpcMessage.cs" />
<Compile Include="Ipc\RecoverableErrorException.cs" />
<Compile Include="Ipc\TypedMessages\OptionalDirectoryEntry.cs" />
<Compile Include="Ipc\TypedMessages\FileSystemTree.cs" />
<Compile Include="Ipc\TypedMessages\DirectoryDetails.cs" />
<Compile Include="Ipc\TypedMessages\FileByExtensionDetails.cs" />
<Compile Include="Ipc\TypedMessages\GetDirectoryEntriesMultipleRequest.cs" />
<Compile Include="Ipc\TypedMessages\GetDirectoryEntriesMultipleResponse.cs" />
<Compile Include="Ipc\TypedMessages\GetFileSystemTreeRequest.cs" />
<Compile Include="Ipc\TypedMessages\GetFileSystemTreeResponse.cs" />
<Compile Include="Ipc\TypedMessages\GetDatabaseDetailsRequest.cs" />
<Compile Include="Ipc\TypedMessages\GetDatabaseDetailsResponse.cs" />
<Compile Include="Ipc\TypedMessages\GetDatabaseStatisticsRequest.cs" />
<Compile Include="Ipc\TypedMessages\GetDatabaseStatisticsResponse.cs" />
<Compile Include="Ipc\TypedMessages\GetDirectoryDetailsRequest.cs" />
<Compile Include="Ipc\TypedMessages\GetDirectoryDetailsResponse.cs" />
<Compile Include="Ipc\TypedMessages\GetDirectoryEntriesRequest.cs" />
<Compile Include="Ipc\TypedMessages\GetDirectoryEntriesResponse.cs" />
<Compile Include="Ipc\TypedMessages\GetDirectoryStatisticsRequest.cs" />
<Compile Include="Ipc\TypedMessages\GetDirectoryStatisticsResponse.cs" />
<Compile Include="Ipc\TypedMessages\GetProjectDetailsRequest.cs" />
Expand All @@ -160,6 +168,7 @@
<Compile Include="Ipc\TypedMessages\ProjectConfigurationDetails.cs" />
<Compile Include="Ipc\TypedMessages\ProjectConfigurationSectionDetails.cs" />
<Compile Include="Ipc\TypedMessages\ProjectDetails.cs" />
<Compile Include="Ipc\TypedMessages\ProjectEntry.cs" />
<Compile Include="Ipc\TypedMessages\RefreshFileSystemTreeRequest.cs" />
<Compile Include="Ipc\TypedMessages\RefreshFileSystemTreeResponse.cs" />
<Compile Include="Ipc\TypedMessages\ResumeIndexingRequest.cs" />
Expand Down Expand Up @@ -204,7 +213,7 @@
<Compile Include="Ipc\TypedMessages\DoneResponse.cs" />
<Compile Include="Ipc\TypedMessages\FileEntry.cs" />
<Compile Include="Ipc\TypedMessages\FileSystemEntry.cs" />
<Compile Include="Ipc\TypedMessages\FileSystemTree.cs" />
<Compile Include="Ipc\TypedMessages\FileSystemTree_Obsolete.cs" />
<Compile Include="Ipc\TypedMessages\GetFileSystemResponse.cs" />
<Compile Include="Ipc\TypedMessages\TypedMessage.cs" />
<Compile Include="Ipc\IpcResponse.cs" />
Expand Down
2 changes: 0 additions & 2 deletions src/Core/Files/IFileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
// found in the LICENSE file.

using System.Collections.Generic;
using System.IO;
using System.Runtime.InteropServices;
using VsChromium.Core.Win32.Files;
using VsChromium.Core.Win32.Memory;

Expand Down
5 changes: 4 additions & 1 deletion src/Core/Files/PathHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,11 @@ public static string ToPosix(string path) {
/// <paramref name="path"/> is a top level directory.
/// </summary>
public static string GetParent(string path) {
if (string.IsNullOrEmpty(path)) {
return null;
}
var result = Path.GetDirectoryName(path);
if (result == "") {
if (string.IsNullOrEmpty(result)) {
return null;
}
return result;
Expand Down
7 changes: 5 additions & 2 deletions src/Core/Files/RelativePath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ public string Extension {
/// </summary>
public RelativePath? Parent {
get {
var parent = PathHelpers.GetParent(_relativePath ?? "");
return parent == null ? default(RelativePath) : new RelativePath(parent);
if (_relativePath == null) {
return null;
}
var parent = PathHelpers.GetParent(_relativePath);
return parent == null ? Empty : new RelativePath(parent);
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/Core/Ipc/IpcMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,9 @@ public class IpcMessage {

[ProtoMember(3)]
public IpcMessageData Data { get; set; }

public override string ToString() {
return Data?.ToString() ?? GetType().Name;
}
}
}
4 changes: 4 additions & 0 deletions src/Core/Ipc/IpcMessageData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,9 @@ namespace VsChromium.Core.Ipc {
[ProtoInclude(11, typeof(TypedMessage))]
[ProtoInclude(12, typeof(ErrorResponse))]
public class IpcMessageData {

public override string ToString() {
return GetType().Name;
}
}
}
6 changes: 4 additions & 2 deletions src/Core/Ipc/TypedMessages/DirectoryEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

using System.Collections.Generic;
using ProtoBuf;
using System.Collections.Generic;

namespace VsChromium.Core.Ipc.TypedMessages {
[ProtoContract]
Expand All @@ -16,8 +16,10 @@ public DirectoryEntry() {
[ProtoMember(1)]
public List<FileSystemEntry> Entries { get; set; }

public bool IsEmpty => string.IsNullOrEmpty(Name);

public override string ToString() {
return string.Format("dir:\"{0}\", {1} children", Name ?? string.Empty, Entries.Count);
return $"dir: \"{Name}\", {Entries.Count} children";
}
}
}
2 changes: 1 addition & 1 deletion src/Core/Ipc/TypedMessages/FileEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace VsChromium.Core.Ipc.TypedMessages {
[ProtoContract]
public class FileEntry : FileSystemEntry {
public override string ToString() {
return string.Format("file:\"{0}\"", Name ?? string.Empty);
return $"file: \"{Name}\"";
}
}
}
12 changes: 9 additions & 3 deletions src/Core/Ipc/TypedMessages/FileSystemTree.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
// Copyright 2013 The Chromium Authors. All rights reserved.
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

using System.Collections.Generic;
using ProtoBuf;

namespace VsChromium.Core.Ipc.TypedMessages {
[ProtoContract]
public class FileSystemTree {
public FileSystemTree() {
// To avoid getting "null" property if empty collection deserialized using protobuf.
Projects = new List<ProjectEntry>();
}

/// <summary>
/// The version of this snapshot of the tree.
/// </summary>
Expand All @@ -20,6 +26,6 @@ public class FileSystemTree {
/// that project path.
/// </summary>
[ProtoMember(2)]
public DirectoryEntry Root { get; set; }
public List<ProjectEntry> Projects { get; set; }
}
}
}
25 changes: 25 additions & 0 deletions src/Core/Ipc/TypedMessages/FileSystemTree_Obsolete.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

using ProtoBuf;

namespace VsChromium.Core.Ipc.TypedMessages {
[ProtoContract]
public class FileSystemTree_Obsolete {
/// <summary>
/// The version of this snapshot of the tree.
/// </summary>
[ProtoMember(1)]
public int Version { get; set; }

/// <summary>
/// The Root entry has a "null" name, and contains one directory entry per
/// project known to the server. Each project entry contains the hierarchy
/// of directory and file entries as they appear in the file system under
/// that project path.
/// </summary>
[ProtoMember(2)]
public DirectoryEntry Root { get; set; }
}
}
25 changes: 25 additions & 0 deletions src/Core/Ipc/TypedMessages/GetDirectoryEntriesMultipleRequest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

using System.Collections.Generic;
using ProtoBuf;

namespace VsChromium.Core.Ipc.TypedMessages {
[ProtoContract]
public class GetDirectoryEntriesMultipleRequest : TypedRequest {
public GetDirectoryEntriesMultipleRequest() {
RelativePathList = new List<string>();
}

[ProtoMember(1)]
public string ProjectPath { get; set; }

[ProtoMember(2)]
public List<string> RelativePathList { get; set; }

public override string ToString() {
return $"{base.ToString()} : Project=\"{ProjectPath}\", # of Paths={RelativePathList.Count}";
}
}
}
Loading