Skip to content

Commit e7faabc

Browse files
committed
Add "rust" as an analysis language
1 parent 69db3f3 commit e7faabc

File tree

6 files changed

+12
-0
lines changed

6 files changed

+12
-0
lines changed

extensions/ql-vscode/src/common/query-language.ts

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export enum QueryLanguage {
66
Javascript = "javascript",
77
Python = "python",
88
Ruby = "ruby",
9+
Rust = "rust",
910
Swift = "swift",
1011
}
1112

@@ -25,6 +26,8 @@ export function getLanguageDisplayName(language: string): string {
2526
return "Python";
2627
case QueryLanguage.Ruby:
2728
return "Ruby";
29+
case QueryLanguage.Rust:
30+
return "Rust";
2831
case QueryLanguage.Swift:
2932
return "Swift";
3033
default:
@@ -43,6 +46,7 @@ export const PACKS_BY_QUERY_LANGUAGE = {
4346
[QueryLanguage.Javascript]: ["codeql/javascript-queries"],
4447
[QueryLanguage.Python]: ["codeql/python-queries"],
4548
[QueryLanguage.Ruby]: ["codeql/ruby-queries"],
49+
[QueryLanguage.Rust]: ["codeql/rust-queries"],
4650
};
4751

4852
export const dbSchemeToLanguage: Record<string, QueryLanguage> = {
@@ -53,6 +57,7 @@ export const dbSchemeToLanguage: Record<string, QueryLanguage> = {
5357
"semmlecode.csharp.dbscheme": QueryLanguage.CSharp,
5458
"go.dbscheme": QueryLanguage.Go,
5559
"ruby.dbscheme": QueryLanguage.Ruby,
60+
"rust.dbscheme": QueryLanguage.Rust,
5661
"swift.dbscheme": QueryLanguage.Swift,
5762
};
5863

extensions/ql-vscode/src/language-selection-panel/language-selection-data-provider.ts

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const ALL_LANGUAGE_SELECTION_OPTIONS = [
1616
QueryLanguage.Javascript,
1717
QueryLanguage.Python,
1818
QueryLanguage.Ruby,
19+
QueryLanguage.Rust,
1920
QueryLanguage.Swift,
2021
];
2122

extensions/ql-vscode/src/query-history/store/query-history-dto.ts

+1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ export enum QueryLanguageDto {
2121
Javascript = "javascript",
2222
Python = "python",
2323
Ruby = "ruby",
24+
Rust = "rust",
2425
Swift = "swift",
2526
}

extensions/ql-vscode/src/query-history/store/query-history-language-domain-mapper.ts

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ export function mapQueryLanguageToDto(
2020
return QueryLanguageDto.Python;
2121
case QueryLanguage.Ruby:
2222
return QueryLanguageDto.Ruby;
23+
case QueryLanguage.Rust:
24+
return QueryLanguageDto.Rust;
2325
case QueryLanguage.Swift:
2426
return QueryLanguageDto.Swift;
2527
default:

extensions/ql-vscode/src/query-history/store/query-history-language-dto-mapper.ts

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ export function mapQueryLanguageToDomainModel(
2020
return QueryLanguage.Python;
2121
case QueryLanguageDto.Ruby:
2222
return QueryLanguage.Ruby;
23+
case QueryLanguageDto.Rust:
24+
return QueryLanguage.Rust;
2325
case QueryLanguageDto.Swift:
2426
return QueryLanguage.Swift;
2527
default:

extensions/ql-vscode/test/vscode-tests/cli-integration/local-queries/skeleton-query-wizard.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ describe("SkeletonQueryWizard", () => {
7979
.fn()
8080
.mockResolvedValue([
8181
"ruby",
82+
"rust",
8283
"javascript",
8384
"go",
8485
"java",

0 commit comments

Comments
 (0)