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

Fix Msbuild, fix project/item templates, improve intellisense. #286

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
7653534
Fix template zip paths for VisualRust
MaulingMonkey Jul 1, 2017
6323a84
Not all cargo build JSON lines are messages. Add some null checks in…
MaulingMonkey Jul 1, 2017
e070ed2
Project and item templates were only included in Debug vsix builds. …
MaulingMonkey Jul 1, 2017
7649846
Add original source path to racer command line for better inrellisense.
MaulingMonkey Jul 1, 2017
dd67195
Add docs to completions via racer's complete-with-snippet command line.
MaulingMonkey Jul 1, 2017
9675cdd
Only add a newline between signature and docs if docs actually exist
MaulingMonkey Jul 3, 2017
4f2402c
Move RustGoToDefinitionCommandHandler's temp files out of the project…
MaulingMonkey Jul 3, 2017
38b5e9d
Don't ctor *and* member inject IRustLexer. Also fix CompositionExcep…
MaulingMonkey Jul 4, 2017
f29c5ad
Fix ArgumentException when displaying errors from macros.
MaulingMonkey Jul 5, 2017
a8a1ae0
Enable building debug .vsix files
MaulingMonkey Jul 5, 2017
3e499d0
Separate racer match parsing out into it's own file, RacerMatch.cs.
MaulingMonkey Jul 6, 2017
7b9f314
Intellisense and goto def/help improvements, overhaul tokenization.
MaulingMonkey Jul 6, 2017
5251e84
Fix MSBuild: Error span may be null.
MaulingMonkey Jul 8, 2017
96c62f8
Reduce completions to summary paragraphs (via RacerMatch accessors.)
MaulingMonkey Jul 12, 2017
830f79f
(Re)trigger intellisense after structural '.' or '::'.
MaulingMonkey Jul 12, 2017
8173634
README.md: Document the use of submodules and lfs.
MaulingMonkey Jul 19, 2017
9a5227f
Upgrade Microsoft.VSSDK.BuildTools in VisualRust.Templates to fix VS2…
MaulingMonkey Jul 20, 2017
cf71f9a
Rewrite solution to cull bad configs/platforms, add single-VS options.
MaulingMonkey Jul 20, 2017
0239104
Fix vsix paths to LICENSE.txt.
MaulingMonkey Jul 29, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 10 additions & 5 deletions README.md
Expand Up @@ -47,11 +47,16 @@ the time to spend coding.

### Code

1. Fork the main repository
2. Work on a feature in your own private branch
3. Once you are finished with you work or want someone to you, open a pull
request
4. Someone will review your code and merge it. Some fixes might be required on
1. Fork the main repository on github.
2. Check out the source code:
* Make sure [git lfs](https://git-lfs.github.com/) is installed **before**
cloning the repository or you'll need to delete and re-checkout some files.
* `git clone ...` your fork.
* `git submodule update --init` to grab MICore and MIDebugEngine.
3. Work on a feature in your own private branch.
4. Once you are finished with you work or want someone to you, open a pull
request.
5. Someone will review your code and merge it. Some fixes might be required on
your side.

## Prerequisites
Expand Down
730 changes: 202 additions & 528 deletions VisualRust.sln

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions appveyor.yml
Expand Up @@ -5,7 +5,10 @@ branches:
skip_tags: true
image: Visual Studio 2017
configuration:
- Debug
- Release
platform:
- All VS
install:
- ps: >-
Start-FileDownload "https://static.rust-lang.org/dist/rust-nightly-i686-pc-windows-msvc.exe"
Expand Down
2 changes: 1 addition & 1 deletion src/VisualRust.Build/CargoBuild.cs
Expand Up @@ -78,7 +78,7 @@ protected override bool ExecuteCargo(Cargo cargo)
{
var reader = new JsonTextReader(new StringReader(e.Data));
var message = Cargo.JsonSerializer.Deserialize<CargoMessage>(reader);
Rustc.LogRustcMessage(message.message, Manifest.Directory.FullName, Log);
if (message != null) Rustc.LogRustcMessage(message.message, Manifest.Directory.FullName, Log);
}
};

