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

16231 Коммитов

Автор SHA1 Сообщение Дата
Alex Gavrilov (DEV PROD) 2058042b79 Making resolve request handler callable in cohosting
- Making the resolve completion use document for cohosting
- Serializing TextDocument property into Data member of completion items so that Roslyn will forward the request to us
- Basic sanity test (shows we are getting called now)
2024-11-18 14:12:31 -08:00
Alex Gavrilov (DEV PROD) 87e93c7f8a Skeleton implementation 2024-11-12 20:31:54 -08:00
David Wengier 95f862d12e
Update ProjectWorkspaceState and HostProject at the same time (#11191)
Preparation for ongoing work to hook up the Roslyn tokenizer and
https://github.com/dotnet/razor/issues/11182 I suppose.

There were three places that `UpdateProjectWorkspaceState` was called:

1. In `RazorProjectService`, just before calling
`UpdateProjectConfiguration`
2. In `ProjectWorkspaceStateGenerator`, where we will need to add a call
to `UpdateProjectConfiguration` in future, to wire up the tokenizer
3. In our LiveShare bits, in response to events from the above.

Previous attempts to plumb through more things for `RazorConfiguration`
resulted in RPS failures, that appeared to be simply more compilations
of closed files. This makes sense because we were adding another update,
which would have triggered another set of `ProjectChanged` events. I
thought it would make more sense to combine these two updates together,
so no matter which part of the project was being updated, there could be
a single `ProjectChanged` notification. This is that.
2024-11-12 13:43:48 +11:00
David Wengier f3aa64757d
Add feature flag to turn on the new Roslyn tokenizer (#11185)
This makes the feature work in VS and VS Code (with corresponding VS
Code change to pass the right flag, coming once this is merged)

VS Code PR: https://github.com/dotnet/vscode-csharp/pull/7748

/cc @danroth27, @leslierichardson95, @333fred, @chsienki and anyone else
who wants, for wording:
VS Code:

https://github.com/dotnet/vscode-csharp/pull/7748/files#diff-9b29d8b47a74097a04da353b72a8632d485d658282457b97b4caf26575a42dd0R131
VS:

https://github.com/dotnet/razor/pull/11185/files#diff-18b9b146f4d27a6a5b6248ece31b30570d84c2a409b25bf5b660de86e608fa4cR80
2024-11-12 11:16:10 +11:00
David Wengier 4b7e93d6f4 PR feedback 2024-11-12 10:29:55 +11:00
David Wengier b36e8925b0 PR feedback 2024-11-12 10:24:50 +11:00
Alex Gavrilov aeebb01d00
Move completion resolve code to common layer (#11156)
* Move completion resolve code to common layer

* Undo move of IProjectSnapshotManagerExtensions and MiscFilesHostProject per PR feedback

* Undo unnecessary changes in tests

* Refactor the code to remove usage of IProjectSnapshotManager
2024-11-11 14:37:48 -08:00
David Wengier 8a2c71f196
Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2579832 (#11197) 2024-11-12 09:25:00 +11:00
dotnet bot 0d2b37e672 Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2579832 2024-11-11 22:04:21 +01:00
dotnet bot efafc82d5c Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2579832 2024-11-11 22:03:09 +01:00
David Wengier 22980a43b8
[main] Update dependencies from dotnet/source-build-reference-packages (#11193)
This pull request updates the following dependencies

[marker]: <> (Begin:011df26a-fbd1-45b0-94b9-08db3601dcca)
## From https://github.com/dotnet/source-build-reference-packages
- **Subscription**: 011df26a-fbd1-45b0-94b9-08db3601dcca
- **Build**: 20241108.1
- **Date Produced**: November 8, 2024 2:38:25 PM UTC
- **Commit**: 1ebd9ce245112164207d961c0d2faea741c7c489
- **Branch**: refs/heads/main

[DependencyUpdate]: <> (Begin)

- **Updates**:
-
**Microsoft.SourceBuild.Intermediate.source-build-reference-packages**:
[from 10.0.0-alpha.1.24530.1 to 10.0.0-alpha.1.24558.1][1]

[1]:
136e43e45e...1ebd9ce245

[DependencyUpdate]: <> (End)


[marker]: <> (End:011df26a-fbd1-45b0-94b9-08db3601dcca)
2024-11-12 07:49:49 +11:00
dotnet-maestro[bot] 6a35742bda Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20241108.1
Microsoft.SourceBuild.Intermediate.source-build-reference-packages
 From Version 10.0.0-alpha.1.24530.1 -> To Version 10.0.0-alpha.1.24558.1
2024-11-11 13:42:23 +00:00
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