@@ -46,19 +46,19 @@ internal class ExtractToCssCodeActionResolver(
46
46
var cssFilePath = $ "{ FilePathNormalizer . Normalize ( documentContext . Uri . GetAbsoluteOrUNCPath ( ) ) } .css";
47
47
48
48
// VS Code in Windows expects path to start with '/'
49
- var updatedCodeBehindPath = _languageServerFeatureOptions . ReturnCodeActionAndRenamePathsWithPrefixedSlash && ! cssFilePath . StartsWith ( "/" )
49
+ cssFilePath = _languageServerFeatureOptions . ReturnCodeActionAndRenamePathsWithPrefixedSlash && ! cssFilePath . StartsWith ( "/" )
50
50
? '/' + cssFilePath
51
51
: cssFilePath ;
52
52
53
- var cssFileUri = LspFactory . CreateFilePathUri ( updatedCodeBehindPath ) ;
53
+ var cssFileUri = LspFactory . CreateFilePathUri ( cssFilePath ) ;
54
54
55
55
var text = await documentContext . GetSourceTextAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
56
56
57
57
var cssContent = text . GetSubTextString ( new TextSpan ( actionParams . ExtractStart , actionParams . ExtractEnd - actionParams . ExtractStart ) ) . Trim ( ) ;
58
58
var removeRange = codeDocument . Source . Text . GetRange ( actionParams . RemoveStart , actionParams . RemoveEnd ) ;
59
59
60
60
var codeDocumentIdentifier = new OptionalVersionedTextDocumentIdentifier { DocumentUri = new ( documentContext . Uri ) } ;
61
- var codeBehindDocumentIdentifier = new OptionalVersionedTextDocumentIdentifier { DocumentUri = new ( cssFileUri ) } ;
61
+ var cssDocumentIdentifier = new OptionalVersionedTextDocumentIdentifier { DocumentUri = new ( cssFileUri ) } ;
62
62
63
63
using var changes = new PooledArrayBuilder < SumType < TextDocumentEdit , CreateFile , RenameFile , DeleteFile > > ( capacity : 3 ) ;
64
64
@@ -76,7 +76,7 @@ internal class ExtractToCssCodeActionResolver(
76
76
77
77
changes . Add ( new TextDocumentEdit
78
78
{
79
- TextDocument = codeBehindDocumentIdentifier ,
79
+ TextDocument = cssDocumentIdentifier ,
80
80
Edits = [ LspFactory . CreateTextEdit (
81
81
position : ( lastLineNumber , lastLineLength ) ,
82
82
newText : lastLineNumber == 0
@@ -87,10 +87,10 @@ internal class ExtractToCssCodeActionResolver(
87
87
else
88
88
{
89
89
// No CSS file, create it and fill it in
90
- changes . Add ( new CreateFile { DocumentUri = codeBehindDocumentIdentifier . DocumentUri } ) ;
90
+ changes . Add ( new CreateFile { DocumentUri = cssDocumentIdentifier . DocumentUri } ) ;
91
91
changes . Add ( new TextDocumentEdit
92
92
{
93
- TextDocument = codeBehindDocumentIdentifier ,
93
+ TextDocument = cssDocumentIdentifier ,
94
94
Edits = [ LspFactory . CreateTextEdit ( position : ( 0 , 0 ) , cssContent ) ]
95
95
} ) ;
96
96
}
0 commit comments