Merge pull request #107 from github/hashtagchris-runs-on
Remove warnings for the `SuggestedValues` provider (i.e. `runs-on`)
This commit is contained in:
@@ -2,6 +2,8 @@ import {Value} from "@github/actions-languageservice/value-providers/config";
|
||||
import {Octokit} from "@octokit/rest";
|
||||
import {TTLCache} from "../utils/cache";
|
||||
|
||||
// Limitation: getRunnerLabels returns default hosted labels and labels for repository self-hosted runners.
|
||||
// It doesn't return labels for organization runners visible to the repository.
|
||||
export async function getRunnerLabels(client: Octokit, cache: TTLCache, owner: string, name: string): Promise<Value[]> {
|
||||
const defaultLabels = [
|
||||
"ubuntu-latest",
|
||||
|
||||
@@ -73,21 +73,7 @@ jobs:
|
||||
{valueProviderConfig: defaultValueProviders}
|
||||
);
|
||||
|
||||
expect(result.length).toBe(1);
|
||||
expect(result[0]).toEqual({
|
||||
message: "Value 'does-not-exist' might not be valid",
|
||||
severity: DiagnosticSeverity.Warning,
|
||||
range: {
|
||||
end: {
|
||||
character: 27,
|
||||
line: 3
|
||||
},
|
||||
start: {
|
||||
character: 13,
|
||||
line: 3
|
||||
}
|
||||
}
|
||||
} as Diagnostic);
|
||||
expect(result.length).toBe(0);
|
||||
});
|
||||
|
||||
it("value in sequence not returned by value provider", async () => {
|
||||
@@ -106,21 +92,7 @@ jobs:
|
||||
{valueProviderConfig: defaultValueProviders}
|
||||
);
|
||||
|
||||
expect(result.length).toBe(1);
|
||||
expect(result[0]).toEqual({
|
||||
message: "Value 'does-not-exist' might not be valid",
|
||||
severity: DiagnosticSeverity.Warning,
|
||||
range: {
|
||||
end: {
|
||||
character: 20,
|
||||
line: 5
|
||||
},
|
||||
start: {
|
||||
character: 6,
|
||||
line: 5
|
||||
}
|
||||
}
|
||||
} as Diagnostic);
|
||||
expect(result.length).toBe(0);
|
||||
});
|
||||
|
||||
it("single value not returned by allowed value provider", async () => {
|
||||
|
||||
@@ -150,13 +150,7 @@ function invalidValue(diagnostics: Diagnostic[], token: StringToken, kind: Value
|
||||
});
|
||||
break;
|
||||
|
||||
case ValueProviderKind.SuggestedValues:
|
||||
diagnostics.push({
|
||||
message: `Value '${token.value}' might not be valid`,
|
||||
severity: DiagnosticSeverity.Warning,
|
||||
range: mapRange(token.range)
|
||||
});
|
||||
break;
|
||||
// no messages for SuggestedValues
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user