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

7448 Коммитов

Автор SHA1 Сообщение Дата
Allison Chou 95aa380e1d
Remove compiler + arcade changes from 17.1-Preview2 branch (#5839) 2021-12-07 12:46:28 -08:00
N. Taylor Mullen 5af4b0ddcd
Revert "Call AdviseRunningDocTableEvents on UI thread. (#5783)" (#5832)
This reverts commit 1f785f416c.
2021-12-07 00:33:59 +00:00
Allison Chou ccfef3590e
Fix semantic tokens bug (#5823) 2021-12-06 13:55:28 -08:00
dotnet-maestro[bot] 9d9c84f0c1
Update dependencies from https://github.com/dotnet/arcade build 20211203.6 (#5825)
[main] Update dependencies from dotnet/arcade
2021-12-06 13:59:32 +00:00
Pranav K fd0673153a
Update dependencies from https://github.com/dotnet/razor-compiler build 20211202.2 (#5815)
* Update dependencies from https://github.com/dotnet/razor-compiler build 20211202.2

Microsoft.AspNetCore.Razor.Internal.Transport
 From Version 6.0.1-servicing.21565.21 -> To Version 6.0.2-1.21602.2

* Use transport packages
2021-12-03 11:29:44 -08:00
N. Taylor Mullen c1310fc2ed Fix Razor.VSCode.Grammar.Test component governance issues.
Addresses:
- https://dnceng.visualstudio.com/internal/_componentGovernance/dotnet-razor-tooling/alert/6063426?typeId=6437374
- https://dnceng.visualstudio.com/internal/_componentGovernance/dotnet-razor-tooling/alert/5469399?typeId=6437374
- https://dnceng.visualstudio.com/internal/_componentGovernance/dotnet-razor-tooling/alert/5469400?typeId=6437374
- https://dnceng.visualstudio.com/internal/_componentGovernance/dotnet-razor-tooling/alert/6063424?typeId=6437374
- https://dnceng.visualstudio.com/internal/_componentGovernance/dotnet-razor-tooling/alert/6063425?typeId=6437374
2021-12-03 10:24:38 -08:00
N. Taylor Mullen 3f7944c35a Update yarn.msbuild to latest version
Addresses:
- https://dnceng.visualstudio.com/internal/_componentGovernance/dotnet-razor-tooling/alert/3714283?typeId=6437627
- https://dnceng.visualstudio.com/internal/_componentGovernance/dotnet-razor-tooling/alert/2939605?typeId=6437627
2021-12-03 10:24:23 -08:00
N. Taylor Mullen f355702976 Pin tar dependency to a good version for VSCode.Test
Addresses:
- https://dnceng.visualstudio.com/internal/_componentGovernance/dotnet-razor-tooling/alert/6063426?typeId=6437374
- https://dnceng.visualstudio.com/internal/_componentGovernance/dotnet-razor-tooling/alert/5469399?typeId=6437374
- https://dnceng.visualstudio.com/internal/_componentGovernance/dotnet-razor-tooling/alert/5469400?typeId=6437374
- https://dnceng.visualstudio.com/internal/_componentGovernance/dotnet-razor-tooling/alert/6063424?typeId=6437374
- https://dnceng.visualstudio.com/internal/_componentGovernance/dotnet-razor-tooling/alert/6063425?typeId=6437374
2021-12-02 23:18:15 -08:00
Allison Chou b0b810421f
Update tooling docs (#5805) 2021-12-01 21:05:39 -08:00
N. Taylor Mullen 4376588099 Fix publish from breaking Razor component discovery.
- So turns out for customers who have moved their `obj` folders out of the solution directory (common for larger apps and done via the MSBuild `BaseIntermediateOutputPath` or `IntermediateOutputPath` property) and then published their app would break our ability to consume future Razor component / project system information. Turns out the `obj` folder + publish combo breaks due to a blatant bug in our `project.razor.json` change detection mechanism. Let me explain: Whenever a project has an `obj` outside of the workspace directory we need to notify the RZLS where to look for said `obj` folder so it can detect `project.razor.json` changes. We do this via a custom endpoint (`razor/monitorProjectConfigurationFilePath`) which takes in a csproj + `project.razor.json` path. So when a user would publish what the IDE would do is move the project to the `Release` configuration to build the app and then immediately move it back to the `Debug` configuration. This in turn would trigger two monitor project configuration file path events because the `Release` config has a different project.razor.json path (`obj/Release/net6.0/project.razor.json`), the two events would be "move to Release folder", "move back to Debug folder". Now the problem is that our caching mechanism in our monitor config endpoint would never update its `project.razor.json` path if it found we were moving from one `project.razor.json` path to another. Therefore, when we initially moved to the "Release" folder it'd start monitoring that folder; however, once we tried to move to the `Debug` folder it would never start a new watcher for the Debug folder; instead it would stop the release folder watching and then sit their twiddling its thumbs :D.
    - Note: You can also reproduce this behavior by manually going to Debug -> Release -> Debug.
- Fix was to make it so when we moved from different `obj` folders to always stop/reconstruct the detectors no matter what.
- Added tests to validate that publish scenarios work as expected.

Fixes #5757
2021-11-30 16:11:15 -08:00
Ryan Brandenburg 9acd76a548
Fix Nullable issues and Log Document Sync errors (#5777)
Nullable and logging
2021-11-30 16:07:51 -08:00
Ryan Brandenburg b1e47920b9
Set AttributeUsage (#5785) 2021-11-29 10:12:34 -08:00
dotnet-maestro[bot] e3a721b360
Update dependencies from https://github.com/dotnet/arcade build 20211126.4 (#5790)
[main] Update dependencies from dotnet/arcade
2021-11-29 13:55:48 +00:00
N. Taylor Mullen 1f785f416c
Call AdviseRunningDocTableEvents on UI thread. (#5783)
* Call AdviseRunningDocTableEvents on UI thread.

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1441597

* Actually switch to main thread....

* Add comment.
2021-11-25 01:44:28 +00:00
N. Taylor Mullen f7be11bb79
Add project capability opt-out to use legacy Razor editor. (#5781)
* Add project capability opt-out to use legacy Razor editor.

- In the past there were various opt-outs to force the .NET Core editor in non-.NET Core scenarios. When we moved to the LSP editor we lost some of these capabilities. This changeset re-adds a similar functionality.

For context see: https://github.com/dotnet/roslyn/discussions/54068

* Add comment.
2021-11-24 21:16:48 +00:00
dotnet bot f1e1f8f2dc
Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 1484164 (#5779) 2021-11-24 12:13:24 -08:00
David Wengier ff3cc36c5e
Merge pull request #5776 from davidwengier/DontFormatMultiLineStrings 2021-11-24 16:06:44 +11:00
David Wengier 6ebef15300 Don't look up ancestors unless necessary 2021-11-24 14:31:25 +11:00
Allison Chou bffca4810b
Remove Roslyn semantic tokens edit handling + switch to Roslyn range handling (#5769) 2021-11-23 11:28:14 -08:00
dotnet bot a3b5fdfaae
Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 1482438 (#5772)
* Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 1480205

* Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 1481798

* Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 1481940

* Localized file check-in by OneLocBuild Task: Build definition ID 262: Build ID 1482438
2021-11-23 10:01:44 -08:00
David Wengier 6af51683b6 Don't format multi-line string literals 2021-11-23 21:56:36 +11:00
David Wengier 3ea22da72d
Merge pull request #5770 from davidwengier/AutomaticUsingDirectives 2021-11-23 20:40:52 +11:00
David Wengier fadfebfb0f Re-wrap parameters 2021-11-23 17:17:51 +11:00
David Wengier 497375d3b5 Put back null checks 2021-11-23 17:13:46 +11:00
N. Taylor Mullen 44040673ec
Fix HTML completion race when typing too quickly (#5744)
* Fix HTML completion race when typing too quickly

- There was a race when typing too quickly our synchronization mechanism would try and reduce the work that was done to cancel pre-existing requests. So in the scenario when you were to type `<tr` what would happen is that 3 completion requests would fire:
    1. Triggered completion for `<`
    2. Typing completion for `t`
    3. Typing completion for `r`
    Now when we sped things up we were able to process requests in parallel which meant that we could handle simultaneous requests for `<`, `t` and `r` all at the same time; however, this in turn results in an interesting behavior where if we ask for completion at `r` while `<` and `t` are still active our synchronization mechanism would aggressively cancel the older requests. For completion this is catastrohpic because it would result in a 0 length completion list because HTML does not respect completion requests beyond trigger characters and the beginning of the word.
- To fix this issue I added a new mechanism for synchronization which takes a flag `rejectOnNewerParallelRequest` which states do not reject a synchronization request aggressively if this flag is `true`. Now this doesn't mean the requests never get rejected. If there's a batched document update or document close / open this will still reject the document; it just means that on the requesting of synchronization that older completion requests are not rejected eagerly.
- Added tests to our projection and synchronization stack to account for this
- Ensured that these changes are not breaking changes so marked some bits as virtual.

### Before

![before image](https://i.imgur.com/sZfGaub.gif)

### After

![after image](https://i.imgur.com/5EsJdDm.gif)

Fixes #5743

* Update src/Razor/src/Microsoft.VisualStudio.LanguageServer.ContainedLanguage/LSPDocumentSynchronizer.cs

Co-authored-by: Allison Chou <allichou@microsoft.com>

* Fix newer tests.

Co-authored-by: Allison Chou <allichou@microsoft.com>
2021-11-22 16:49:44 -08:00
Will Godbe b38bb445ab Move off of expiring machine pools 2021-11-22 15:13:18 -08:00
David Wengier 2532f9bb7e Only process using statements when necessary 2021-11-22 09:35:54 +11:00
David Wengier f6ee0bc644 Always validate no edits when applicable 2021-11-22 09:35:53 +11:00
David Wengier 771e794da1 Fix up tests 2021-11-22 09:35:53 +11:00
David Wengier 49ba3817e4 Separate formatting methods into specific use cases 2021-11-22 09:35:53 +11:00
David Wengier 86d654a1cd Automatically add using statements if required 2021-11-22 09:35:53 +11:00
David Wengier b20d130d63 Change test to add using correctly 2021-11-22 09:35:53 +11:00
David Wengier 8a81847851
Merge pull request #5753 from davidwengier/CodeActionsEverywhere 2021-11-22 09:23:59 +11:00
David Wengier 053cdd0070 Merge remote-tracking branch 'upstream/main' into CodeActionsEverywhere 2021-11-22 08:02:27 +11:00
dotnet-maestro[bot] 6d0357a360
[main] Update dependencies from dotnet/aspnetcore (#5738)
[main] Update dependencies from dotnet/aspnetcore
2021-11-20 00:52:55 +00:00
N. Taylor Mullen 0f236b3b4e Address code review feedback. 2021-11-19 16:38:17 -08:00
N. Taylor Mullen 954c137bd8 Add better logging around project.razor.json handling.
- After digging through countless customer logs I've had a hell of a time finding out why Debug/Release project.razor.json's occasionally result in lack of component IntelliSense. This PR introduces logging to key points that will help investigate what's going on with #5757.
- We have two entry points on the Razor language server that deal with project.razor.json. These two are the `MonitorProjectConfigurationFilePathEndpoint` which is responsible for monitoring external project.razor.json locations (if you set your obj directory to something outside of the workspace) and the `ProjectConfigurationStateSynchronizer` which listens to `project.razor.json` file changes and then harvests information and pushes it to our language server project manager.
    - For these two I enabled nullability + added logging to better understand what's going on under the covers.

Part of #5757
2021-11-19 16:38:17 -08:00
Ryan Brandenburg 964f9bf479
More Nullable (#5756)
More Nullable
2021-11-19 16:10:04 -08:00
Jimmy Lewis 41a4c6548e
Merge pull request #5761 from jimmylewis/documentColorCapabilityCheck
Add a capability check for textDocument/documentColor
2021-11-19 09:39:22 -08:00
N. Taylor Mullen 30b98eadfe Add feature flag for legacy Razor editor
- This allows us to remotely configure old editor usage and only presents the feature flag in main builds for internal customers.
2021-11-19 08:47:10 -08:00
Jimmy Lewis 204b302b59 Add a capability check for textDocument/documentColor
This required updating the VS protocol assemblies to 17.1.2, as that was
where this method name was introduced (though it's been in the LSP spec
for a long time).
2021-11-19 01:37:20 -08:00
David Wengier b5ae5be4d0 FIx test 2021-11-19 17:21:07 +11:00
David Wengier 8f3cdc448c Do some fancy remapping to allow code actions everywhere 2021-11-18 22:35:40 +11:00
David Wengier d8313c95e9 Simplify 2021-11-18 15:48:10 +11:00
David Wengier f0e84a38fc Doc 2021-11-18 15:41:02 +11:00
David Wengier 60a6bf02bb Rename method 2021-11-18 15:40:57 +11:00
David Wengier cb5e001f27 Allow function blocks where the open brace is on a different line 2021-11-18 15:35:22 +11:00
David Wengier db0b78cbf7 More tests 2021-11-18 15:35:02 +11:00
David Wengier 7388fe1348
Merge pull request #5748 from davidwengier/MapTheLastLineOfEdits 2021-11-18 11:54:43 +11:00
David Wengier ca62e8efb7 Add assert and another test 2021-11-17 19:30:21 +11:00