@@ -38,6 +38,9 @@ pub fn add_completion(builder: &mut CompletionBuilder) -> Option<()> {
3838 DocCompletionExpected :: Using => {
3939 add_tag_using_completion ( builder) ;
4040 }
41+ DocCompletionExpected :: Export => {
42+ add_tag_export_completion ( builder) ;
43+ }
4144 }
4245
4346 builder. stop_here ( ) ;
@@ -74,6 +77,7 @@ fn get_doc_completion_expected(trigger_token: &LuaSyntaxToken) -> Option<DocComp
7477 }
7578 LuaTokenKind :: TkTagNamespace => Some ( DocCompletionExpected :: Namespace ) ,
7679 LuaTokenKind :: TkTagUsing => Some ( DocCompletionExpected :: Using ) ,
80+ LuaTokenKind :: TkTagExport => Some ( DocCompletionExpected :: Export ) ,
7781 LuaTokenKind :: TkComma => {
7882 let parent = left_token. parent ( ) ?;
7983 match parent. kind ( ) . into ( ) {
@@ -122,6 +126,7 @@ enum DocCompletionExpected {
122126 ClassAttr ,
123127 Namespace ,
124128 Using ,
129+ Export ,
125130}
126131
127132fn add_tag_param_name_completion ( builder : & mut CompletionBuilder ) -> Option < ( ) > {
@@ -306,3 +311,16 @@ fn add_tag_using_completion(builder: &mut CompletionBuilder) {
306311 builder. add_completion_item ( completion_item) ;
307312 }
308313}
314+
315+ fn add_tag_export_completion ( builder : & mut CompletionBuilder ) {
316+ let key = vec ! [ "namespace" , "global" ] ;
317+ for ( sorted_index, key) in key. iter ( ) . enumerate ( ) {
318+ let completion_item = CompletionItem {
319+ label : key. to_string ( ) ,
320+ kind : Some ( lsp_types:: CompletionItemKind :: ENUM_MEMBER ) ,
321+ sort_text : Some ( format ! ( "{:03}" , sorted_index) ) ,
322+ ..Default :: default ( )
323+ } ;
324+ builder. add_completion_item ( completion_item) ;
325+ }
326+ }
0 commit comments