File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ export class StyledVirtualDocumentFactory implements VirtualDocumentProvider {
27
27
public createVirtualDocument (
28
28
context : TemplateContext
29
29
) : vscode . TextDocument {
30
- const contents = `${ this . getVirtualDocumentRoot ( context ) } ${ context . text } }` ;
30
+ const contents = `${ this . getVirtualDocumentWrapper ( context ) } ${ context . text } }` ;
31
31
return {
32
32
uri : 'untitled://embedded.scss' ,
33
33
languageId : 'scss' ,
@@ -60,14 +60,14 @@ export class StyledVirtualDocumentFactory implements VirtualDocumentProvider {
60
60
}
61
61
62
62
public toVirtualDocOffset ( offset : number , context : TemplateContext ) : number {
63
- return offset + this . getVirtualDocumentRoot ( context ) . length ;
63
+ return offset + this . getVirtualDocumentWrapper ( context ) . length ;
64
64
}
65
65
66
66
public fromVirtualDocOffset ( offset : number , context : TemplateContext ) : number {
67
- return offset - this . getVirtualDocumentRoot ( context ) . length ;
67
+ return offset - this . getVirtualDocumentWrapper ( context ) . length ;
68
68
}
69
69
70
- private getVirtualDocumentRoot ( context : TemplateContext ) : string {
70
+ private getVirtualDocumentWrapper ( context : TemplateContext ) : string {
71
71
const tag = ( context . node . parent as ts . Node & { tag : any } ) ?. tag ?. escapedText ;
72
72
return tag === 'keyframes' ? StyledVirtualDocumentFactory . wrapperPreKeyframes : StyledVirtualDocumentFactory . wrapperPreRoot ;
73
73
}
You can’t perform that action at this time.
0 commit comments