@@ -4875,6 +4875,280 @@ services:
4875
4875
},
4876
4876
},
4877
4877
},
4878
+ {
4879
+ name : "env_file string attribute with no prefix" ,
4880
+ content : `
4881
+ services:
4882
+ test:
4883
+ env_file: ` ,
4884
+ line : 3 ,
4885
+ character : 14 ,
4886
+ list : & protocol.CompletionList {
4887
+ Items : []protocol.CompletionItem {
4888
+ {
4889
+ Label : "a.txt" ,
4890
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFile ),
4891
+ },
4892
+ {
4893
+ Label : "b" ,
4894
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFolder ),
4895
+ },
4896
+ {
4897
+ Label : "folder" ,
4898
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFolder ),
4899
+ },
4900
+ },
4901
+ },
4902
+ },
4903
+ {
4904
+ name : "env_file string attribute with a ./ prefix" ,
4905
+ content : `
4906
+ services:
4907
+ test:
4908
+ env_file: ./` ,
4909
+ line : 3 ,
4910
+ character : 16 ,
4911
+ list : & protocol.CompletionList {
4912
+ Items : []protocol.CompletionItem {
4913
+ {
4914
+ Label : "a.txt" ,
4915
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFile ),
4916
+ },
4917
+ {
4918
+ Label : "b" ,
4919
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFolder ),
4920
+ },
4921
+ {
4922
+ Label : "folder" ,
4923
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFolder ),
4924
+ },
4925
+ },
4926
+ },
4927
+ },
4928
+ {
4929
+ name : "env_file string attribute with a ./folder/ prefix" ,
4930
+ content : `
4931
+ services:
4932
+ test:
4933
+ env_file: ./folder/` ,
4934
+ line : 3 ,
4935
+ character : 23 ,
4936
+ list : & protocol.CompletionList {
4937
+ Items : []protocol.CompletionItem {
4938
+ {
4939
+ Label : "subfile.txt" ,
4940
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFile ),
4941
+ },
4942
+ },
4943
+ },
4944
+ },
4945
+ {
4946
+ name : "env_file string attribute with no prefix" ,
4947
+ content : `
4948
+ services:
4949
+ test:
4950
+ env_file:
4951
+ - ` ,
4952
+ line : 4 ,
4953
+ character : 8 ,
4954
+ list : & protocol.CompletionList {
4955
+ Items : []protocol.CompletionItem {
4956
+ {
4957
+ Label : "a.txt" ,
4958
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFile ),
4959
+ },
4960
+ {
4961
+ Label : "b" ,
4962
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFolder ),
4963
+ },
4964
+ {
4965
+ Label : "folder" ,
4966
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFolder ),
4967
+ },
4968
+ },
4969
+ },
4970
+ },
4971
+ {
4972
+ name : "env_file string attribute with a ./ prefix" ,
4973
+ content : `
4974
+ services:
4975
+ test:
4976
+ env_file:
4977
+ - ./` ,
4978
+ line : 4 ,
4979
+ character : 10 ,
4980
+ list : & protocol.CompletionList {
4981
+ Items : []protocol.CompletionItem {
4982
+ {
4983
+ Label : "a.txt" ,
4984
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFile ),
4985
+ },
4986
+ {
4987
+ Label : "b" ,
4988
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFolder ),
4989
+ },
4990
+ {
4991
+ Label : "folder" ,
4992
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFolder ),
4993
+ },
4994
+ },
4995
+ },
4996
+ },
4997
+ {
4998
+ name : "env_file string attribute with a ./folder/ prefix" ,
4999
+ content : `
5000
+ services:
5001
+ test:
5002
+ env_file:
5003
+ - ./folder/` ,
5004
+ line : 4 ,
5005
+ character : 17 ,
5006
+ list : & protocol.CompletionList {
5007
+ Items : []protocol.CompletionItem {
5008
+ {
5009
+ Label : "subfile.txt" ,
5010
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFile ),
5011
+ },
5012
+ },
5013
+ },
5014
+ },
5015
+ {
5016
+ name : "label_file string attribute with no prefix" ,
5017
+ content : `
5018
+ services:
5019
+ test:
5020
+ label_file: ` ,
5021
+ line : 3 ,
5022
+ character : 16 ,
5023
+ list : & protocol.CompletionList {
5024
+ Items : []protocol.CompletionItem {
5025
+ {
5026
+ Label : "a.txt" ,
5027
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFile ),
5028
+ },
5029
+ {
5030
+ Label : "b" ,
5031
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFolder ),
5032
+ },
5033
+ {
5034
+ Label : "folder" ,
5035
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFolder ),
5036
+ },
5037
+ },
5038
+ },
5039
+ },
5040
+ {
5041
+ name : "label_file string attribute with a ./ prefix" ,
5042
+ content : `
5043
+ services:
5044
+ test:
5045
+ label_file: ./` ,
5046
+ line : 3 ,
5047
+ character : 18 ,
5048
+ list : & protocol.CompletionList {
5049
+ Items : []protocol.CompletionItem {
5050
+ {
5051
+ Label : "a.txt" ,
5052
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFile ),
5053
+ },
5054
+ {
5055
+ Label : "b" ,
5056
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFolder ),
5057
+ },
5058
+ {
5059
+ Label : "folder" ,
5060
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFolder ),
5061
+ },
5062
+ },
5063
+ },
5064
+ },
5065
+ {
5066
+ name : "label_file string attribute with a ./folder/ prefix" ,
5067
+ content : `
5068
+ services:
5069
+ test:
5070
+ label_file: ./folder/` ,
5071
+ line : 3 ,
5072
+ character : 25 ,
5073
+ list : & protocol.CompletionList {
5074
+ Items : []protocol.CompletionItem {
5075
+ {
5076
+ Label : "subfile.txt" ,
5077
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFile ),
5078
+ },
5079
+ },
5080
+ },
5081
+ },
5082
+ {
5083
+ name : "label_file string attribute with no prefix" ,
5084
+ content : `
5085
+ services:
5086
+ test:
5087
+ label_file:
5088
+ - ` ,
5089
+ line : 4 ,
5090
+ character : 8 ,
5091
+ list : & protocol.CompletionList {
5092
+ Items : []protocol.CompletionItem {
5093
+ {
5094
+ Label : "a.txt" ,
5095
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFile ),
5096
+ },
5097
+ {
5098
+ Label : "b" ,
5099
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFolder ),
5100
+ },
5101
+ {
5102
+ Label : "folder" ,
5103
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFolder ),
5104
+ },
5105
+ },
5106
+ },
5107
+ },
5108
+ {
5109
+ name : "label_file string attribute with a ./ prefix" ,
5110
+ content : `
5111
+ services:
5112
+ test:
5113
+ label_file:
5114
+ - ./` ,
5115
+ line : 4 ,
5116
+ character : 10 ,
5117
+ list : & protocol.CompletionList {
5118
+ Items : []protocol.CompletionItem {
5119
+ {
5120
+ Label : "a.txt" ,
5121
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFile ),
5122
+ },
5123
+ {
5124
+ Label : "b" ,
5125
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFolder ),
5126
+ },
5127
+ {
5128
+ Label : "folder" ,
5129
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFolder ),
5130
+ },
5131
+ },
5132
+ },
5133
+ },
5134
+ {
5135
+ name : "label_file string attribute with a ./folder/ prefix" ,
5136
+ content : `
5137
+ services:
5138
+ test:
5139
+ label_file:
5140
+ - ./folder/` ,
5141
+ line : 4 ,
5142
+ character : 17 ,
5143
+ list : & protocol.CompletionList {
5144
+ Items : []protocol.CompletionItem {
5145
+ {
5146
+ Label : "subfile.txt" ,
5147
+ Kind : types .CreateCompletionItemKindPointer (protocol .CompletionItemKindFile ),
5148
+ },
5149
+ },
5150
+ },
5151
+ },
4878
5152
}
4879
5153
4880
5154
composeFileURI := fmt .Sprintf ("file:///%v" , strings .TrimPrefix (filepath .ToSlash (filepath .Join (dir , "compose.yaml" )), "/" ))
0 commit comments