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

16320 Коммитов

Автор SHA1 Сообщение Дата
David Wengier 827d18b89a Remove unused enum, and replace with a bool
(and clean up a teeny tiny bit)
2024-11-11 13:59:00 +11:00
David Wengier ab46826b25 Update ProjectWorkspaceState and HostProject at the same time 2024-11-11 13:27:10 +11:00
David Wengier f6384a995a
fix codefix that wasn't closed (#11187) 2024-11-09 10:00:19 +11:00
Bill Wagner f2bb68e0f0 fix codefix that wasn't closed 2024-11-08 15:56:39 -05:00
Dustin Campbell df548d6e91
Remove ImportDocumentSnapshot and (finally) fix nullability annotations on IDocumentSnapshot (#11184)
Commit-by-commit is the way. 😄
2024-11-08 12:39:46 -08:00
David Wengier 121b129b01
More cohost code actions tests! (#11179)
I couldn't originally test some code actions because they used the file
system, so I intended this PR to fix that by abstracting the file system
away. It is that, but I also found some more tests that we lacked
coverage for in cohosting, and since I find the cohosting tests to be
just so wonderful (not biased at all, obviously) I thought I'd be a bit
extra.

I deliberately didn't try to fix any of the code actions, but I think
they could probably all do with some nicer whitespace handling. Managed
to avoid the self-nerd-snipe this time though.
2024-11-08 14:48:28 +11:00
David Wengier 05ca7339cc Add feature flag to turn on the new Roslyn tokenizer 2024-11-08 14:13:17 +11:00
Dustin Campbell b31ace04ef Fix nullability of IDocumentSnapshot
For a long while IDocumentSnapshot's FileKind, FilePath, and TargetPath properties have all been annotated as nullable. It turns out that the only reason for this was ImportDocumentSnapshot, which has been removed. So, we can now allow these properties to be correctly annotated as non-nullable,
2024-11-07 16:47:54 -08:00
Dustin Campbell 8de0cf0002 Delete ImportDocumentSnapshot now that it is unused 2024-11-07 16:47:54 -08:00
Dustin Campbell f6761de0cd Make DocumentState.ImportItem private 2024-11-07 16:47:53 -08:00
Dustin Campbell ff8a76077c Don't expose DocumentState.GetImportsAsync
This change removes several parameters from DocumentState.GenerateCodeDocumentAsync(...) and computes them internally. So, there's no longer a need to expose GetImportsAsync for GenerateCodeDocumetnAsync callers.
2024-11-07 16:47:48 -08:00
David Wengier 43c0969638
Fix some mistakes in strings that have no bearing on anything important 2024-11-08 11:46:59 +11:00
Dustin Campbell bd735d380e Don't produce intermediary array of document snapshots
When computing the ImportItems for a given document, we shouldn't need to compute an intermediary array of document snapshots.
2024-11-07 16:42:21 -08:00
Dustin Campbell c6ab8196a0 Clean and refactor code within GenerateCodeDocumentAsync a bit 2024-11-07 16:29:16 -08:00
Dustin Campbell e4dca37173 Make method private
The comment explaining why this DocumentState method is internal seems to be out of date. It's currently only used within DocumentState, so this change removes the comment and makes it private.
2024-11-07 16:29:14 -08:00
David Wengier 34cacfab07
Fix FUSE hook up in VS Code (#11175)
This one might be a _little_ controversial in terms of how I wired the
`LanguageServerFeatureOptions` up through the `ProjectSnapshot`, but
it's somewhat similar to how it works in cohosting, with
`RemoteProjectSnapshot -> RemoteSolutionSnapshot ->
SolutionSnapshotManager -> LanguageServerFeatureOptions`.

Aside from that aspect of the specific implementation, which you're more
than welcome to critique and suggest an alternative to, the fundamental
change here is removing `LanguageServerFlags` and using
`LanguageServerFeatureOptions` directly. It seems that
`LanguageServerFlags` was intended to encapsulate the feature options
for the compiler, but since that time they are never actually used by
the compiler, and just ended up in a weird spot. They were "flags for
the language server", but were only ever initialized in VS. We we
essentially ended up with this unnecessary middle-man, that didn't
always exist. The `LanguageServerFeatureFlags` on the other hand are
always set in VS, VS Code, etc.

TL;DR: Now that all of the code for deciding whether to use runtime
compilation is entirely on the tooling side, it just makes sense to use
the tooling side options class directly.
2024-11-08 11:27:16 +11:00
David Wengier 62b6d9bd30
Fix typo (#11180)
Noticed this in a completion popup yesterday
2024-11-08 10:55:33 +11:00
David Wengier 3db7162a42
Update VSTelemetryAPI version (#11181)
Updates VSTelemetryAPI version to 17.13.16
2024-11-08 10:53:27 +11:00
Pierson Lee (PIE) 3a833ff65a
Update to correct version to match VS 2024-11-07 15:02:32 -08:00
Pierson Lee (PIE) fe16af32f3
Update VSTelemetryAPI version 2024-11-07 14:54:56 -08:00
David Wengier 9a0fc66b98 Fix typo 2024-11-08 09:51:26 +11:00
David Wengier 3f0cd58780 Fix build 2024-11-08 09:34:02 +11:00
David Wengier 6299cb964b Add a couple more missing tests 2024-11-08 08:57:09 +11:00
David Wengier 76f78df342 Move generate method code action to use IFileSystem and add tests 2024-11-08 08:57:09 +11:00
David Wengier f827edad77 Move component accessibility code action provider to IFileSystem, and add tests 2024-11-08 08:57:09 +11:00
David Wengier f195130747 Convert static helper into a extension method 2024-11-08 08:57:09 +11:00
David Wengier 5fe03dc869 Make IFileSystem a real, non-obsolete, DIed service 2024-11-08 08:57:09 +11:00
Andrew Hall 78bafebff2
Fix format on paste data readon from request (#11176)
It turns out the value comes back as a JsonElement instead of the underlying type 🤷
2024-11-07 13:47:31 -08:00
Dustin Campbell cdd0fdc87f
Update breaking change docs titles (#11178)
Mirror the changes in dotnet/roslyn#75789

See dotnet/AspNetCore.Docs#33996
2024-11-07 11:20:26 -08:00
Jan Jones c382522edc
Re-apply "Some random clean up and improvements (#11095)" (#11177) 2024-11-07 18:06:23 +01:00
Bill Wagner f262b917de Update breaking change docs titles
Mirror the changes in dotnet/roslyn#75789
2024-11-07 10:16:09 -05:00
David Wengier 40d2a6f1e6
Cohost code actions (#11147)
Fixes https://github.com/dotnet/razor/issues/10742
Needs https://github.com/dotnet/roslyn/pull/75711 before it will build
Also will need to merge in main once
https://github.com/dotnet/razor/pull/11141 is merged
2024-11-07 22:22:17 +11:00
David Wengier 87c0163974 Update tests and benchmark 2024-11-07 14:03:16 +11:00
David Wengier 9d02758cd2 Use LanguageServerFeatureOptions to get the language server feature option 2024-11-07 14:03:08 +11:00
David Wengier 19831e9f98 Remove LanguageServerFlags
These flags were explicitly not for the compiler, being not serialized, and hence don't really belong on RazorConfiguration.
They also were only ever set in the VS layer
2024-11-07 14:02:30 +11:00
David Wengier 390aced03b
Halve the time it takes to run formatting unit tests (#11173)
Turns out the boolean parameter passed in here is read in exactly one
spot in our code, and that line of code is never hit in these tests
because they use mocks.

Yes, this is the equivalent of removing a `Thread.Sleep` that was put in
previously, but I'm taking it regardless :)
2024-11-07 11:34:46 +11:00
David Wengier 31469c41cb Further tweak Roslyn helpers 2024-11-07 11:27:53 +11:00
David Wengier 6745d9b021 Halve the time it takes to run formatting unit tests 2024-11-07 10:40:47 +11:00
Dustin Campbell e87f30d14b
Add cohosting Hover test for component attribute (#11171)
Even though component attributes look like HTML they map to generated
C#. In this case, Hover prefers C# over HTML and requests hover data
from Roslyn. This adds a test for that scenario.
2024-11-06 14:36:21 -08:00
Alex Gavrilov c6c3190965
Fixing html snippet completion and intergration tests (#11172)
HTML snippet completions were being included when they shouldn't have been
2024-11-06 13:35:25 -08:00
David Wengier aebf195d9d Tweak roslyn helpers and nullability 2024-11-07 08:32:16 +11:00
Dustin Campbell a28edaf22b Add cohosting Hover test for component attribute
Even though component attributes look like HTML they map to generated C#. In this case, Hover prefers C# over HTML and requests hover data from Roslyn. This adds a test for that scenario.
2024-11-06 09:21:40 -08:00
dotnet bot 6e796fe6f1
Merge release/dev17.13 to main (#11170)
This is an automatically generated pull request from release/dev17.13
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.13
- 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.13-to-main
git reset --hard upstream/main
git merge upstream/release/dev17.13
# Fix merge conflicts
git commit
git push upstream merges/release/dev17.13-to-main --force
```
2024-11-06 07:34:46 +01:00
David Wengier 6cd3c632d6 Fix namespace on test 2024-11-06 16:35:25 +11:00
David Wengier 15c03334ae Fix registration after merge 2024-11-06 16:35:16 +11:00
David Wengier 706dc9362c FIx code actions resolve in VS.
Lost hours to that bloody capital T
2024-11-06 16:35:05 +11:00
dotnet bot f3a99f74df
Merge release/dev17.13 to main (#11167)
This is an automatically generated pull request from release/dev17.13
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.13
- 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.13-to-main
git reset --hard upstream/main
git merge upstream/release/dev17.13
# Fix merge conflicts
git commit
git push upstream merges/release/dev17.13-to-main --force
```
2024-11-06 05:02:14 +01:00
David Wengier 04da68965e Merge remote-tracking branch 'upstream/main' into dev/dawengie/CodeActionsPart5 2024-11-06 14:41:19 +11:00
Phil Allen 05e142e9a7
Revert "Some random clean up and improvements (#11095) (#11169)
Revert "Some random clean up and improvements (#11095) for dev17.13
2024-11-05 19:19:52 -08:00
David Wengier 61b5d93d9e PR Feedback 2024-11-06 14:17:32 +11:00