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

15547 Коммитов

Автор SHA1 Сообщение Дата
David Wengier 2165fcb0c4 One last minor cleanup 2024-08-22 10:48:10 +10:00
David Wengier 114390078e Formalize Razor formatting options so we can have a single RazorFormattingPass 2024-08-22 09:13:11 +10:00
dotnet-maestro[bot] ceb06132c1 Update dependencies from https://github.com/dotnet/arcade build 20240821.2
Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk
 From Version 9.0.0-beta.24420.6 -> To Version 9.0.0-beta.24421.2
2024-08-21 18:17:13 +00:00
dotnet-maestro[bot] 3458abac8b Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20240819.1
Microsoft.SourceBuild.Intermediate.source-build-reference-packages
 From Version 10.0.0-alpha.1.24415.3 -> To Version 10.0.0-alpha.1.24419.1
2024-08-21 18:16:42 +00:00
dotnet-maestro[bot] a9eaef6edd Update dependencies from https://github.com/dotnet/arcade build 20240820.6
Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk
 From Version 9.0.0-beta.24416.2 -> To Version 9.0.0-beta.24420.6
2024-08-21 12:46:59 +00:00
David Wengier ca142becdc Move HtmlFormattingPass down 2024-08-21 22:09:14 +10:00
David Wengier 38868db9c2 Minor cleanup 2024-08-21 21:57:43 +10:00
David Wengier 3f578100fe Get HtmlFormatter from DI 2024-08-21 21:41:37 +10:00
David Wengier e56b85e264 Pass Html edits into the formatting service, so that the service doesn't need LSP client dependencies 2024-08-21 21:26:18 +10:00
David Wengier b477b4a75b Merge remote-tracking branch 'upstream/main' into dev/dawengie/SelfVersionedDocumentSnapshots
# Conflicts:
#	src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/DocumentContextExtensions.cs
2024-08-21 20:44:49 +10:00
dotnet bot fc8332fdd7
Merge release/dev17.12 to main (#10774)
This is an automatically generated pull request from release/dev17.12
into main.


Once all conflicts are resolved and all the tests pass, you are free to
merge the pull request. 🐯

## Troubleshooting conflicts

### Identify authors of changes which introduced merge conflicts
Scroll to the bottom, then for each file containing conflicts copy its
path into the following searches:
- https://github.com/dotnet/razor/find/release/dev17.12
- https://github.com/dotnet/razor/find/main

Usually the most recent change to a file between the two branches is
considered to have introduced the conflicts, but sometimes it will be
necessary to look for the conflicting lines and check the blame in each
branch. Generally the author whose change introduced the conflicts
should pull down this PR, fix the conflicts locally, then push up a
commit resolving the conflicts.

### Resolve merge conflicts using your local repo
Sometimes merge conflicts may be present on GitHub but merging locally
will work without conflicts. This is due to differences between the
merge algorithm used in local git versus the one used by GitHub.
``` bash
git fetch --all
git checkout -t upstream/merges/release/dev17.12-to-main
git reset --hard upstream/main
git merge upstream/release/dev17.12
# Fix merge conflicts
git commit
git push upstream merges/release/dev17.12-to-main --force
```
2024-08-21 02:32:14 -07:00
dotnet bot d7c7a32b2b
Merge release/dev17.11 to release/dev17.12 (#10767)
This is an automatically generated pull request from release/dev17.11
into release/dev17.12.


Once all conflicts are resolved and all the tests pass, you are free to
merge the pull request. 🐯

## Troubleshooting conflicts

### Identify authors of changes which introduced merge conflicts
Scroll to the bottom, then for each file containing conflicts copy its
path into the following searches:
- https://github.com/dotnet/razor/find/release/dev17.11
- https://github.com/dotnet/razor/find/release/dev17.12

Usually the most recent change to a file between the two branches is
considered to have introduced the conflicts, but sometimes it will be
necessary to look for the conflicting lines and check the blame in each
branch. Generally the author whose change introduced the conflicts
should pull down this PR, fix the conflicts locally, then push up a
commit resolving the conflicts.

### Resolve merge conflicts using your local repo
Sometimes merge conflicts may be present on GitHub but merging locally
will work without conflicts. This is due to differences between the
merge algorithm used in local git versus the one used by GitHub.
``` bash
git fetch --all
git checkout -t upstream/merges/release/dev17.11-to-release/dev17.12
git reset --hard upstream/release/dev17.12
git merge upstream/release/dev17.11
# Fix merge conflicts
git commit
git push upstream merges/release/dev17.11-to-release/dev17.12 --force
```
2024-08-21 02:01:04 -07:00
David Wengier a7027160ac Be SUPER specific about our APIs, what they accept, and what they return
This probably looks like overkill, but hopefully the next commit will help explain a little about what is going on.
2024-08-21 17:11:28 +10:00
David Wengier e45f09468d Make it more explicit that we only do code action formatting for C# 2024-08-21 16:25:41 +10:00
David Wengier 2c39c207c7 Random bits of cleanup before some bigger moves 2024-08-21 16:01:18 +10:00
David Wengier fba3f1e304 Rename some methods 2024-08-21 14:55:51 +10:00
David Wengier 8984db9496 Combine back into one on type formatting pass 2024-08-21 14:29:29 +10:00
David Wengier 97ac5367c7 Move add usings helper code down to the workspaces layer
This commit is just moves, no functionality changes. Minor tweaks to method visibility, and one rename of a static field :)
2024-08-21 14:18:10 +10:00
David Wengier 2723187736
Cohost Document Symbols (#10728)
Fixes https://github.com/dotnet/razor/issues/10689
Roslyn side: https://github.com/dotnet/roslyn/pull/74730

Looks good, despite the Roslyn side having VS deps for images:

![image](https://github.com/user-attachments/assets/44d2ac8d-f7c1-46ec-9572-15bfd91bed28)
2024-08-21 13:34:46 +10:00
David Wengier 687a473d0d Fix after merge 2024-08-21 11:58:33 +10:00
David Wengier 55c3058eb7 Merge remote-tracking branch 'upstream/main' into CohostDocumentSymbol
# Conflicts:
#	eng/targets/Services.props
#	src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs
#	src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs
2024-08-21 11:55:14 +10:00
David Wengier ca93e0ea0e PR feedback 2024-08-21 11:54:07 +10:00
David Wengier 0bb4e6e55e Bump Roslyn version 2024-08-21 11:53:28 +10:00
Alex Gavrilov d38698fa24
Moving formatting service to common layer (#10761)
* Moving RazorFormattingService to common layer

* Cleanup

* Switch Razor LSP server code to use RazorFormattingService from common layer

* Removing HTML formatting from common layer (for now)

It requires services not easily available and will require extra work. For now leaving it in LSP server layer. Current need for the formatting service in cohosting is for OnAutoInsert which doesn't need HTML formatting.

* Move AdhocServices, AdhoWorkspaceServices to common layer

* Cleanup moved resources

* Basic implementations for remote formatting classes

* Removing hardcoded option value

* Cleanup per CR suggestions

* Cleanup doc-comments
2024-08-21 01:49:14 +00:00
David Wengier acc84f69cf
Allow LSP and cohosting to provide specialized methods to get a syntax tree (#10765)
This PR is a classic self-nerd-snipe, and resolves this comment:
https://github.com/dotnet/razor/pull/10750#discussion_r1719087058

Also inadvertently found a slight "bug" with the existing go to def code
in cohosting. Bug is in quotes because the actual user behaviour
probably was identical in 99% of cases.
2024-08-21 11:08:49 +10:00
David Wengier a3edec0c8a Move GetSyntaxTree to document snapshot 2024-08-21 10:17:06 +10:00
David Wengier 53fec86c28 Inject file path service into the document snapshot 2024-08-21 09:49:42 +10:00
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