- Notifications
You must be signed in to change notification settings - Fork4.2k
Clean up of EditorFeatures.Cocoa.Snippets#49188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| // In Venus/Razor, inserting imports statements into the subject buffer does not work. | ||
| // Instead, we add the imports through the contained language host. | ||
| if(TryAddImportsToContainedDocument(document,newUsingDirectives.Where(u=>u.Alias==null).Select(u=>u.Name.ToString()))) |
davidwengierNov 5, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
If you're not looking commit-by-commit this might look odd, butTryAddImportsToContainedDocument used to always throw, therefore the rest of this method was unreachable, therefore this wholeAddImports method never did anything, which then meant theAddReferencesAndImports that called it also never did anything.
I'm guessing there are no snippets that add usings in VS for Mac??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@Therzok@DavidKarlas@KirillOsenkov Does that make sense? Is this an extension point for VS for Mac? (not that I can see how it worked if it is)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I'm guessing it was copied from here but we had no impl due to MonoDevelopWorkspace being in MonoDevelop, not platform assemblies:
roslyn/src/VisualStudio/Core/Def/Implementation/Snippets/AbstractSnippetExpansionClient.cs
Line 561 incbf3129
| protectedstaticboolTryAddImportsToContainedDocument(Documentdocument,IEnumerable<string>memberImportsNamespaces) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@davidwengier yes that make sense, no snippet inserts usings so I think its fine to delete this.
Therzok left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM
| protectedreadonlyIExpansionServiceProviderExpansionServiceProvider; | ||
| protectedreadonlyIExpansionManagerexpansionManager; | ||
| protectedreadonlyIExpansionManagerExpansionManager; |
Youssef1313Nov 5, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Shouldn't both of these be_camelCase (or am I missing some naming convention rule)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
If it's protected, we tend to do this style since it's acting more like a property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
@Youssef1313 I found this surprising too, but these were mechanical changes driver by the Roslyn .editorconfig rules so who am I to argue ¯\_(ツ)_/¯
Looks likeprotected readonly is PascalCase andprotected is camelCase with underscore. It doesn'tnot make sense, I guess, but its a good reminder of why we should all have personal projects we can escape to, with sensible rules :)
| // The .NET Foundation licenses this file to you under the MIT license. | ||
| // See the LICENSE file in the project root for more information. | ||
| #nullable disable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Are we able to do this to the VS layer at the same time, since the annotations are likely the same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
(I'm actually not sure if we can just unify this file, since it seems like it doesn't have any dependencies and each side inherits it appropriately.)
* upstream/master: (519 commits) Remove workaround in PEMethodSymbol.ExplicitInterfaceImplementations (dotnet#49246) Enable LSP pull model diagnostic for XAML. (dotnet#49145) Update dependencies fromhttps://github.com/dotnet/roslyn build 20201109.8 (dotnet#49240) Add test for with expression in F1 help service (dotnet#49236) Cache RegexPatternDetector per compilation Fix RazorRemoteHostClient to maintain binary back-compat Further tweak inline hints Fix MemberNames API for records (dotnet#49138) Minor cleanups (dotnet#49204) Report warning for assignment or explicit cast of possibly null value of unconstrained type parameter type (dotnet#48803) Clean up of EditorFeatures.Cocoa.Snippets (dotnet#49188) Fix OK button state handling. Make relation between viewmodels more tightly coupled Extend make type abstract to include records (dotnet#48227) Remove duplicated implementations of C# event hookup Add select all/deselect all buttons Consolidate conditional compilation (dotnet#49150) Implement IEquatable on Microsoft.Cci.DefinitionWithLocation structure (dotnet#49162) Add new document extensions file Unify implementations Only disable structure tagger provider in LSP scenario ...
Uh oh!
There was an error while loading.Please reload this page.
Part of#48871
There is alot of code removed here, so commit-by-commit is most definitely recommended, if not required.
This is quite a mechanical set of changes, mostly just fixing compiler errors or warnings. I've commented inline on the potentially controversial bit.