aws-iam-language-server 0.0.30 → 0.0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aws-iam-language-server",
3
- "version": "0.0.30",
3
+ "version": "0.0.31",
4
4
  "type": "module",
5
5
  "bin": "./src/server.js",
6
6
  "publisher": "MichaelBarney",
@@ -13,10 +13,14 @@ export function completeResourceValue(location, context) {
13
13
  const statementActions = statement?.Action ?? statement?.NotAction ?? [];
14
14
  const expandedActions = statementActions.flatMap(expandActionPattern);
15
15
  const resources = ServiceReference.getResourcesForActions(expandedActions);
16
+ const seenArns = new Set();
16
17
  for (const resource of resources) {
17
18
  for (const arn of resource.arnFormats) {
18
19
  if (location.partial && !arn.toLowerCase().startsWith(location.partial.toLowerCase()))
19
20
  continue;
21
+ if (seenArns.has(arn))
22
+ continue;
23
+ seenArns.add(arn);
20
24
  items.push({
21
25
  label: arn,
22
26
  sortText: `0-${arn}`,
@@ -126,6 +130,7 @@ export function completeResourceValue(location, context) {
126
130
  const region = parts[3];
127
131
  const account = parts[4];
128
132
  const resources = ServiceReference.getResourcesForActions(expandActionPattern(`${service}:*`));
133
+ const seenLabels = new Set();
129
134
  for (const resource of resources) {
130
135
  for (const arn of resource.arnFormats) {
131
136
  const patternParts = splitArn(arn);
@@ -141,6 +146,9 @@ export function completeResourceValue(location, context) {
141
146
  .replace(`\${Account}`, parts[4]);
142
147
  if (location.partial && !label.toLowerCase().startsWith(location.partial.toLowerCase()))
143
148
  continue;
149
+ if (seenLabels.has(label))
150
+ continue;
151
+ seenLabels.add(label);
144
152
  items.push({
145
153
  label,
146
154
  kind: CompletionItemKind.Enum,