@@ -761,7 +761,7 @@ export function create(
761
761
}
762
762
}
763
763
764
- completionList . items = completionList . items . filter ( item => ! specialTags . has ( item . label ) ) ;
764
+ completionList . items = completionList . items . filter ( item => ! specialTags . has ( parseLabel ( item . label ) . name ) ) ;
765
765
766
766
const htmlDocumentations = new Map < string , string > ( ) ;
767
767
@@ -773,12 +773,11 @@ export function create(
773
773
}
774
774
775
775
for ( const item of completionList . items ) {
776
-
777
776
const resolvedLabelKey = resolveItemKey ( item . label ) ;
778
777
779
778
if ( resolvedLabelKey ) {
780
779
const name = resolvedLabelKey . tag ;
781
- item . label = name ;
780
+ item . label = resolvedLabelKey . leadingSlash ? '/' + name : name ;
782
781
if ( item . textEdit ) {
783
782
item . textEdit . newText = name ;
784
783
} ;
@@ -838,6 +837,7 @@ export function create(
838
837
type : 'componentProp' ,
839
838
tag : '^' ,
840
839
prop : propName ,
840
+ leadingSlash : false
841
841
} ;
842
842
}
843
843
@@ -988,6 +988,15 @@ export function create(
988
988
}
989
989
} ;
990
990
991
+ function parseLabel ( label : string ) {
992
+ const leadingSlash = label . startsWith ( '/' ) ;
993
+ const name = label . slice ( leadingSlash ? 1 : 0 ) ;
994
+ return {
995
+ name,
996
+ leadingSlash
997
+ }
998
+ }
999
+
991
1000
function parseItemKey ( type : InternalItemId , tag : string , prop : string ) {
992
1001
return '__VLS_data=' + type + ',' + tag + ',' + prop ;
993
1002
}
@@ -997,12 +1006,14 @@ function isItemKey(key: string) {
997
1006
}
998
1007
999
1008
function resolveItemKey ( key : string ) {
1000
- if ( isItemKey ( key ) ) {
1001
- const strs = key . slice ( '__VLS_data=' . length ) . split ( ',' ) ;
1009
+ const { leadingSlash, name } = parseLabel ( key ) ;
1010
+ if ( isItemKey ( name ) ) {
1011
+ const strs = name . slice ( '__VLS_data=' . length ) . split ( ',' ) ;
1002
1012
return {
1003
1013
type : strs [ 0 ] as InternalItemId ,
1004
1014
tag : strs [ 1 ] ,
1005
1015
prop : strs [ 2 ] ,
1016
+ leadingSlash
1006
1017
} ;
1007
1018
}
1008
1019
}
0 commit comments