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

7470 Коммитов

Автор SHA1 Сообщение Дата
dotnet-maestro[bot] f8c304a3b0
Update dependencies from https://github.com/dotnet/arcade build 20211210.4 (#5858)
[main] Update dependencies from dotnet/arcade
2021-12-13 13:54:15 +00:00
dotnet-maestro[bot] 496cab4c3e
Update dependencies from https://github.com/dotnet/razor-compiler build 20211209.3 (#5853)
Microsoft.AspNetCore.Mvc.Razor.Extensions.Tooling.Internal , Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X.Internal.Transport , Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X.Internal.Transport , Microsoft.AspNetCore.Razor.Internal.Transport , Microsoft.CodeAnalysis.Razor.Tooling.Internal
 From Version 6.0.2-1.21602.2 -> To Version 6.0.2-1.21609.3

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2021-12-10 13:21:18 -08:00
Andrew Hall f09dd68bcc
Map SelectionRange for CodeActions requests (#5844)
* Map SelectionRange for CodeActions requests

If a SelectionRange is provided it's required that the range
should also be mapped correctly before sending off the request
for code actions. This context is used for cases where code action
ordering is ordered and the original range may not actually be
equal to the SelectionRange. Both are needed to correctly provide
the right code fixes and/or refactorings and in the right order
from Roslyn

* tests... maybe?

* Spaysing

* naming
2021-12-09 13:55:04 -08:00
Sam Harwell 60e09d26fd
Merge pull request #5842 from sharwell/nullable-enable
Enable nullable reference types in solution (preserve all current semantics)
2021-12-07 21:02:28 -08:00
N. Taylor Mullen 27574343c5 Call AdviseRunningDocTableEvents on UI thread take 2.
- Originally when this work was done I attempted to call the advise in the ctor; however, that in practice didn't work out so well. Therefore, given that the editor document manager is always "started" / requested elsewhere we can lazily advise the running document table when already on the UI thread.

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1441597
2021-12-07 17:50:38 -08:00
N. Taylor Mullen 51d34f58a8 Revert "Call AdviseRunningDocTableEvents on UI thread. (#5783)" (#5832)
This reverts commit 1f785f416c.
2021-12-07 17:50:38 -08:00
dotnet-maestro[bot] 44a883ac09
[main] Update dependencies from dotnet/aspnetcore (#5841)
[main] Update dependencies from dotnet/aspnetcore
2021-12-08 01:28:51 +00:00
Sam Harwell 512d369c02 Enable nullable reference types in solution (preserve all current semantics) 2021-12-07 14:38:00 -08:00
David Wengier c0f5921305
Merge pull request #5824 from davidwengier/FormatRenderFragment 2021-12-07 12:11:10 +11:00
David Wengier 44d8171c7c
Merge pull request #5817 from davidwengier/WrapWithDiv 2021-12-07 09:55:03 +11:00
Ryan Brandenburg 622536c54e
Nullable (#5821)
* Nullable
2021-12-06 14:45:24 -08:00
David Wengier 85cf979b20 PR feedback 2021-12-07 09:42:18 +11:00
Ryan Brandenburg 50687a4622
Disable C# classification from TextMate (#5794)
* Disable C# classification from TextMate
2021-12-06 14:38:34 -08:00
David Wengier 64f02499a7
Update src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/HtmlFormattingPass.cs
Co-authored-by: Ryan Brandenburg <rybrande@microsoft.com>
2021-12-07 09:32:57 +11: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
David Wengier 807a6f1fe9
Update src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Formatting/HtmlFormattingPass.cs 2021-12-06 20:13:03 +11:00
David Wengier 16a8596c22 Fix render fragment formatting in C# blocks 2021-12-06 20:11:36 +11:00
David Wengier 938149d4c3 PR feedback 2021-12-05 21:53:35 +11: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
David Wengier f91c903c31 Div -> Tag 2021-12-03 15:25:52 +11:00
David Wengier bafc16b8e2 Create empty method to workaround platform bug 2021-12-03 15:25:52 +11:00
David Wengier 8a693528a4 Nullable 2021-12-03 15:25:52 +11:00
David Wengier ee8629cba6 Remove our command handler 2021-12-03 15:25:52 +11:00
David Wengier 4fad820735 Tests 2021-12-03 15:25:52 +11:00
David Wengier d6a77461c2 Use the same method name 2021-12-03 15:25:52 +11:00
David Wengier b7b7611a2d Initial implementation of WrapWithDiv command 2021-12-03 15:25:52 +11: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