Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract To Component: Code handling capabilities #10760

Open
wants to merge 29 commits into
base: features/extract-to-component
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9e84b15
Arranging selection logic
marcarro Jul 8, 2024
aa15f7b
Completed and corrected selected range extraction functionality
marcarro Jul 15, 2024
55588d6
Include only dependencies included in the selected range
marcarro Jul 19, 2024
5753836
Base component dependency functionality and fixed range selection bug
marcarro Jul 18, 2024
459605e
Added method to scan identifiers
marcarro Aug 1, 2024
1e8168b
Corrected naming and nits
marcarro Aug 5, 2024
419055b
Set up basic end to end test for extract component
marcarro Aug 7, 2024
80d7b18
Refactoring: responsibilities to resolver and not provider
marcarro Aug 16, 2024
2ec6a8d
Handle code case: Method and field promotion
marcarro Aug 19, 2024
78a6d4c
Nits and reverted some changes that werent supposed to make it
marcarro Aug 19, 2024
5278bd8
Added support for MarkupTagHelperElements
marcarro Aug 19, 2024
8cf4f66
Adapted for roslyn endpoint rename, and added tests
marcarro Aug 21, 2024
7795d9f
Refactoring of TryProcessMultiPointSelection and FindContainingSiblin…
marcarro Aug 21, 2024
2b67a3b
Change to FindContainingSiblingPair
marcarro Aug 21, 2024
426ed28
Modified forwared constant fields
marcarro Aug 22, 2024
b9492f2
Preemptively added suggestions from previous PR feedback
marcarro Aug 25, 2024
462062a
Naming fixes and simplified promoted method string generation
marcarro Aug 25, 2024
96221e5
Adjust indentation for component extraction and some more tests
marcarro Aug 27, 2024
0f547f3
Removed unnecessary usings and separated end to end tests
marcarro Aug 27, 2024
b37e6d8
Updated functionality to match Roslyn endpoint response, finished att…
marcarro Sep 3, 2024
5b76f23
Rebase. Made some mistakes while rebasing, I'm sorry.
marcarro Sep 3, 2024
cec455e
Updated to reflect changes in Roslyn API
marcarro Sep 3, 2024
d76d535
PR Feedback
marcarro Sep 4, 2024
e08e1d3
Corrected logic for searching through ancestors in IsInsideMarkupTag
marcarro Sep 4, 2024
1dfb8fd
Cleaned up usings and integrated PR Feedback for IsInsideMarkupTag
marcarro Sep 5, 2024
268e303
Ignore previous commit message!
marcarro Sep 5, 2024
65daa58
Changed GetUsingDirectivesInRange to use a SyntaxNode instead of a Sy…
marcarro Sep 5, 2024
310da7d
Added more tests
marcarro Sep 7, 2024
1393e15
Final refactoring: moved selection validation methods to resolver to …
marcarro Sep 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT license. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions.Models;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
using Microsoft.CodeAnalysis.Text;
using Microsoft.VisualStudio.LanguageServer.Protocol;

namespace Microsoft.AspNetCore.Razor.LanguageServer.CodeActions.Models;

Expand All @@ -15,14 +17,23 @@ internal sealed class ExtractToComponentCodeActionParams
public required Uri Uri { get; set; }

[JsonPropertyName("extractStart")]
public int ExtractStart { get; set; }
public required int ExtractStart { get; set; }

[JsonPropertyName("extractEnd")]
public int ExtractEnd { get; set; }
public required int ExtractEnd { get; set; }

[JsonPropertyName("namespace")]
public required string Namespace { get; set; }
[JsonPropertyName("hasEventHandlerOrExpression")]
public required bool HasEventHandlerOrExpression { get; set; }

[JsonPropertyName("hasAtCodeBlock")]
public required bool HasAtCodeBlock { get; set; }

[JsonPropertyName("usingDirectives")]
public required List<string> usingDirectives { get; set; }
public required string[] UsingDirectives { get; set; }

[JsonPropertyName("dedentWhitespaceString")]
public required string DedentWhitespaceString { get; set; }

[JsonPropertyName("namespace")]
public required string Namespace { get; set; }
}

Large diffs are not rendered by default.

Loading
Loading