@@ -65,7 +65,9 @@ const suggestionEntityToAutocomplete: Partial<Record<YQLEntity, AutocompleteEnti
6565 tableIndex : [ 'table_index' , 'index' ] ,
6666} ;
6767
68- const commonSuggestionEntities : AutocompleteEntityType [ ] = [ 'dir' , 'unknown' ] ;
68+ const commonSuggestionEntities : AutocompleteEntityType [ ] = [ 'dir' , 'unknown' , 'ext_sub_domain' ] ;
69+
70+ const directoryTypes : AutocompleteEntityType [ ] = [ 'dir' , 'ext_sub_domain' ] ;
6971
7072function filterAutocompleteEntities (
7173 autocompleteEntities : TAutocompleteEntity [ ] ,
@@ -109,7 +111,11 @@ function removeStartSlash(value: string) {
109111}
110112
111113function normalizeEntityPrefix ( value = '' , database : string ) {
112- let cleanedValue = removeStartSlash ( removeBackticks ( value ) ) ;
114+ const valueWithoutBackticks = removeBackticks ( value ) ;
115+ if ( ! valueWithoutBackticks . startsWith ( '/' ) ) {
116+ return valueWithoutBackticks ;
117+ }
118+ let cleanedValue = removeStartSlash ( valueWithoutBackticks ) ;
113119 const cleanedDatabase = removeStartSlash ( database ) ;
114120 if ( cleanedValue . startsWith ( cleanedDatabase ) ) {
115121 cleanedValue = cleanedValue . slice ( cleanedDatabase . length ) ;
@@ -297,7 +303,7 @@ export async function generateEntitiesSuggestion(
297303 if ( data . Success ) {
298304 const filteredEntities = filterAutocompleteEntities ( data . Result . Entities , suggestEntities ) ;
299305 return filteredEntities . reduce ( ( acc , { Name, Type} ) => {
300- const isDir = Type === 'dir' ;
306+ const isDir = directoryTypes . includes ( Type ) ;
301307 const label = isDir ? `${ Name } /` : Name ;
302308 let labelAsSnippet ;
303309 if ( isDir && ! withBackticks ) {
0 commit comments