Expand Down
25 changes: 21 additions & 4 deletions src/VisualRust.Build/Rustc.cs
Expand Up @@ -369,6 +369,7 @@ private void LogRustcMessage(RustcMessageHuman msg)

public static void LogRustcMessage(RustcMessageJson msg, string rootPath, TaskLoggingHelper log)
{
if (msg == null) return;
// todo multi span
// todo all other fields
// todo mb help key word is code.explanation
Expand All @@ -381,19 +382,35 @@ public static void LogRustcMessage(RustcMessageJson msg, string rootPath, TaskLo
if (String.IsNullOrEmpty(code) && primarySpan == null && msg.message.Contains("aborting due to"))
return;

// primarySpan.file_name might not be legal (e.g. "file_name":"<println macros>" is common)
string logFile = null;
var logSpan = primarySpan;
while (logSpan != null)
{
try
{
logFile = Path.Combine(rootPath, logSpan.file_name); // maybe checking for ".rs" extension is saner than trying this and seeing if it throws?
break;
}
catch (ArgumentException) // "Illegal characters in path."
{
logSpan = logSpan.expansion?.span; // see if expanding helps us find a real file
}
}

if (type == RustcMessageType.Error)
{
if (primarySpan == null)
if (logSpan == null)
log.LogError(msg.message);
else
log.LogError(null, code, null, Path.Combine(rootPath, primarySpan.file_name), primarySpan.line_start, primarySpan.column_start, primarySpan.line_end, primarySpan.column_end, msg.message);
log.LogError(null, code, null, logFile, logSpan.line_start, logSpan.column_start, logSpan.line_end, logSpan.column_end, msg.message);
}
else
{
if (primarySpan == null)
if (logSpan == null)
log.LogWarning(msg.message);
else
log.LogWarning(null, code, null, Path.Combine(rootPath, primarySpan.file_name), primarySpan.line_start, primarySpan.column_start, primarySpan.line_end, primarySpan.column_end, msg.message);
log.LogWarning(null, code, null, logFile, logSpan.line_start, logSpan.column_start, logSpan.line_end, logSpan.column_end, msg.message);
}

}
Expand Down
8 changes: 4 additions & 4 deletions src/VisualRust.Templates/VisualRust.Templates.csproj
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\Microsoft.VSSDK.BuildTools.14.3.25420\build\Microsoft.VSSDK.BuildTools.props" Condition="Exists('..\..\packages\Microsoft.VSSDK.BuildTools.14.3.25420\build\Microsoft.VSSDK.BuildTools.props')" />
<Import Project="..\..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.props" Condition="Exists('..\..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.props')" />
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<MinimumVisualStudioVersion>$(VisualStudioVersion)</MinimumVisualStudioVersion>
Expand Down Expand Up @@ -102,10 +102,10 @@
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\Microsoft.VSSDK.BuildTools.14.3.25420\build\Microsoft.VSSDK.BuildTools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.VSSDK.BuildTools.14.3.25420\build\Microsoft.VSSDK.BuildTools.props'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.VSSDK.BuildTools.14.3.25420\build\Microsoft.VSSDK.BuildTools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.VSSDK.BuildTools.14.3.25420\build\Microsoft.VSSDK.BuildTools.targets'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.props'))" />
<Error Condition="!Exists('..\..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.targets'))" />
</Target>
<Import Project="..\..\packages\Microsoft.VSSDK.BuildTools.14.3.25420\build\Microsoft.VSSDK.BuildTools.targets" Condition="Exists('..\..\packages\Microsoft.VSSDK.BuildTools.14.3.25420\build\Microsoft.VSSDK.BuildTools.targets')" />
<Import Project="..\..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.targets" Condition="Exists('..\..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
2 changes: 1 addition & 1 deletion src/VisualRust.Templates/packages.config
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.VSSDK.BuildTools" version="14.3.25420" targetFramework="net45" developmentDependency="true" />
<package id="Microsoft.VSSDK.BuildTools" version="15.1.192" targetFramework="net45" developmentDependency="true" />
</packages>