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

16102 Коммитов

Автор SHA1 Сообщение Дата
Andrew Hall 3360dd4e89
Cherry-Pick 11181 (#11183)
Cherry-Pick #11181  to update telemetry version
2024-11-07 17:32:21 -08:00
Pierson Lee (PIE) 995e505ad8 Update to correct version to match VS 2024-11-07 17:01:33 -08:00
Alex Gavrilov 6ff656614e
Adding client capabilities to OOP client initialization data (#11129)
* Add RemoteClientCapabilities service

The service gets initialized once during initial connection / init and provides client capabilities to other remote services.

* Add RemoteClientCapabilitiesService
- Adding client capabilities to RemoteClientLSPInitializationOptions
- Converting IRemoteClientIntializationService to be a JSON service for simplicity of data serialization
- Converting client initialization code to use JSON client to call IRemoteClientIntializationService

* Fixing tests

* Removing unneeded class

* Fixing tests

* Export IClientCapabilitiesService and consume it when appropriate

Only consumers that are initializing capabiilities service by calling SetCapabilities should be importing it via RemoteClientCapabilitiesService. All other consumers should be using IClientCapabilitiesService.

* Simplifying code, moving and correcting comment

* Test fixup per PR feedback

* Service rename per PR feedback

* More PR feedback

- Renaming a variable
- Made UpdateClientLSPInitializationOptions mode complete (so it updates RemoteSemanticTokensLegendService now with initialization data)
- Removed limitation of single update on RemoteSemanticTokensLegendService
- Use UpdateClientLSPInitializationOptions  in cohost semantic tokens test

* Removed unused service
2024-11-01 00:38:05 +00:00
Andrew Hall 09cba53db5
Fix aggregate telemetry reliability (#11134)
Currently telemetry is flushed after the language server host exits in VS Code. This is correctly flushing to the telemetry session, but can miss actually reporting the telemetry. In VS the lifetime of the TelemetrySession is managed centrally, but in VS Code it is up to each process to make sure it gets disposed properly. Without this telemetry that is fired could be dropped. This change addresses this by doing the following:

Removing the flush method on ITelemetryReporter
Making TelemetryReporter IDisposable (again). This will be disposed by the DI container.
Keep the DI container (ExportProvider) alive in rzls until the language server host exits.
This should fix the reliability of some telemetry getting dropped. It still won't fix the scenario where the user force closes the process but better aligns VS and VS Code in expectation of lifetime management.

I noticed this while trying to set up dashboards. There are not nearly as many events as would be expected. If this still continues to be an issue one more option would be to flush on a timer. The data itself is aggregated and should handle that nicely.
2024-11-01 00:29:44 +00:00
David Wengier 17eec6578b
Pass `DisposalToken` in tests (#11127)
Random pet peeves on a Thursday evening.
2024-11-01 08:09:17 +11:00
David Wengier 59d3de55ad
Make "add using" code actions high priority (#11128)
Fixes https://github.com/dotnet/razor/issues/11049

Turns out https://github.com/dotnet/razor/pull/11069 meant the ordering
of Razor and C# code actions is no longer a problem, so all we need to
do is make sure the code actions that introduce new `@using` directives
comes first.
2024-11-01 08:07:21 +11:00
Dustin Campbell 05f1ef684b Fix tests by setting up mocks with CancellationToken.None
These tests had been changed to set up mocks with DisposalToken from the testing infrastructure. However, the product code being tested doesn't have access to that CancellationToken and always passes CancellationToken.None to the method being mocked.
2024-10-31 09:06:00 -07:00
David Wengier d331eb77e9 Fix tests 2024-10-31 22:24:34 +11:00
David Wengier 4ab51017e8 Make extract component low priority 2024-10-31 22:14:52 +11:00
David Wengier 7c4094f148 Just because they're tests, doesn't mean we can't use proper cancellation tokens 2024-10-31 21:20:32 +11:00
David Wengier 4bf2470b12
docs: better bootstrapping xp (#11124)
### Summary of the changes

- optimize docs for first-time pull-experience

Fixes:
Some initial confusion when starting to work with the repo
2024-10-31 20:52:05 +11:00
dotnet bot b7255b89ef
Merge release/dev17.13 to main (#11125)
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-10-31 01:34:18 +01:00
David Wengier c5babf1368
[FUSE] Fix OnAutoInsert and override completion and possible others (#11122)
Fixes https://github.com/dotnet/razor/issues/11112
Hopefully fixes
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2290299/ but I'm
not sure, as whilst OnAutoInsert was definitely broken for me, it didn't
cause that repro. It just sent telemetry for a fault and did nothing in
the IDE.
Fixes
https://developercommunity.visualstudio.com/t/Razor-editor-is-broken-in-1712-Preview-/10777527
~but awaiting confirmation that FUSE is on for the user who reported the
issue (@richardhauer I don't suppose that's you?)~
Fixes https://dev.azure.com/devdiv/DevDiv/_workitems/edit/2294069

Sadly, in order to get a working test for this, I had to enable FUSE in
cohosting. I say sadly because whilst it proves the cohosting tests are
awesome, it does potentially break us into jail a little bit. But only
in cohosting, so it's a pretty small jail :)

The changes aren't very exciting, as this is just
https://github.com/dotnet/razor/pull/10967 but for more than code
actions (and these changes probably should have been part of that PR
originally 🤦‍♂️), but each commit has an explanation for why it's there
so commit-at-a-time might be enlightening. I could not resist a little
clean up, but what's one little deleted service between friends?
2024-10-31 10:08:38 +11:00
David Wengier 5838cd55c9 More FUSE test coverage 2024-10-31 09:41:53 +11:00
David Wengier 9f60585428 Remove IFormattingCodeDocumentProvider
Since this service was written, IDocumentSnapshot has been updated such that now, all implementations just passed true for a parameter that is part of the existing API
2024-10-31 09:41:53 +11:00
David Wengier 03a0e2285e Fix guard clause, and failure result
This was returning the passed in changes, which were for a C# document, when the formatting engine should be producing changes for the Razor document, so that was wrong. Additionally, the guard itself was wrong
2024-10-31 09:41:53 +11:00
David Wengier f959a9a4da Make sure we get the right code document and pass it in
Previously this was using a boolean flag that I thought was the correct pivot point, but I was wrong, and it made things very confusing. This is much clearer, and more importantly, correct. Essentially if we are trying to format and we get passed a C# edit, then we can't force design time or it would be a different document than the original edit came from, if FUSE is on.
2024-10-31 09:41:53 +11:00
David Wengier 9b7ed904a7 Create failing test
Sadly, to get this far I had to opt cohosting into FUSE, which will have untold consequences
2024-10-31 09:41:53 +11:00
earloc f40133a61c
Update docs/contributing/BuildFromSource.md
Applying suggestion from code-review

Co-authored-by: Andrew Hall <ryzngard@live.com>
2024-10-30 23:16:40 +01:00
Dustin Campbell 51c7d56350
Push hover logic to Workspaces layer (#11119)
This change moves all of the logic that computes a `VSInternalHover` to
the Workspaces layer. The file diff shouldn't be too bad, but a lot of
code is moved without much additional clean up. So, it might be easier
to go commit-by-commit.
2024-10-30 14:29:42 -07:00
earloc 191e62e338 fix: duplicate newline as error 2024-10-30 21:48:58 +01:00
Dustin Campbell aa3209ad0e Remove superfluous argument null checks 2024-10-30 13:45:26 -07:00
Dustin Campbell 31eacc3e0d Add back SingleServerSupport check that was accidentally removed awhile ago 2024-10-30 13:41:51 -07:00
earloc 165d4168a4 docs: explain how to potentially get rid of `path-too-long`-errors 2024-10-30 20:29:00 +01:00
earloc e6ce7ae383 docs: format to better spot command-lines to execute while bootstrappin' 2024-10-30 20:14:50 +01:00
earloc ee96fe79ba doc: mention need for 'long-path'-support 2024-10-30 20:13:03 +01:00
Alex Gavrilov 41693dec1d
Update Roslyn package references to latest available and do minor fixup (#11113)
* Update Roslyn package references to latest available and do minor fixup

* Updating Versions.Details.xml to match Versions.props

* PR suggestion

* Fixing test failures

Roslyn was requesting new IRazorMappingService and our TestRazorDocumentServiceProvider was throwing. Returning null for now per suggestion from Andrew.

* Adding TODO comment per code review
2024-10-30 06:08:43 -07:00
Dustin Campbell e638ab6dcd Fix up HoverFactoryTest 2024-10-29 16:27:06 -07:00
Dustin Campbell b8a139270f Remove HoverService from the language server
Now that the implementation of GetHoverAsync has moved to Workspaces, HoverService really doesn't need to carry on.
2024-10-29 16:27:06 -07:00
Dustin Campbell 494e0f3df5 Move GetHoverAsync tests to Workspaces
Moving the existing hover tests requires a few test infrastructure changes.
2024-10-29 16:27:05 -07:00
Dustin Campbell 908ed82584 Move GetHoverAsync implementation to Workspaces 2024-10-29 16:27:05 -07:00
Dustin Campbell 8d53309985 Move HoverDisplayOptions to Workspaces 2024-10-29 16:27:05 -07:00
Dustin Campbell 08973b4513 Some tweaks and clean up in HoverService 2024-10-29 16:27:04 -07:00
Dustin Campbell 44f3fd79d7 Pass ISolutionQueryOperations throughtout
Rather than accessing the _projectManager instance field in HoverService, just pass an ISolutionQueryOperations instance throughout.
2024-10-29 16:27:03 -07:00
Dustin Campbell 98261ef52d Pass LinePositionSpan instead of Range
Change HoverService to pass around LinePositionSpan throughtout and only create an LSP Range when needed in the end.
2024-10-29 16:27:02 -07:00
Dustin Campbell 001b43d9a1 Extract HoverDisplayOptions from ClientCabilities
Rather than passing around ClientCapabilities all the time, use a HoverDisplayOptions record with the relevant information.
2024-10-29 16:27:01 -07:00
Dustin Campbell 98ff0e139e Don't pass LSP Position into IHoverService.GetRazorHoverInfoAsync(...)
IHoverService.GetRazorHoverInfoAsync(...) takes a DocumentPositionInfo and an LSP Position, but it only actually needs one of them.
2024-10-29 16:27:01 -07:00
David Wengier e22180b5fd
Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2571381 (#11118) 2024-10-30 09:21:36 +11:00
dotnet bot fa300ca1f3 Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2571381 2024-10-29 22:49:11 +01:00
dotnet bot 20e3f26adf Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2571381 2024-10-29 22:47:58 +01:00
David Wengier 720fbefaff
Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2570728 (#11106)
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-10-30 08:22:46 +11:00
David Wengier 5683be72a5
[main] Update dependencies from dotnet/source-build-reference-packages (#11104)
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**: 20241021.1
- **Date Produced**: October 21, 2024 5:34:14 PM UTC
- **Commit**: ccd0927e3823fb178c7151594f5d2eaba81bba81
- **Branch**: refs/heads/main

[DependencyUpdate]: <> (Begin)

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

[1]:
4660d88cf9...ccd0927e38

[DependencyUpdate]: <> (End)


[marker]: <> (End:011df26a-fbd1-45b0-94b9-08db3601dcca)
2024-10-29 10:18:42 +11:00
Ankita Khera 7bd4de7f1e
update configs for 17.13p2 snap (#11105) 2024-10-28 16:16:47 -07:00
Dustin Campbell 76cd92a65e
Some random clean up and improvements (#11095)
These are just some tweaks I've had on my machine awhile.

- Introduce `PlatformInformation` class to remove several
`RuntimeInformation.IsOSPlatform(...)`. These checks are fairly
efficient, but each [requires in a string
comparison](6ed953a000/src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs (L122-L134))
and it's easy enough to just do those once and remember the result.
- Replace `OSSkipConditionFactAttribute` with
`ConditionalFactAttribute`. This makes it easier to see what conditions
a test will run under. For example, it's much easier to see that a test
will run on Windows if it's marked with `[ConditionalFact(Is.Windows)]`
rather than `[OSSkipConditionFact(["Linux", "OSX"])]`
2024-10-28 15:34:46 -07:00
David Wengier a37ee126f8
Update project configuration from Roslyn info (#11092)
Fixes https://github.com/dotnet/razor/issues/10736 and brings in IDE
support for the new Roslyn tokenizer, which makes this work:


![Image](https://github.com/user-attachments/assets/3f3647d3-5089-4750-96a0-a80c498db97b)
2024-10-29 09:34:01 +11:00
David Wengier efd0d3870a Missed one test 2024-10-29 09:07:17 +11:00
David Wengier 39dccd9625 PR Feedback 2024-10-29 08:47:21 +11:00
dotnet bot 60e72de170 Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2570586 2024-10-28 21:37:33 +01:00
dotnet bot 54c92500cf Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 2570586 2024-10-28 21:36:21 +01:00
Phil Allen ad74439384
Reduce the amount of telemetry emitted (#11094)
* Reduce the amount of telemetry emitted

* Accept code review feedback

* Accept code review feedback (2)

* Change TelemetryScope to NonCopyable struct; if the default constructor is used, _reporter is null so no "report" happens on Dispose.  If the _reporter check were removed from Dispose, multiple unittests would fail.

* Undo telemetry-scope-as-struct changes
2024-10-28 13:07:00 -07:00