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

15547 Коммитов

Автор SHA1 Сообщение Дата
Dustin Campbell fcf0de81b6 Remove unused ErrorSink method 2024-08-27 11:00:17 -07:00
Dustin Campbell 69d4b10665 Create RazorSyntaxTree with ImmutableArray<RazorDiagnostic> 2024-08-27 11:00:17 -07:00
Dustin Campbell aa0d7a7d58 Clean up ParserContext and use pooled collections
This change cleans up ParserContext a bit and uses pooled collections within it.
2024-08-27 11:00:17 -07:00
Dustin Campbell 0df9f259c6 Rework ErrorSink
- Use pooled `ImmutableArray<RazorDiagnostic>.Builder` internally
- Don't request pooled builder until first error is added
- Make ErrorSink disposable to return builder to pool
- Add GetErrorsAndClear() method to returns an `ImmutableArray<RazorDiagnostic>` and clears out the sink.
- Add 'ParserContext.PushNewErrorScope(...)` to handle the temporary ErrorSinks used by CSharpCodeParser
2024-08-27 11:00:17 -07:00
Dustin Campbell e98f5e8071 Switch RazorSyntaxTree.Diagnostics to an ImmutableArray<RazorDiagnostic> 2024-08-27 11:00:16 -07:00
Dustin Campbell 33ad4fb0fc Enable nullability for RazorSyntaxTree 2024-08-27 11:00:16 -07:00
Dustin Campbell 8cba23587a Clean up RazorSyntaxTree.Diagnostics computation 2024-08-27 11:00:16 -07:00
Dustin Campbell 2476b630ef Refactor tests to share ordering test data 2024-08-27 11:00:11 -07:00
Chris Sienkiewicz 6045ef21ac
Suppress unique ids (#10791)
* Use more obvious SuppressUniqueIds value
* Update baselines
2024-08-27 08:52:17 -07:00
Dustin Campbell 965d3e8307 Add (Drain)ToImmutableOrdered* methods to PooledArrayBuilder<T> 2024-08-27 08:44:17 -07:00
Dustin Campbell a7e5bf9152 Prefer constructor over Create method 2024-08-27 08:44:17 -07:00
Dustin Campbell b6eb03fb0d Merge RazorSyntaxTree and DefaultRazorSyntaxTree 2024-08-27 08:44:16 -07:00
dotnet-maestro[bot] d7b76ad623 Update dependencies from https://github.com/dotnet/arcade build 20240826.3
Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk
 From Version 9.0.0-beta.24423.2 -> To Version 9.0.0-beta.24426.3
2024-08-27 12:52:28 +00:00
David Wengier 1ea1552e6c
Self-versioned documents (#10747)
A few integration tests to investigate, but the guts are here.

I'm _slightly_ worried this might cause us to recompile files more
often, but there is also the chance this fixes a bunch of bugs by
recompiling files more often :)

Commit-at-a-time review is highly recommended, as there are lots of flow
on effects of API changes
2024-08-27 15:32:01 +10:00
David Wengier 0499664e37
Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2524803 (#10790)
This is the pull request automatically created by the OneLocBuild task
in the build process to check-in localized files generated based upon
translation source files (.lcl files) handed-back from the downstream
localization pipeline. If there are issues in translations, visit
https://aka.ms/icxLocBug and log bugs for fixes. The OneLocBuild wiki is
https://aka.ms/onelocbuild and the localization process in general is
documented at https://aka.ms/AllAboutLoc.
2024-08-27 15:31:13 +10:00
dotnet bot 75dcf45e3b
Merge release/dev17.12 to main (#10794)
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-26 21:18:36 -07:00
David Wengier 19134c2ee6 PR feedback 2024-08-27 14:08:54 +10:00
David Wengier 8cebb29b87 Remove debug.fails 2024-08-27 14:00:50 +10:00
David Barbet fe31c903d5
Snap for 17.12 P2 (#10793)
merge main into release/dev17.12 to update for 17.12 P2. Main is 17.12
P3.
2024-08-26 18:55:52 -07:00
David Barbet 8ff61a0bf1
Update configs for 17.12p3 snap (#10792)
Draft until snap time.
2024-08-26 17:54:02 -07:00
David Wengier 156f016fff
Fix Formatting and On Enter integration tests (#10788)
Since the end of last week, these tests have been failing. Seems like
something changed on the platform side, perhaps a default value of a
setting. Have started a thread with the editor team to see if we need to
do more.
2024-08-27 07:12:11 +10:00
David Barbet e7db6bcb15
Update configs for 17.12p3 snap 2024-08-26 13:59:43 -07:00
dotnet bot fff39dce74 Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2524412 2024-08-26 10:30:38 -07:00
dotnet bot 038f7fc416 Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2524412 2024-08-26 10:29:28 -07:00
Chris Sienkiewicz aa024eb33f
[FUSE] Provide intellisense for @inject directives (#10771)
* When @Inject is missing the member name, generate a syntactically valid c# identifier so we get intellisense
* Emit an empty section when there is no typename
* Add tests and update baselines
2024-08-26 10:14:26 -07:00
dotnet-maestro[bot] 5ca9964844 Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20240821.1
Microsoft.SourceBuild.Intermediate.source-build-reference-packages
 From Version 10.0.0-alpha.1.24419.1 -> To Version 10.0.0-alpha.1.24421.1
2024-08-26 12:52:05 +00:00
David Wengier cdcef8e730 Force "Insert Spaces" to be true for Razor documents 2024-08-26 12:59:55 +10:00
David Wengier aeca1e4a27 Don't crash because another team has a bad assumption 2024-08-26 12:59:41 +10:00
dotnet-maestro[bot] 286b3e180f Failed to perform coherency update for one or more dependencies. 2024-08-25 12:03:40 +00:00
dotnet-maestro[bot] e841c0e5ee Update dependencies from https://github.com/dotnet/arcade build 20240823.2
Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk
 From Version 9.0.0-beta.24421.7 -> To Version 9.0.0-beta.24423.2
2024-08-24 12:41:50 +00:00
David Barbet b5e50df997
[release/dev17.11] Update dependencies from dotnet/arcade (#10552)
This pull request updates the following dependencies

[marker]: <> (Begin:aa7f5ce7-ed24-46a1-195c-08dc952fc8a2)
## From https://github.com/dotnet/arcade
- **Subscription**: aa7f5ce7-ed24-46a1-195c-08dc952fc8a2
- **Build**: 20240821.4
- **Date Produced**: August 21, 2024 6:41:26 PM UTC
- **Commit**: 4460b755f3c7c89e9660d9580ff79afc4218dd85
- **Branch**: refs/heads/release/8.0

[DependencyUpdate]: <> (Begin)

- **Updates**:
- **Microsoft.SourceBuild.Intermediate.arcade**: [from
8.0.0-beta.24413.2 to 8.0.0-beta.24421.4][44]
- **Microsoft.DotNet.Arcade.Sdk**: [from 8.0.0-beta.24413.2 to
8.0.0-beta.24421.4][44]

[44]: 51321b7e15...4460b755f3

[DependencyUpdate]: <> (End)


[marker]: <> (End:aa7f5ce7-ed24-46a1-195c-08dc952fc8a2)
2024-08-23 10:32:18 -07:00
dotnet-maestro[bot] 79d0c3ca94 Failed to perform coherency update for one or more dependencies. 2024-08-23 12:13:16 +00:00
David Wengier 2157169d4d More PR feedback 2024-08-23 16:24:43 +10:00
David Wengier 3b7942872b Merge remote-tracking branch 'upstream/main' into FormattingLayering 2024-08-23 16:10:44 +10:00
David Wengier 6622a0f979 Missed the readonly bit 2024-08-23 13:53:55 +10:00
David Wengier 587e72a2f2 Simple PR feedback 2024-08-23 13:41:24 +10:00
David Barbet d031cc6ecc
Merge branch 'main' into darc-main-a925341a-a0ef-49f7-bc6e-6525c5d13555 2024-08-22 16:00:20 -07:00
David Wengier 4124ce4370 Remove unused parameter 2024-08-23 07:05:50 +10:00
Dustin Campbell 3423142c7d
Remove ItemCollection from CodeRenderingContext (#10764)
Because of a dare from @333fred, I'm currently on a crusade to remove
`ItemCollection` from the Razor Compiler completely. Previously, I
removed `ItemCollection` from `TagHelperDescriptorProviderContext`
(#10720). This time, I'm removing it from `CodeRenderingContext`.

It turns out that every `CodeRenderingContext` greedily creates an
`ItemCollection`, though there are only ever two things stored there:

1. A string to use for new lines in `CodeWriter`.
2. A string representing "suppress IDs", which is already specified in
`RazorCodeGenerationOptions`.

These two items were really present as a hook that compiler tests could
set. However, it's much easier and less wasteful to elevate both items
to `RazorCodeGenerationOptions` and make tests set the options directly.

I made a few other refactorings as part of this change:

- I merged several abstract base classes with their single default
concrete type:
  - `CodeRenderingContext` and `DefaultCodeRenderingContext`
  - `RazorCSharpDocument` and `DefaultRazorCSharpDocument`,
  - `RazorCodeGenerationOptions` and `DefaultRazorCodeGenerationOptions`
- `RazorCodeGenerationOptionsBuilder` and
`DefaultRazorCodeGenerationOptionsBuilder`.
- Reworked `RazorCodeGenerationOptions` and introduced
`RazorCodeGenerationOptionsFlags` to track its boolean fields.
- Cleaned up `RazorCSharpDocument` and unified its collections on
`ImmutableArray<>` rather than `IReadOnlyList<>`.
- Enabled nullability annotations for several types.
- Used more pooled collections in `CodeRenderingContext`.

Note: I was careful with my commit history, and it should be clean
enough to review commit-by-commit if that's your preference.
2024-08-22 13:53:35 -07:00
dotnet-maestro[bot] 6970dee518 Update dependencies from https://github.com/dotnet/arcade build 20240821.4
Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk
 From Version 8.0.0-beta.24413.2 -> To Version 8.0.0-beta.24421.4
2024-08-22 13:05:55 +00:00
dotnet-maestro[bot] ec191f808a Update dependencies from https://github.com/dotnet/arcade build 20240821.7
Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk
 From Version 9.0.0-beta.24421.2 -> To Version 9.0.0-beta.24421.7
2024-08-22 12:43:45 +00:00
David Wengier 3b2ba30db1 We can't tell the client which version we're applying edits for, because only we understand our version numbers 2024-08-22 22:18:39 +10:00
David Wengier fa4e8efb54 Remove FormattingResult since it's now useless 2024-08-22 17:02:20 +10:00
David Wengier 5caa48f8e3 Remove Kind property from FormattingResult
This was only used for validation as edits pass through the pipeline, but since we now tightly control the pipeline its unnecessary
2024-08-22 16:44:17 +10:00
David Wengier 45b8495ac8 List -> PooledArrayBuilder 2024-08-22 16:13:45 +10:00
David Wengier ef44f4fe61 Separate out the files in the Html formatter passes.
Doing this separately, and purely mechanically, so make review easier
2024-08-22 15:12:55 +10:00
David Wengier f74150db38 Separate html formatting passes, so we can remove the IsFormatOnType flag 2024-08-22 15:12:12 +10:00
David Wengier 6f1c6ef398 Remove unnecessary base class 2024-08-22 14:43:59 +10:00
David Wengier 4e1211718a Move files to their own folder 2024-08-22 12:31:10 +10:00
David Wengier d6357548f3 Be explicit about formatting passes
Always felt like a huge potential bug farm. eg, if Html ended up not being first we'd have bugs, working out the Order property (which was weirdly backwards?) was a pain, and the entire formatting engine produces horrible results if the ordering changes anyway.
2024-08-22 12:30:40 +10:00