Commit Graph

1307 Commits

Author SHA1 Message Date
Pranav K b2e9365084 Disable instrumentation pass with 3.0 configuration 2018-11-14 09:14:21 -08:00
Pranav K fc3f45bf4e Add RazorLanguageVersion.3_0
Fixes https://github.com/aspnet/Razor/issues/2612
2018-11-13 13:36:20 -08:00
Pranav K 9d2c394b99 SDK does not correctly resolve RazorExtension when multiple instances of RazorConfiguration are present
Fixes https://github.com/aspnet/Razor/issues/2721
2018-11-09 11:51:38 -08:00
N. Taylor Mullen 85ebb3585f Turn old completion on when async completion is active. 2018-11-08 15:38:45 -08:00
N. Taylor Mullen d5a6f99c8f Update to use latest completion APIs 2018-11-08 15:38:27 -08:00
Pranav K f6265a8549 Update rzc to target netcoreapp3.0
* Allow rzc to work with 3.0 SDK that does not carry 2.x runtime
* Update repo to netcoreapp3.0

Fixes https://github.com/aspnet/Razor/issues/2696
2018-11-08 09:18:58 -08:00
Ryan Nowak 707692cbe1 Update to Dev16 Roslyn 2018-10-31 12:17:22 -07:00
Pranav K 0bd6d135c1 Move targets, rzc and extension assembly in to the Sdk 2018-10-30 14:30:20 -07:00
Ajay Bhargav Baaskaran 0948660e8c Merge branch 'release/2.2' 2018-10-30 12:07:04 -07:00
Ryan Nowak 6c1bee1940 Classify non-C# inside C#
Fixes a bug with preview formatting for FAR.

So when we ask the Roslyn API to classify C# for us, it will only
classify the actual C# tokens. We are responsible for filling in the
gaps and whitespace.

The bug is that the following text would have all of its whitespace
removed in the VS FAR preview window.

```
@{ var foo = "Hello, world!"; }
```

Would look like:
```
@{varfoo="Hello, world!";}
```

This fixes the issue and makes it look like what one would expect.
2018-10-29 14:35:13 -07:00
Ryan Nowak a3d0c8f634 Fixes for excerpt service
We had a bug where were not returning the correct span for highlighting.
Fixed this.

