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

7185 Коммитов

Автор SHA1 Сообщение Дата
Allison Chou 684034257e
Update azure-pipelines.yml 2021-10-07 14:43:35 -07:00
Allison Chou ae28f78654
Update README.md 2021-10-06 17:33:36 -07:00
Allison Chou e69e91ddd1
Update CONTRIBUTING.md 2021-10-06 17:11:11 -07:00
Allison Chou e2d5170b23
Update CONTRIBUTING.md 2021-10-06 14:53:31 -07:00
Allison Chou fb35d50bc9 Update VSCode link 2021-10-06 14:44:56 -07:00
Allison Chou 97f117a11d
Update bug_report.md 2021-10-06 14:36:29 -07:00
Allison Chou dd97f8d0d0 Merge remote-tracking branch 'origin/main' into allichou/UpdateReadmeLink 2021-10-06 14:35:26 -07:00
Allison Chou 7f804cc751
Update README.md 2021-10-06 14:29:33 -07:00
David Wengier 6a346687de
Merge pull request #4657 from davidwengier/FormatFirstCodeBlock 2021-10-07 08:10:20 +11:00
Tony Xia 8824cbf304
Update var name (#4664) 2021-10-06 10:49:39 -07:00
Allison Chou 7c7fcadacc
Add issue filing link to aspnetcore repo (#4662) 2021-10-06 00:22:34 -07:00
Jinu af9c4a37e0 Update issue templates 2021-10-05 18:43:34 -07:00
Jinu 58247a8872 Update issue templates 2021-10-05 18:40:40 -07:00
Ryan Brandenburg 0f334f60bc
Don't return MarkupTextLiterals (#4658)
Don't return MarkupTextLiterals
2021-10-05 17:58:48 -07:00
David Wengier 005eb138b4 Format the first code block in a file to be at the start of a line 2021-10-06 10:13:12 +11:00
Allison Chou 37e764e851
Update issue filing link 2021-10-05 13:50:49 -07:00
N. Taylor Mullen 818d2b0c09 Fix C# snippets being included in completion.
- The platform changed how the text structure navigator APIs behave at the edges of words. Because of this we need to re-calculate how we capture word spans. For instance when we'd ask for the wordspan at `p|\r\n` we'd get `\r\n` without this change set resulting in no snippets.

### Before
![image](https://i.imgur.com/gJo7Jhe.gif)

### After
![image](https://i.imgur.com/UYAMegY.gif)

Fixes #4599
2021-10-05 09:05:46 -07:00
N. Taylor Mullen 41e1d2a276
Add third party notices file. (#4402)
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1391337
2021-10-01 12:31:42 -07:00
Allison Chou 0d6495c1de
Remove async void (#4403) 2021-10-01 19:27:07 +00:00
N. Taylor Mullen 4fa0705308
Fix inaccurate HTML/CSS diagnostics on C#. (#4280)
* Fix inaccurate HTML/CSS diagnostics on C#.

- The CSS diagnostic system didn't recognize the C# portions of the document and was then warning about those portions of the document. It's expected that we'd get a diagnostic in this case; however, we should be filtering HTML diagnostics that map to C# literals because they can't see the C# literals properly.
- Added a test to capture this case.

### Before
![image](https://user-images.githubusercontent.com/2008729/135360938-4f7af400-5675-4c5f-93bc-e37aebd0dad7.png)

### After
![image](https://user-images.githubusercontent.com/2008729/135360655-79d2fb12-3c38-4d25-97c7-fc8a71f57394.png)

Fixes dotnet/aspnetcore#36321

* Update src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Diagnostics/RazorDiagnosticsEndpoint.cs

Co-authored-by: David Wengier <david.wengier@microsoft.com>

* Fix tests

Co-authored-by: David Wengier <david.wengier@microsoft.com>
2021-09-30 03:19:04 +00:00
Youssef Victor 18acff7a73
Fix nullable annotation (#2423)
* Fix nullable annotation

* Update RazorDocumentServiceProvider.cs

* Update RazorDocumentServiceProvider.cs

* Update RazorDocumentServiceProvider.cs

Co-authored-by: Ryan Brandenburg <rybrande@microsoft.com>
2021-09-29 09:34:42 -07:00
N. Taylor Mullen ee8dfe2716 Remove LSP.Protocol code bases / inclusion in VSIX.
- Platform will be providing our LSP.Protocol binary so for the interim we'll be removing our codebase for it.
2021-09-28 22:21:01 -07:00
Gen Lu c660791bb6
Remove common dependencies between Razor and Roslyn (#4274) 2021-09-28 16:55:45 -07:00
Ryan Brandenburg a5f1396d23
Add test for TagHelperDescriptorCache (#4266) 2021-09-28 15:31:51 -07:00
Allison Chou 81e915fee9
Catch IOException in DirectoryHelper (#4272)
- Catches IOException which seems(?) to be out of our control. @ryanbrandenburg please let me know if this isn't the right fix.

Fixes: dotnet/aspnetcore#35306
2021-09-28 09:30:30 -07:00
N. Taylor Mullen b95197d387
Don't auto-close when end-tag already exists. (#4258)
- Updated our tag auto-closing behavior detection to take into account potential parents that are without end-tag when re-typing a close-angle bracket.
- Added loads of tests!

### Before
![image](https://i.imgur.com/kR2lTkm.gif)

### After
![image](https://i.imgur.com/dYvEHjo.gif)

Fixes dotnet/aspnetcore#36125
2021-09-27 19:27:05 -07:00
N. Taylor Mullen 8afb0c50b4
Update to stable LanguageServer.Protocol version (#4254)
- Pinning all of the LanguageServer.Protocol packages so that we don't get conflicts. At runtime the Client.Implementation assembly we depend on will be binding redirected to a version that has the same protocol dependency.

Fixes dotnet/aspnetcore#36945
2021-09-27 19:26:50 -07:00
N. Taylor Mullen ba38aeef52
Fix closing HTML elements when nested and next to others. (#4247)
* Fix closing HTML elements when nested and next to others.

- **Issue:** Found another compiler quirk since we can't rely on looking up specific SyntaxTokens by position :(. Gist is that since we can't lookup token by position and have to rely on `GetOwner` we can occasionally get a node that's in front of our cursor. In the nested HTML case of `<first>|<second>` you'd get `<second>` as the owner.
- **Fix:** Gist is I added two more sections to our compiler quirks helper in our auto-closing behavior method. It's sad but works.
- Updated tests to reflect this new scenario.

Fixes dotnet/aspnetcore#36906

* Fix and add more tests.
2021-09-27 19:25:40 -07:00
N. Taylor Mullen 5a0aa9e55e
Fix smart indent after generic inherits directive. (#4245)
- **This issue:** When multiple languages weave on the same line the beginning of the line line is used for language-configuration.json lookup. Prior to this we'd only have the ending portion of our directives be C#. This meant that the IDE would look at the beginning of hte line, find Razor's grammar and then apply its indentation rules. In Razor's case it tries to lookup HTML tags (the generic `<string>`) and increase indentation based on that.
- **The fix:** Provide a new directive language-configuration.json grammar that's not Razor and map all directives to it. Now this isn't the most ideal fix because technically what we really want is to have a Razor, HTML and C# grammar etc.; however, we currently have our Razor grammar usurping the HTML grammar which puts us in this position of needing to build a new language-configuration.json. I didn't want to split out the Razor / HTML grammar pieces due to how close we are to Preview5 snap but it's something we should consider in the future.
- Updated all Razor directives to be more generic (it should have been this way to begin with) and went from `meta.directive.somethingspecific` to `meta.directive`. This means I was able to associate the `meta.directive` scope with the new razordirective language-configuration.json
- Updated our grammar tests to reflect this change.

### Before
![image](https://i.imgur.com/VbYqQKC.gif)

### After
![image](https://i.imgur.com/3bnsknH.gif)

Fixes dotnet/aspnetcore#35780
2021-09-27 19:24:20 -07:00
N. Taylor Mullen 3d580f054d
Ngen O# assemblies and their dependencies (#4238)
- This will require a good amount of VS changes but that's all staged here: https://devdiv.visualstudio.com/DevDiv/_git/VS/pullrequest/353104?_a=files

Fixes dotnet/aspnetcore#36554
2021-09-27 19:23:45 -07:00
Gen Lu eca31aeede
Fix TagHelperProvider on ServiceHub Core hsot (#4267)
* Fix friend service name for core host

* Remove AssemblySearchPathsConfig for core hsot
2021-09-27 13:57:31 -07:00
Ryan Brandenburg 083ba763c2
Remove TM themes to prevent overcoloring (#4250) 2021-09-27 09:13:06 -07:00
dotnet-maestro[bot] 57c51eff92
Update dependencies from https://github.com/dotnet/aspnetcore build 20210925.4 (#4263)
[main] Update dependencies from dotnet/aspnetcore
2021-09-25 20:02:21 +00:00
Tanay Parikh 814419a179
Add Support for SupportLocalizedComponentNames (#4255)
* Add SetSupportLocalizedComponentNames

* Update ASPNetCore-Debugging.md
2021-09-24 17:15:57 -07:00
Allison Chou 42ebd0462a
Move OnTypeFormatting to Razor language server (#4242) 2021-09-24 17:09:57 -07:00
N. Taylor Mullen d71101bdc3
Fix C# diagnostics clearing on close/delete. (#4251)
- The platform sends one last pull diagnostic request on document close. Prior to this change we'd gracefully no-op if we couldn't find one of our documents; however, the expected behavior is to clear all diagnostics for that closed/deleted document. In the end this is a super simple change.
- Updated tests to reflect the new behavior.
- Added a CTI work item to expand our existing coverage of closed/deleted Razor documents in regards to C# diagnostics: https://github.com/aspnet/Tooling-ManualTests/issues/1503

### Before
![image](https://i.imgur.com/0Iq3b3z.gif)

### After
![image](https://i.imgur.com/HeZv3Ry.gif)

Fixes dotnet/aspnetcore#36940
2021-09-24 23:30:13 +00:00
N. Taylor Mullen 7334b0b47b
Allow synchronizer to handle removed documents. (#4253)
* Allow synchronizer to handle removed documents.

- Occasionally virtual documents get removed in the midst of trying to synchronize. I found that after deleting a Razor file we'd throw because we couldn't lookup the HTML virtual document. Updated the synchronizer to respect this scenario and added a test as well.
- Found this when investigating https://github.com/dotnet/aspnetcore-tooling/pull/4251

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

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

Co-authored-by: Allison Chou <allichou@microsoft.com>
2021-09-24 23:28:43 +00:00
dotnet-maestro[bot] a312233b7b
[main] Update dependencies from dotnet/aspnetcore (#4257)
* Update dependencies from https://github.com/dotnet/aspnetcore build 20210924.8

Microsoft.AspNetCore.Razor.Language , Microsoft.AspNetCore.Razor.Internal.Transport , Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X , Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X , Microsoft.AspNetCore.Mvc.Razor.Extensions , Microsoft.AspNetCore.Testing , Microsoft.CodeAnalysis.Razor
 From Version 6.0.0-rtm.21474.12 -> To Version 6.0.0-rc.2.21474.8

Dependency coherency updates

Microsoft.Extensions.Configuration.Json,Microsoft.Extensions.Logging,System.Diagnostics.DiagnosticSource,System.Resources.Extensions,System.Text.Encodings.Web,Microsoft.Extensions.DependencyModel,Microsoft.NETCore.App.Ref,Microsoft.NETCore.BrowserDebugHost.Transport,Microsoft.NETCore.App.Runtime.win-x64,Microsoft.NETCore.Platforms
 From Version 6.0.0-rtm.21472.13 -> To Version 6.0.0-rc.2.21470.23 (parent: Microsoft.CodeAnalysis.Razor

* Update dependencies from https://github.com/dotnet/aspnetcore build 20210924.23

Microsoft.AspNetCore.Razor.Language , Microsoft.AspNetCore.Razor.Internal.Transport , Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X , Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X , Microsoft.AspNetCore.Mvc.Razor.Extensions , Microsoft.AspNetCore.Testing , Microsoft.CodeAnalysis.Razor
 From Version 6.0.0-rtm.21474.12 -> To Version 6.0.0-rc.2.21474.23

Dependency coherency updates

Microsoft.Extensions.Configuration.Json,Microsoft.Extensions.Logging,System.Diagnostics.DiagnosticSource,System.Resources.Extensions,System.Text.Encodings.Web,Microsoft.Extensions.DependencyModel,Microsoft.NETCore.App.Ref,Microsoft.NETCore.BrowserDebugHost.Transport,Microsoft.NETCore.App.Runtime.win-x64,Microsoft.NETCore.Platforms
 From Version 6.0.0-rtm.21472.13 -> To Version 6.0.0-rc.2.21470.23 (parent: Microsoft.CodeAnalysis.Razor

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2021-09-24 16:15:47 -07:00
N. Taylor Mullen ae4f8732ce
Prioritize TagHelper/directive attribute completions when applicable. (#4241)
* Prioritize TagHelper/directive attribute completions when applicable.

- So unintentionally this issue ended up solving 2x issues at once, I apologize for the conflated concerns!! I'll leave comments in this description detailing how/why it did two.
- When a user is trying to get attribute completions today we show HTML & attribute completion items. Both of those completion item sets get weaved amongst each other and get shown as one jointly sorted list. Now the unfortunate side effect of this is that when you have a custom component / TagHelper we spit out every possible completion item which can lead to really confusing scenarios. To fix this I took the approach of adding `SortText` to our internal `RazorCompletionItem` type to allow us to sort TagHelper completion items prior to any HTML completions.
- Now similarly when trying to get directive attribute completions we have the same issue as above; however, that scenario is slightly different. Reason being in an ideal world for directive attribute completions i.e. `<strong @|>` we'd simply not request HTML completions because it's following an `@` symbol; however, with the Razor language servers current design this isn't easily done. We therefore can also utilize this sort text approach to prioritize directive attribute completions above HTML completions.

**Details:**
- Expanded `RazorCompletionItem` to support `SortText`.
- Added a `CompletionSortTextHelper` class to make picking `SortText`'s  simple. For now I've added 2 types, Default and High priority
- Updated our completion endpoint to utilize the `SortText` from our `RazorCompletionItem`s. This is where I unintentionally fixed issue dotnet/aspnetcore#30255. Reason being is that we had to pick a default for `SortText` when not provided. I chose the display text because technically that's what a user sees when typing. With this in mind a directive attribute completion USED to use `InsertText` for its sort text. Meaning, it'd display `@bind` but would be sorted off of `bind`. Now that `SortText` defaults to the display text it means the `@` in `@bind` sorts the item to the top of the list. I could take this one step further and be explicit in the `SortText` for directive attributes; however, we actually gain a little bit of perf here because if `DisplayText == SortText` then we can omit the `SortText` and platform will sort off of the display getting us our expected result.

## Directive Attribute Completion:

### Before
![image](https://i.imgur.com/NTLSBNr.gif)

### After
![image](https://i.imgur.com/W8yJDvB.gif)

## TagHelper Attribute Completion:

### Before
![image](https://i.imgur.com/1ohDsua.gif)

### After
![image](https://i.imgur.com/RdbJbtk.gif)

Fixes dotnet/aspnetcore#30255
Fixes dotnet/aspnetcore#35848

* Address code review comments.

* Fix tests

* More test fixes
2021-09-24 21:07:39 +00:00
dotnet-maestro[bot] 4ede0c44a5
[main] Update dependencies from dotnet/aspnetcore (#4249)
[main] Update dependencies from dotnet/aspnetcore
2021-09-24 19:14:02 +00:00
Tanay Parikh 7ffbb34106
Update contributing docs (#4246)
* Update ASPNetCore-Debugging.md

* Update Roslyn-Debugging.md
2021-09-24 19:08:05 +00:00
dotnet-maestro[bot] fb4a945136
Update dependencies from https://github.com/dotnet/aspnetcore build 20210923.42 (#4248)
[main] Update dependencies from dotnet/aspnetcore
2021-09-24 03:32:39 +00:00
dotnet-maestro[bot] c31c5dfbf0
[main] Update dependencies from dotnet/aspnetcore (#4244)
[main] Update dependencies from dotnet/aspnetcore
2021-09-23 23:32:16 +00:00
dotnet-maestro[bot] 9f39f4d853
[main] Update dependencies from dotnet/aspnetcore (#4243)
[main] Update dependencies from dotnet/aspnetcore
2021-09-23 20:32:12 +00:00
dotnet-maestro[bot] 9964763cfd
[main] Update dependencies from dotnet/aspnetcore (#4240)
[main] Update dependencies from dotnet/aspnetcore
- Coherency Updates:
  - Microsoft.Extensions.Configuration.Json: from 6.0.0-rtm.21471.19 to 6.0.0-rtm.21472.13 (parent: Microsoft.CodeAnalysis.Razor)
  - Microsoft.Extensions.Logging: from 6.0.0-rtm.21471.19 to 6.0.0-rtm.21472.13 (parent: Microsoft.CodeAnalysis.Razor)
  - System.Diagnostics.DiagnosticSource: from 6.0.0-rtm.21471.19 to 6.0.0-rtm.21472.13 (parent: Microsoft.CodeAnalysis.Razor)
  - System.Resources.Extensions: from 6.0.0-rtm.21471.19 to 6.0.0-rtm.21472.13 (parent: Microsoft.CodeAnalysis.Razor)
  - System.Text.Encodings.Web: from 6.0.0-rtm.21471.19 to 6.0.0-rtm.21472.13 (parent: Microsoft.CodeAnalysis.Razor)
  - Microsoft.Extensions.DependencyModel: from 6.0.0-rtm.21471.19 to 6.0.0-rtm.21472.13 (parent: Microsoft.CodeAnalysis.Razor)
  - Microsoft.NETCore.App.Ref: from 6.0.0-rtm.21471.19 to 6.0.0-rtm.21472.13 (parent: Microsoft.CodeAnalysis.Razor)
  - Microsoft.NETCore.BrowserDebugHost.Transport: from 6.0.0-rtm.21471.19 to 6.0.0-rtm.21472.13 (parent: Microsoft.CodeAnalysis.Razor)
  - Microsoft.NETCore.App.Runtime.win-x64: from 6.0.0-rtm.21471.19 to 6.0.0-rtm.21472.13 (parent: Microsoft.CodeAnalysis.Razor)
  - Microsoft.NETCore.Platforms: from 6.0.0-rtm.21471.19 to 6.0.0-rtm.21472.13 (parent: Microsoft.CodeAnalysis.Razor)
2021-09-23 17:35:57 +00:00
dotnet-maestro[bot] 8c27da0fac
Update dependencies from https://github.com/dotnet/aspnetcore build 20210922.15 (#4237)
[main] Update dependencies from dotnet/aspnetcore
2021-09-22 19:56:50 +00:00
dotnet-maestro[bot] 4a990dd87a
[main] Update dependencies from dotnet/aspnetcore (#4236)
[main] Update dependencies from dotnet/aspnetcore
2021-09-22 19:12:08 +00:00
dotnet-maestro[bot] 203b572193
[main] Update dependencies from dotnet/aspnetcore (#4233)
[main] Update dependencies from dotnet/aspnetcore
- Coherency Updates:
  - Microsoft.Extensions.Configuration.Json: from 6.0.0-rtm.21470.22 to 6.0.0-rtm.21471.19 (parent: Microsoft.CodeAnalysis.Razor)
  - Microsoft.Extensions.Logging: from 6.0.0-rtm.21470.22 to 6.0.0-rtm.21471.19 (parent: Microsoft.CodeAnalysis.Razor)
  - System.Diagnostics.DiagnosticSource: from 6.0.0-rtm.21470.22 to 6.0.0-rtm.21471.19 (parent: Microsoft.CodeAnalysis.Razor)
  - System.Resources.Extensions: from 6.0.0-rtm.21470.22 to 6.0.0-rtm.21471.19 (parent: Microsoft.CodeAnalysis.Razor)
  - System.Text.Encodings.Web: from 6.0.0-rtm.21470.22 to 6.0.0-rtm.21471.19 (parent: Microsoft.CodeAnalysis.Razor)
  - Microsoft.Extensions.DependencyModel: from 6.0.0-rtm.21470.22 to 6.0.0-rtm.21471.19 (parent: Microsoft.CodeAnalysis.Razor)
  - Microsoft.NETCore.App.Ref: from 6.0.0-rtm.21470.22 to 6.0.0-rtm.21471.19 (parent: Microsoft.CodeAnalysis.Razor)
  - Microsoft.NETCore.BrowserDebugHost.Transport: from 6.0.0-rtm.21470.22 to 6.0.0-rtm.21471.19 (parent: Microsoft.CodeAnalysis.Razor)
  - Microsoft.NETCore.App.Runtime.win-x64: from 6.0.0-rtm.21470.22 to 6.0.0-rtm.21471.19 (parent: Microsoft.CodeAnalysis.Razor)
  - Microsoft.NETCore.Platforms: from 6.0.0-rtm.21470.22 to 6.0.0-rtm.21471.19 (parent: Microsoft.CodeAnalysis.Razor)
2021-09-22 14:22:55 +00:00
Allison Chou 9cf60a53e5
Respect TextView settings when closing and re-opening Razor file (#4223) 2021-09-21 20:24:51 -07:00
N. Taylor Mullen ddaa8903e0
Fix file change dispatcher leak on solution reopen (#4229)
- Found a realllly interesting interaction with O# framework where if something imports an `IEnumerable` based service then when the outer service collection disposes it removes all entries from the imported `IEnumerable`. Because of this what would happen in our scenario is that we'd close a solution, the file change detector enumeration would be emptied and then in our file change detector manager's "Dispose" method we'd attempt to ` Stop` all active file change detectors; welllll in this situation the enumeration would be empty so `Stop` would never be called. All of those file watchers still had references to the old project snapshot manager dispatcher and would then enqueue tasks to be run on an old `ProjectSnapshotManagerDispatcher` that dispatcher would then operate in uncharted territory and ultimately leak loads of requests/information.
- The fix is rather simple, since the O# framework clears the imported enumeration we just need to `ToArray` it to ensure that the framework doesn't empty our collection.
- I have some doubts that this entirely fixes the below issue; however, It's most likely a part of it.

Part of dotnet/aspnetcore#35787
2021-09-21 16:01:55 -07:00