Skip to content

Commit 180a858

Browse files
authored
File I/O Abstraction Part 11: Migrate BicepCompletionProvider (#16663)
- Updated `BicepCompletionProvider` to use the new file I/O APIs. - Clean up unused `IFileResolver` methods. The interface now only contains two methods to be migrated. ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/Azure/bicep/pull/16663)
1 parent ced0e2d commit 180a858

30 files changed

+1162
-1269
lines changed

src/Bicep.Cli/Commands/BuildParamsCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ private static void ValidateBicepFile(Compilation compilation, Uri? bicepFileUri
131131
throw new CommandLineException($"Bicep file {bicepFileUri.LocalPath} provided with --bicep-file can only be used if the Bicep parameters \"using\" declaration refers to a Bicep file on disk.");
132132
}
133133

134-
if (!bicepSemanticModel.Root.FileUri.Equals(bicepFileUri))
134+
if (!bicepSemanticModel.SourceFile.Uri.Equals(bicepFileUri))
135135
{
136136
throw new CommandLineException($"Bicep file {bicepFileUri.LocalPath} provided with --bicep-file option doesn't match the Bicep file {bicepSemanticModel.Root.Name} referenced by the \"using\" declaration in the parameters file.");
137137
}
Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,80 @@
1-
[
2-
{
3-
"label": "../",
4-
"kind": "folder",
5-
"deprecated": false,
6-
"preselect": false,
7-
"sortText": "3_../",
8-
"filterText": "'./'",
9-
"insertTextFormat": "snippet",
10-
"insertTextMode": "adjustIndentation",
11-
"textEdit": {
12-
"range": {},
13-
"newText": "'./$0'"
14-
},
15-
"command": {
16-
"title": "file path completion",
17-
"command": "editor.action.triggerSuggest"
18-
}
19-
},
20-
{
21-
"label": "empty.bicep",
22-
"kind": "file",
23-
"deprecated": false,
24-
"preselect": false,
25-
"sortText": "1_empty.bicep",
26-
"filterText": "'./ChildModules/empty.bicep'",
27-
"insertTextFormat": "plainText",
28-
"insertTextMode": "adjustIndentation",
29-
"textEdit": {
30-
"range": {},
31-
"newText": "'./ChildModules/empty.bicep'"
32-
}
33-
},
34-
{
35-
"label": "folder with space/",
36-
"kind": "folder",
37-
"deprecated": false,
38-
"preselect": false,
39-
"sortText": "3_folder%20with%20space/",
40-
"filterText": "'./ChildModules/folder with space/'",
41-
"insertTextFormat": "snippet",
42-
"insertTextMode": "adjustIndentation",
43-
"textEdit": {
44-
"range": {},
45-
"newText": "'./ChildModules/folder with space/$0'"
46-
},
47-
"command": {
48-
"title": "file path completion",
49-
"command": "editor.action.triggerSuggest"
50-
}
51-
},
52-
{
53-
"label": "main.bicep",
54-
"kind": "file",
55-
"deprecated": false,
56-
"preselect": false,
57-
"sortText": "1_main.bicep",
58-
"filterText": "'./ChildModules/main.bicep'",
59-
"insertTextFormat": "plainText",
60-
"insertTextMode": "adjustIndentation",
61-
"textEdit": {
62-
"range": {},
63-
"newText": "'./ChildModules/main.bicep'"
64-
}
65-
},
66-
{
67-
"label": "modulea.bicep",
68-
"kind": "file",
69-
"deprecated": false,
70-
"preselect": false,
71-
"sortText": "1_modulea.bicep",
72-
"filterText": "'./ChildModules/modulea.bicep'",
73-
"insertTextFormat": "plainText",
74-
"insertTextMode": "adjustIndentation",
75-
"textEdit": {
76-
"range": {},
77-
"newText": "'./ChildModules/modulea.bicep'"
78-
}
79-
}
1+
[
2+
{
3+
"label": "../",
4+
"kind": "folder",
5+
"deprecated": false,
6+
"preselect": false,
7+
"sortText": "3_../",
8+
"filterText": "'./'",
9+
"insertTextFormat": "snippet",
10+
"insertTextMode": "adjustIndentation",
11+
"textEdit": {
12+
"range": {},
13+
"newText": "'./$0'"
14+
},
15+
"command": {
16+
"title": "file path completion",
17+
"command": "editor.action.triggerSuggest"
18+
}
19+
},
20+
{
21+
"label": "empty.bicep",
22+
"kind": "file",
23+
"deprecated": false,
24+
"preselect": false,
25+
"sortText": "1_empty.bicep",
26+
"filterText": "'./ChildModules/empty.bicep'",
27+
"insertTextFormat": "plainText",
28+
"insertTextMode": "adjustIndentation",
29+
"textEdit": {
30+
"range": {},
31+
"newText": "'./ChildModules/empty.bicep'"
32+
}
33+
},
34+
{
35+
"label": "folder with space/",
36+
"kind": "folder",
37+
"deprecated": false,
38+
"preselect": false,
39+
"sortText": "3_folder with space/",
40+
"filterText": "'./ChildModules/folder with space/'",
41+
"insertTextFormat": "snippet",
42+
"insertTextMode": "adjustIndentation",
43+
"textEdit": {
44+
"range": {},
45+
"newText": "'./ChildModules/folder with space/$0'"
46+
},
47+
"command": {
48+
"title": "file path completion",
49+
"command": "editor.action.triggerSuggest"
50+
}
51+
},
52+
{
53+
"label": "main.bicep",
54+
"kind": "file",
55+
"deprecated": false,
56+
"preselect": false,
57+
"sortText": "1_main.bicep",
58+
"filterText": "'./ChildModules/main.bicep'",
59+
"insertTextFormat": "plainText",
60+
"insertTextMode": "adjustIndentation",
61+
"textEdit": {
62+
"range": {},
63+
"newText": "'./ChildModules/main.bicep'"
64+
}
65+
},
66+
{
67+
"label": "modulea.bicep",
68+
"kind": "file",
69+
"deprecated": false,
70+
"preselect": false,
71+
"sortText": "1_modulea.bicep",
72+
"filterText": "'./ChildModules/modulea.bicep'",
73+
"insertTextFormat": "plainText",
74+
"insertTextMode": "adjustIndentation",
75+
"textEdit": {
76+
"range": {},
77+
"newText": "'./ChildModules/modulea.bicep'"
78+
}
79+
}
8080
]
Lines changed: 79 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,80 @@
1-
[
2-
{
3-
"label": "../",
4-
"kind": "folder",
5-
"deprecated": false,
6-
"preselect": false,
7-
"sortText": "3_../",
8-
"filterText": "''",
9-
"insertTextFormat": "snippet",
10-
"insertTextMode": "adjustIndentation",
11-
"textEdit": {
12-
"range": {},
13-
"newText": "'$0'"
14-
},
15-
"command": {
16-
"title": "file path completion",
17-
"command": "editor.action.triggerSuggest"
18-
}
19-
},
20-
{
21-
"label": "empty.bicep",
22-
"kind": "file",
23-
"deprecated": false,
24-
"preselect": false,
25-
"sortText": "1_empty.bicep",
26-
"filterText": "'ChildModules/empty.bicep'",
27-
"insertTextFormat": "plainText",
28-
"insertTextMode": "adjustIndentation",
29-
"textEdit": {
30-
"range": {},
31-
"newText": "'ChildModules/empty.bicep'"
32-
}
33-
},
34-
{
35-
"label": "folder with space/",
36-
"kind": "folder",
37-
"deprecated": false,
38-
"preselect": false,
39-
"sortText": "3_folder%20with%20space/",
40-
"filterText": "'ChildModules/folder with space/'",
41-
"insertTextFormat": "snippet",
42-
"insertTextMode": "adjustIndentation",
43-
"textEdit": {
44-
"range": {},
45-
"newText": "'ChildModules/folder with space/$0'"
46-
},
47-
"command": {
48-
"title": "file path completion",
49-
"command": "editor.action.triggerSuggest"
50-
}
51-
},
52-
{
53-
"label": "main.bicep",
54-
"kind": "file",
55-
"deprecated": false,
56-
"preselect": false,
57-
"sortText": "1_main.bicep",
58-
"filterText": "'ChildModules/main.bicep'",
59-
"insertTextFormat": "plainText",
60-
"insertTextMode": "adjustIndentation",
61-
"textEdit": {
62-
"range": {},
63-
"newText": "'ChildModules/main.bicep'"
64-
}
65-
},
66-
{
67-
"label": "modulea.bicep",
68-
"kind": "file",
69-
"deprecated": false,
70-
"preselect": false,
71-
"sortText": "1_modulea.bicep",
72-
"filterText": "'ChildModules/modulea.bicep'",
73-
"insertTextFormat": "plainText",
74-
"insertTextMode": "adjustIndentation",
75-
"textEdit": {
76-
"range": {},
77-
"newText": "'ChildModules/modulea.bicep'"
78-
}
79-
}
1+
[
2+
{
3+
"label": "../",
4+
"kind": "folder",
5+
"deprecated": false,
6+
"preselect": false,
7+
"sortText": "3_../",
8+
"filterText": "''",
9+
"insertTextFormat": "snippet",
10+
"insertTextMode": "adjustIndentation",
11+
"textEdit": {
12+
"range": {},
13+
"newText": "'$0'"
14+
},
15+
"command": {
16+
"title": "file path completion",
17+
"command": "editor.action.triggerSuggest"
18+
}
19+
},
20+
{
21+
"label": "empty.bicep",
22+
"kind": "file",
23+
"deprecated": false,
24+
"preselect": false,
25+
"sortText": "1_empty.bicep",
26+
"filterText": "'ChildModules/empty.bicep'",
27+
"insertTextFormat": "plainText",
28+
"insertTextMode": "adjustIndentation",
29+
"textEdit": {
30+
"range": {},
31+
"newText": "'ChildModules/empty.bicep'"
32+
}
33+
},
34+
{
35+
"label": "folder with space/",
36+
"kind": "folder",
37+
"deprecated": false,
38+
"preselect": false,
39+
"sortText": "3_folder with space/",
40+
"filterText": "'ChildModules/folder with space/'",
41+
"insertTextFormat": "snippet",
42+
"insertTextMode": "adjustIndentation",
43+
"textEdit": {
44+
"range": {},
45+
"newText": "'ChildModules/folder with space/$0'"
46+
},
47+
"command": {
48+
"title": "file path completion",
49+
"command": "editor.action.triggerSuggest"
50+
}
51+
},
52+
{
53+
"label": "main.bicep",
54+
"kind": "file",
55+
"deprecated": false,
56+
"preselect": false,
57+
"sortText": "1_main.bicep",
58+
"filterText": "'ChildModules/main.bicep'",
59+
"insertTextFormat": "plainText",
60+
"insertTextMode": "adjustIndentation",
61+
"textEdit": {
62+
"range": {},
63+
"newText": "'ChildModules/main.bicep'"
64+
}
65+
},
66+
{
67+
"label": "modulea.bicep",
68+
"kind": "file",
69+
"deprecated": false,
70+
"preselect": false,
71+
"sortText": "1_modulea.bicep",
72+
"filterText": "'ChildModules/modulea.bicep'",
73+
"insertTextFormat": "plainText",
74+
"insertTextMode": "adjustIndentation",
75+
"textEdit": {
76+
"range": {},
77+
"newText": "'ChildModules/modulea.bicep'"
78+
}
79+
}
8080
]

0 commit comments

Comments
 (0)