Also we have a problem here, we're using types in our tests that are
coming from Roslyn - however we're not getting IVT for our test
assemblies. So some additional pain is required.
2018-10-29 14:35:13 -07:00
Ryan Nowak 5229e65962 Add GeneratedDocumentTextLoader 2018-10-29 14:35:13 -07:00
Ryan Nowak e637e17d34 Add support for getting the output version
This was missed in an earlier PR.
2018-10-29 14:35:13 -07:00
Ajay Bhargav Baaskaran 8674dd9236 Removed duplocate Id for a RazorDiagnostic 2018-10-29 11:25:29 -07:00
Ryan Nowak 4d44639a51 Incorporate breaking changes from CPS 2018-10-29 08:51:21 -07:00
Nate McMaster e7edf237b5
Merge pull request #2679 from dotnet-maestro-bot/merge/release/2.2-to-master
[automated] Merge branch 'release/2.2' => 'master'
2018-10-26 23:53:59 -07:00
Nate McMaster 6ecf5374c6
Use 3PartySHA2 instead of 3PartyDual for code-signing Newtonsoft.Json.dll (#2678) 2018-10-26 23:40:22 -07:00
Pranav K 70aad7cb70
Merge branch 'master' into merge/release/2.2-to-master 2018-10-25 09:35:47 -07:00
Pranav K 2d6643bc85 Cleanup Microsoft.NET.Sdk.Razor package output
* Remove unnecessary \ incorrect package references
* Remove extraneous build outputs in the tasks project that weren't present when the tasks were in Razor.Design
2018-10-25 09:26:04 -07:00
Ryan Nowak 357657fc45 Implements versions for generated code
This change implements version tracking the inputs and outputs of
generated code.

Version tracking is still best-effort - meaning that in some cases a
perfect system could avoid doing more work. However, since we base the
versions off of all of the inputs, we now that the guarantee that code
generation operations that happen 'out of order' will always result in
the newer inputs generating the newer outputs.

Fixes: https://github.com/aspnet/Razor/issues/2650
2018-10-23 18:19:18 -07:00
Ryan Nowak 81904f579a Add definitions for Document Services
This change adds mock ups of the interfaces that we've been designing as
part of Razor FAR as well as the implementations. This isn't wired up to
anything yet in this PR, but the basic functionality here is stable
enough for us to stabilize and review.

For now we have the interface definitions in the Razor codebase until a
build of Roslyn is available with these definitions + IVT for us to use
them.
2018-10-22 20:47:31 -07:00
Ryan Nowak baa71375d0
Add and process notifications for Imports (#2656)
This builds support for tracking the effect of changes to imports on
other documents, and completes our model for being able to keep
generated code up to date.
2018-10-19 21:39:43 -07:00
N. Taylor Mullen 333989af7a Update to use latest completion APIs 2018-10-19 15:10:19 -07:00
N. Taylor Mullen c371fa29fe Make it so the RazorDirectiveCompletionProvider doesn't load extra assemblies in C#.
- Added a layer of indirection to allow for proper Lazy loading of Razor and future async completion specific assemblies.
2018-10-19 15:10:19 -07:00
Ryan Nowak 4927525519 Fix a bug in the span mapping code
This wasn't quite doing the right thing, and it's simpler than we make
it to be.
2018-10-18 13:46:24 -07:00
Ryan Nowak bafe1b27ff Add line numbers for design time directives
Addresses a blocking issue for FAR of types when used in user-code in a
directive. The FAR infrastructure is skipping over the directive code
because it's mapped to `#hidden`. As you can see in the code, the token
provided by the user is already included in the projection mappings.

I think we didn't do this before because we didn't expect this code to
need line numbers - it's not really debuggable, and design-time codegen
doesn't happen when you build the project.

I think it's OK for now that we don't line-map (or include) directives
based on view imports. If you trigger FAR on an `@inject ...` in an
import for instance, you'll find the reference for the view import file.
That seems pretty good, and the only cases I can really imagine it being
broken would be for go-to-definition (within a Razor view). Lets revisit
in the future based on feedback.
2018-10-18 13:46:24 -07:00
Ryan Nowak edd1ba4698 Update VS dependencies 2018-10-16 17:58:03 -07:00
N. Taylor Mullen f835291cb6 Allow identical DocumentSnapshot sources to trigger output changes.
- Prior to this project changes would trigger re-parses which would then be thrown away because source versions were identical.
- Added test to verify new SetOutput behavior.

aspnet/Razor.VSCode#184
2018-10-16 16:09:17 -07:00
Nate McMaster ada2b17160
automated: merge branch release/2.2 2018-09-28 17:27:35 -07:00
Nate McMaster e4ebae107c
Fix the path to SignedPackageFile items and include the VSIX .dll in code signing 2018-09-26 15:19:28 -07:00
Ryan Nowak 7a52baf18f Fix #2054 - make TagHelperResolutionResult internal
This type isn't used by WTE anymore.
2018-09-24 10:35:17 -07:00
N. Taylor Mullen d54ffabd26 Update LanguageServer IVT. 2018-09-21 12:51:36 -07:00
Pranav K a898f98a7f Print an error when using Razor build with an older version of the Sdk 2018-09-20 13:14:06 -07:00
Pranav K f70df60435 Move RazorGenerate and RazorTagHelper tasks in to the Sdk
Loading multiple versions of a task assembly result results in MSBuild on .NET Core to fail.
Addressing this by moving the tasks in to the Sdk and renaming it. This should avoid
immediate issues for a 2.1 and 2.2 project co-existing and future proofs 2.2 and later.

Fixes https://github.com/aspnet/Razor/issues/2553
2018-09-19 10:09:56 -07:00
N. Taylor Mullen 2b1bdb7342 Move RazorCompletionFactsService to CodeAnalysis.Workspaces.Razor.
- Also updated workspaces test project to also compile for netcoreapp2.2.
2018-09-18 17:34:45 -07:00
Pranav K 7144add4ad
Check for ITagHelper in tag helper feature provider (#2602)
Fixes #2482
2018-09-18 16:52:34 -07:00
Pranav K fc86cc3ca1 Allow Invoke \ InvokeAsync methods for a ViewComponent to be defined in base types
Fixes https://github.com/aspnet/Mvc/issues/8397
2018-09-18 13:38:48 -07:00
Ryan Nowak 060698a52f Update to use non-capturing timer 2018-09-17 11:08:06 -07:00
Ben Adams 5e083c371b Don't capture asynclocals onto Timer 2018-09-13 17:28:30 -07:00
N. Taylor Mullen d2d84d00f5 Allow GeneratedCodeContainer to accept initial output. 2018-09-10 16:14:25 -07:00
N. Taylor Mullen da935bfa95 Generated document output persists result to generated code container.
- Prior to this we had a `BackgroundDocumentGenerator` that would constantly be updating generated code containers. With this changes we've changed the details in how a `GeneratedCodeContainer` can be mutated. It can now be touched from any thread and is updated when an underlying `DocumentSnapshot` has available content. However, if a generated output comes through that's older then the last seen output we no-op.
- Removed `BackgroundDocumentGenerator` SetOutput logic.
- Updated tests to react to new behavior of `GetGeneratedOutputAsync`.
- Added new test to verify getting generated output results in the setting of the host documents output.
2018-09-10 15:24:35 -07:00
N. Taylor Mullen e8f8727193 Merge branch 'release/2.2'
# Conflicts:
#	build/dependencies.props
#	korebuild-lock.txt
#	version.props
2018-09-05 17:24:25 -07:00
N. Taylor Mullen 3a281b8f58 Allow TagHelpers to occur after unclosed C# blocks without assert failures.
- This scenario wasn't considered previously.

#2566
2018-09-05 17:22:17 -07:00
N. Taylor Mullen 4619d59828 Add IVT to Razor LanguageServer.
- `LanguageServer.StrongNamed` isn't a thing anymore.
2018-08-30 11:26:02 -07:00
N. Taylor Mullen b8ff40fbbd Merge remote-tracking branch 'origin/release/2.2' 2018-08-29 16:00:27 -07:00
N. Taylor Mullen 852ad8df87 Allow content to be written after caught exception from child TagHelper.
- The issue was that the `executeChildContentAsync` call was stopping the invocation of the `_endTagHelperWritingScope`. Therefore, we'd never finish the TagHelper content scope and all following content would be ignored.
- Added two tests to validate the new functionality.

#2561
2018-08-29 16:00:15 -07:00
Ajay Bhargav Baaskaran 9e4c4079f2
Renamed HtmlTextSyntax to HtmlTextLiteralSyntax for consistency (#2560)
* Renamed HtmlTextSyntax to HtmlTextLiteralSyntax for consistency

* Generated baselines
2018-08-28 14:00:32 -07:00
Ajay Bhargav Baaskaran f4808b50b5 Renamed WhiteSpace to Whitespace 2018-08-24 15:45:55 -07:00
Ajay Bhargav Baaskaran 27a9991f21
Auto generate CSharp syntax tree nodes (#2550)
* Auto generate CSharp syntax tree nodes
- Auto generated syntax nodes, visitors and factories
- Renamed RazorComment to RazorCommentLiteral to avoid a conflict
- Modified the Visit() contract
- Added new SyntaxKinds
- Regenerated baselines
2018-08-21 14:20:33 -07:00
Ajay Bhargav Baaskaran db2a142132
Updated the tokenizer and parser to operate on SyntaxTokens directly (#2540)
* Updated the tokenizer and parser to operate on SyntaxTokens directly
- The tokenizer and parser now operates directly on SyntaxTokens (Green)
- The SyntaxToken(Red) is now created when the Span is built with the correct parent and position
- All other passes that run after the parsing is complete(TagHelperRewriter etc) will operate on the Red tokens.
- There is now only one type for all SyntaxTokens. They are differentiated by their SyntaxKind.
- Added equivalence checking for tokens
- Updated test code to react
- Regenerated baselines
2018-08-16 16:11:01 -07:00