@@ -1836,38 +1836,34 @@ async function getOptionArgsSuggestions(
18361836}
18371837
18381838const sortModifierSuggestions = {
1839- ASC : ( entered : string = '' ) =>
1840- ( {
1841- label : 'ASC' ,
1842- text : 'ASC' . slice ( entered . length ) ,
1843- detail : '' ,
1844- kind : 'Keyword' ,
1845- sortText : '1-ASC' ,
1846- } as SuggestionRawDefinition ) ,
1847- DESC : ( entered : string = '' ) =>
1848- ( {
1849- label : 'DESC' ,
1850- text : 'DESC' . slice ( entered . length ) ,
1851- detail : '' ,
1852- kind : 'Keyword' ,
1853- sortText : '1-DESC' ,
1854- } as SuggestionRawDefinition ) ,
1855- NULLS_FIRST : ( entered : string = '' ) =>
1856- ( {
1857- label : 'NULLS FIRST' ,
1858- text : 'NULLS FIRST' . slice ( entered . length ) ,
1859- detail : '' ,
1860- kind : 'Keyword' ,
1861- sortText : '2-NULLS FIRST' ,
1862- } as SuggestionRawDefinition ) ,
1863- NULLS_LAST : ( entered : string = '' ) =>
1864- ( {
1865- label : 'NULLS LAST' ,
1866- text : 'NULLS LAST' . slice ( entered . length ) ,
1867- detail : '' ,
1868- kind : 'Keyword' ,
1869- sortText : '2-NULLS LAST' ,
1870- } as SuggestionRawDefinition ) ,
1839+ ASC : {
1840+ label : 'ASC' ,
1841+ text : 'ASC' ,
1842+ detail : '' ,
1843+ kind : 'Keyword' ,
1844+ sortText : '1-ASC' ,
1845+ } as SuggestionRawDefinition ,
1846+ DESC : {
1847+ label : 'DESC' ,
1848+ text : 'DESC' ,
1849+ detail : '' ,
1850+ kind : 'Keyword' ,
1851+ sortText : '1-DESC' ,
1852+ } as SuggestionRawDefinition ,
1853+ NULLS_FIRST : {
1854+ label : 'NULLS FIRST' ,
1855+ text : 'NULLS FIRST' ,
1856+ detail : '' ,
1857+ kind : 'Keyword' ,
1858+ sortText : '2-NULLS FIRST' ,
1859+ } as SuggestionRawDefinition ,
1860+ NULLS_LAST : {
1861+ label : 'NULLS LAST' ,
1862+ text : 'NULLS LAST' ,
1863+ detail : '' ,
1864+ kind : 'Keyword' ,
1865+ sortText : '2-NULLS LAST' ,
1866+ } as SuggestionRawDefinition ,
18711867} ;
18721868
18731869export const suggestForSortCmd = async ( innerText : string , getFieldsByType : GetFieldsByTypeFn ) => {
@@ -1876,10 +1872,10 @@ export const suggestForSortCmd = async (innerText: string, getFieldsByType: GetF
18761872 switch ( pos ) {
18771873 case 'space2' : {
18781874 return [
1879- sortModifierSuggestions . ASC ( ) ,
1880- sortModifierSuggestions . DESC ( ) ,
1881- sortModifierSuggestions . NULLS_FIRST ( ) ,
1882- sortModifierSuggestions . NULLS_LAST ( ) ,
1875+ sortModifierSuggestions . ASC ,
1876+ sortModifierSuggestions . DESC ,
1877+ sortModifierSuggestions . NULLS_FIRST ,
1878+ sortModifierSuggestions . NULLS_LAST ,
18831879 ...getFinalSuggestions ( {
18841880 comma : true ,
18851881 } ) ,
@@ -1888,16 +1884,16 @@ export const suggestForSortCmd = async (innerText: string, getFieldsByType: GetF
18881884 case 'order' : {
18891885 const suggestions : SuggestionRawDefinition [ ] = [ ] ;
18901886 for ( const modifier of Object . values ( sortModifierSuggestions ) ) {
1891- if ( modifier ( ) . label . startsWith ( order ) ) {
1892- suggestions . push ( modifier ( order ) ) ;
1887+ if ( modifier . label . startsWith ( order ) ) {
1888+ suggestions . push ( modifier ) ;
18931889 }
18941890 }
18951891 return suggestions ;
18961892 }
18971893 case 'space3' : {
18981894 return [
1899- sortModifierSuggestions . NULLS_FIRST ( ) ,
1900- sortModifierSuggestions . NULLS_LAST ( ) ,
1895+ sortModifierSuggestions . NULLS_FIRST ,
1896+ sortModifierSuggestions . NULLS_LAST ,
19011897 ...getFinalSuggestions ( {
19021898 comma : true ,
19031899 } ) ,
@@ -1906,8 +1902,8 @@ export const suggestForSortCmd = async (innerText: string, getFieldsByType: GetF
19061902 case 'nulls' : {
19071903 const suggestions : SuggestionRawDefinition [ ] = [ ] ;
19081904 for ( const modifier of Object . values ( sortModifierSuggestions ) ) {
1909- if ( modifier ( ) . label . startsWith ( nulls ) ) {
1910- suggestions . push ( modifier ( nulls ) ) ;
1905+ if ( modifier . label . startsWith ( nulls ) ) {
1906+ suggestions . push ( modifier ) ;
19111907 }
19121908 }
19131909 return suggestions ;
0 commit comments