Граф коммитов

15470 Коммитов

Автор SHA1 Сообщение Дата
David Wengier 7d5b2060c6 Remove code document parameter and just use document snapshot 2024-08-21 09:06:50 +10:00
Phil Allen 1d3c82c092
Update NOTICE.txt (#10768) 2024-08-20 13:19:01 -07:00
Fred Silberberg 68650a7d94
Allow @@ as a fallback (#10752)
* Added new tests for the specific regressed scenario.

* Allow `@@` sequences. Fixes https://github.com/dotnet/sdk/issues/42730 for now. When we move to the new lexer, these will once again be disallowed; attempting to use runtime compilation will necessitate using the native lexer.

* Fixup legacy test baselines
2024-08-20 10:50:58 -07:00
Dustin Campbell 934fea83a7 Add comments explaining the aggressive inlining behavior of EnumExtensions 2024-08-20 10:38:02 -07:00
Dustin Campbell b58f180910 Fix goofy whitespace 2024-08-20 10:24:06 -07:00
David Wengier 7470352912 Rework how we get generated documents
In light of "should we get rid of document context" convo this morning, figured this made sense to do (and I needed _something_ on IDocumentSnapshot in order to actually make this whole idea work)
2024-08-20 17:11:29 +10:00
David Wengier a8b425907f Directly test the component definition service in cohosting
See comment in the file, but essentially this is the only way for the code that returns the generated documents syntax tree to be hit in cohosting.
2024-08-20 17:10:49 +10:00
David Wengier ad16b168df Add missing test case 2024-08-20 17:09:56 +10:00
David Wengier 5ef490fbf3 Defer to C# for component attribute GTD in cohosting
This was a subtle future bug, that we would have hit when we removed the C# syntax tree bits in future. By checking for Razor GTD first we weren't deferring to Roslyn for plain attributes (ie, the case without `@bind-` in the tests) which means at best we do some extra unnecessary work, and at worst we could lose features for things Roslyn supports but we don't.

I did not intend to find this bug when I started. Sorry for missing it in the PR Dustin. The key is that `ignoreAttributes` should have been `true` when porting over the code, and changing that would have made the test fail in your branch.
2024-08-20 17:09:47 +10:00
David Wengier efceb90f2d Allow LSP and cohosting to provide specialized methods to get a syntax tree for a C# document 2024-08-20 17:06:26 +10:00
David Wengier caac5992ab Fix after merge 2024-08-20 11:14:24 +10:00
David Wengier 0c2504b047 Merge remote-tracking branch 'upstream/main' into dev/dawengie/SelfVersionedDocumentSnapshots 2024-08-20 11:01:31 +10:00
David Wengier 80ae134f9f PR Feedback 2024-08-20 10:44:08 +10:00
David Wengier e16582150b
Support component rename from an end tag (#10762)
Fixes https://github.com/dotnet/razor/issues/10717
2024-08-20 10:29:53 +10:00
Dustin Campbell 6593264ac6 Clean up and enable nullability for CodeRenderingContext and DefaultDocumentWriter 2024-08-19 17:16:07 -07:00
Dustin Campbell 7a9f32ea37 Pass RazorSourceDocument into CodeRenderingContext rather than RazorCodeDocument 2024-08-19 16:58:54 -07:00
Dustin Campbell 1eb601c417 Push NewLine setting into RazorCodeGenerationOptions
This change stops pushing the NewLine value into RazorCodeDocument.Items.
2024-08-19 16:58:54 -07:00
Dustin Campbell 28bfd61d38 Use SuppressUniqueIds exclusively from RazorCodeGenerationOptions
This change stops pushing the SuppressUniqueIds value into RazorCodeDocument.Items.
2024-08-19 16:58:54 -07:00
Dustin Campbell 96adc428f7 Collapse RazorCodeGenerationOptions boolean fields to a flags enum 2024-08-19 16:58:49 -07:00
Dustin Campbell 077764960f
Cohosting Support for Go to Definition (#10750)
Fixes #10631

Here's support for Go to Definition under co-hosting. Tests are still
incoming (and I'll add them before merging), but I wanted to get this
out for review to see if there's anything I missed or should implement
differently.
2024-08-19 16:53:32 -07:00
Dustin Campbell dd11c5e0db Clean up RazorCodeGenerationOptions a bit 2024-08-19 16:17:29 -07:00
Jared Parsons 0ff482d029
Dev Container (#10751) 2024-08-19 15:43:03 -07:00
Dustin Campbell 972691bc1e Merge RazorCodeGenerationOptions and DefaultRazorCodeGenerationOptions 2024-08-19 15:37:41 -07:00
Dustin Campbell 03e2d074c0 Merge RazorCodeGenerationOptionsBuilder and DefaultRazorCodeGenerationOptionsBuilder 2024-08-19 15:37:41 -07:00
Dustin Campbell 7ac711be8c Remove ItemCollection from CodeRenderingContext 2024-08-19 15:37:40 -07:00
Dustin Campbell 34507da443 Avoid extra allocations in IntermediateNodeExtensions.GetAllDiagnostics 2024-08-19 15:37:40 -07:00
Dustin Campbell 5072db43b5 Clean up pooled objects in CodeRenderingContext 2024-08-19 15:37:40 -07:00
Dustin Campbell 90f90ef875 Switch RazorCSharpDocument.Diagnostics to an ImmutableArray 2024-08-19 15:37:40 -07:00
Dustin Campbell ff63a4e603 Use pooled ImmutableArray builder for CodeRenderingContext diagnostics 2024-08-19 15:37:39 -07:00
Dustin Campbell c755804389 Swap RazorCSharpDocument.Create methods for constructors 2024-08-19 15:37:39 -07:00
Dustin Campbell 89204d4acf Clean up callers of RazorCSharpDocument.Create(...) 2024-08-19 15:37:39 -07:00
Dustin Campbell d00b1ffab8 Switch CodeRenderingContext.LinePragmas to an ImmutableArray 2024-08-19 15:37:39 -07:00
Dustin Campbell 25acc07be2 Merge RazorCSharpDocument and DefaultRazorCSharpDocument 2024-08-19 15:37:38 -07:00
Dustin Campbell 7ba41799a5 Pool ancestor stack in CodeRenderingContext 2024-08-19 15:37:38 -07:00
Dustin Campbell 635695fefb Pool line pragmas in CodeRenderingContext 2024-08-19 15:37:38 -07:00
Dustin Campbell 86e05ee42c Pool scope stack in CodeRenderingContext 2024-08-19 15:37:38 -07:00
Dustin Campbell 0e1774a4ee Clean up CodeRenderingContext a bit 2024-08-19 15:37:38 -07:00
Dustin Campbell 80d1ed36ee Merge CodeRenderingContext and DefaultCodeRenderingContext 2024-08-19 15:37:38 -07:00
David Wengier a8c3c3626a Use a proper Try pattern 2024-08-20 08:16:02 +10:00
Dustin Campbell 9325817b4e Add tests for co-hosted GTD 2024-08-19 12:57:46 -07:00
Dustin Campbell e69661cc37 Rework IDocumentPositionInfoStrategy and use correctly in co-hosted GTD 2024-08-19 10:36:55 -07:00
Dustin Campbell f666b2c1e8 Add DocumentMappingSerice to RazorDocumentServiceBase 2024-08-19 09:53:33 -07:00
Dustin Campbell fd09361c51 Move IDocumentPositionInfoStrategy and friends to Workspaces layer 2024-08-19 09:48:05 -07:00
Dustin Campbell ede6a1662c Pass IDocumentSnapshot to GetDefinitionAsync instead of DocumentContext 2024-08-19 09:28:30 -07:00
dotnet-maestro[bot] 3bffce365f Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20240815.3
Microsoft.SourceBuild.Intermediate.source-build-reference-packages
 From Version 9.0.0-alpha.1.24405.2 -> To Version 10.0.0-alpha.1.24415.3
2024-08-19 12:52:10 +00:00
David Wengier 84def3b64d grrrr 2024-08-19 16:16:08 +10:00
David Wengier 4ced6b91dd Support component rename from an end tag 2024-08-19 15:35:25 +10:00
David Wengier af13ebdf10 PR feedback - sorta 2024-08-19 15:19:18 +10:00
David Wengier da79940a3a
Don't add already known documents to the misc files project (#10753)
Noticed in the logs that we were double-compiling files, and it was
causing issues in my "self versioned documents" branch. Separated out of
that to make it easier to review.

RCA is because we now share a project manager across VS and LSP server,
so we get real project information much sooner than before, which beats
file watchers etc.
2024-08-19 09:53:10 +10:00
David Wengier f1c3a700f3 PR feedback 2024-08-19 08:49:20 +10:00