Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/ansible-language-server/src/utils/yaml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
): AncestryBuilder<X> {
this._index--;
if (isPair(this.get())) {
if (!type || !(type === Pair.prototype.constructor)) {
if (!type || type !== Pair.prototype.constructor) {
this._index--;
}
}
Expand All @@ -59,7 +59,7 @@
this._index = Number.MIN_SAFE_INTEGER;
}
}
return this as unknown as AncestryBuilder<X>;

Check warning on line 62 in packages/ansible-language-server/src/utils/yaml.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This assertion is unnecessary since the receiver accepts the original type of the expression.

See more on https://sonarcloud.io/project/issues?id=AutoCodeRoverSG_vscode-ansible-test-instance&issues=AZ5cqQcT-ICtGyq0bY8v&open=AZ5cqQcT-ICtGyq0bY8v&pullRequest=2
}

/**
Expand All @@ -75,7 +75,7 @@
} else {
this._index = Number.MIN_SAFE_INTEGER;
}
return this as unknown as AncestryBuilder<YAMLMap>;

Check warning on line 78 in packages/ansible-language-server/src/utils/yaml.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This assertion is unnecessary since the receiver accepts the original type of the expression.

See more on https://sonarcloud.io/project/issues?id=AutoCodeRoverSG_vscode-ansible-test-instance&issues=AZ5cqQcT-ICtGyq0bY8w&open=AZ5cqQcT-ICtGyq0bY8w&pullRequest=2
}

/**
Expand Down
6 changes: 3 additions & 3 deletions src/features/lightspeed/utils/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
indentIndex: number,
validSuggestionTriggerIndents: number[],
) => {
const matched = documentLines[indentIndex].match(/^\s*-\s*/);
const matched = /^\s*-\s*/.exec(documentLines[indentIndex]);
if (matched) {
const indentLength = Math.max(matched[0].length - 2, 0);
if (validSuggestionTriggerIndents[indentIndex] === -1) {
Expand All @@ -320,12 +320,12 @@
let firstMatchKeywordIndent = -1;
const validSuggestionTriggerIndents: number[] = [];
let matchKeywordIndex = -1;
for (let lineIndex = 0; lineIndex < documentLines.length; lineIndex++) {
for (const _ of documentLines) {
validSuggestionTriggerIndents.push(-1);
}
for (let lineIndex = documentLines.length - 1; lineIndex >= 0; lineIndex--) {
if (matchKeyword(tasksFileKeywords, documentLines[lineIndex])) {
const match = documentLines[lineIndex].match(/^\s*/);
const match = /^\s*/.exec(documentLines[lineIndex]);
if (firstMatchKeywordIndent === -1) {
firstMatchKeywordIndent = match ? match[0].length : -1;
}
Expand Down Expand Up @@ -508,11 +508,11 @@
yamlFiles.forEach((file) => {
const fileContents = readVarFiles(`${dirPath}/${file}`);
if (fileContents) {
files.push({
path: `${dir}/${file}`,
file_type: dir.slice(0, -1) as RoleFileType,
content: fileContents,
} as GenerationListEntry);

Check warning on line 515 in src/features/lightspeed/utils/data.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This assertion is unnecessary since it does not change the type of the expression.

See more on https://sonarcloud.io/project/issues?id=AutoCodeRoverSG_vscode-ansible-test-instance&issues=AZ5cqQgw-ICtGyq0bY8x&open=AZ5cqQgw-ICtGyq0bY8x&pullRequest=2
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/features/lightspeed/utils/scanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ export class CollectionFinder {
return [];
});
const r: AnsibleCollection[] = [];
for (let i = 0; i < a.length; i++) {
(await Promise.all(await a[i])).forEach((entry) => {
for (const item of a) {
(await Promise.all(await item)).forEach((entry) => {
if (entry instanceof AnsibleCollection) {
r.push(entry);
}
Expand Down