Skip to content

Commit 06a1fd9

Browse files
committed
Fix typos and augment comments around language labels
1 parent 67e8c86 commit 06a1fd9

4 files changed

Lines changed: 10 additions & 8 deletions

File tree

extensions/ql-vscode/src/cli.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export class CodeQLCliServer implements Disposable {
125125
private static CLI_VERSION_WITH_DECOMPILE_KIND_DIL = new SemVer('2.3.0');
126126

127127
/**
128-
* CLI version where --kind=DIL was introduced
128+
* CLI version where languages are exposed during a `codeql resolve database` command.
129129
*/
130130
private static CLI_VERSION_WITH_LANGUAGE = new SemVer('2.4.1');
131131

@@ -716,7 +716,7 @@ export class CodeQLCliServer implements Disposable {
716716
return (await this.getVersion()).compare(CodeQLCliServer.CLI_VERSION_WITH_DECOMPILE_KIND_DIL) >= 0;
717717
}
718718

719-
public async supportsLangaugeName() {
719+
public async supportsLanguageName() {
720720
return (await this.getVersion()).compare(CodeQLCliServer.CLI_VERSION_WITH_LANGUAGE) >= 0;
721721
}
722722

extensions/ql-vscode/src/databases.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,8 +831,10 @@ export class DatabaseManager extends DisposableObject {
831831
}
832832

833833
private async getPrimaryLanguage(dbPath: string) {
834-
if (!(await this.cli.supportsLangaugeName())) {
835-
// return undefined so that we continually recalculate until the cli version is bumped
834+
if (!(await this.cli.supportsLanguageName())) {
835+
// return undefined so that we recalculate on restart until the cli is at a version that
836+
// supports this feature. This recalculation is cheap since we avoid calling into the cli
837+
// unless we know it can return the langauges property.
836838
return undefined;
837839
}
838840
const dbInfo = await this.cli.resolveDatabase(dbPath);

extensions/ql-vscode/src/helpers.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,12 +466,12 @@ export class CachedOperation<U> {
466466

467467
/**
468468
* Note that this heuristic is only being used for backwards compatibility with
469-
* CLI versions before the langauge name was introduced to dbInfo. Implementations
469+
* CLI versions before the langauge name was introduced to dbInfo. Features
470470
* that do not require backwards compatibility should call
471471
* `cli.CodeQLCliServer.resolveDatabase` and use the first entry in the
472472
* `languages` property.
473473
*
474-
* @see cli.CodeQLCliServer.supportsLangaugeName
474+
* @see cli.CodeQLCliServer.supportsLanguageName
475475
* @see cli.CodeQLCliServer.resolveDatabase
476476
*/
477477
const dbSchemeToLanguage = {
@@ -487,7 +487,7 @@ const dbSchemeToLanguage = {
487487
* Returns the initial contents for an empty query, based on the language of the selected
488488
* databse.
489489
*
490-
* First try to get the contents text based on language. if that fails, try to get based on
490+
* First try to use the given language name. If that doesn't exist, try to infer it based on
491491
* dbscheme. Otherwise return no import statement.
492492
*
493493
* @param language the database language or empty string if unknown

extensions/ql-vscode/src/vscode-tests/minimal-workspace/databases.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ describe('databases', () => {
7171
supportsDatabaseRegistration: supportsDatabaseRegistrationSpy
7272
} as unknown as QueryServerClient,
7373
{
74-
supportsLangaugeName: supportsLanguageNameSpy,
74+
supportsLanguageName: supportsLanguageNameSpy,
7575
resolveDatabase: resolveDatabaseSpy
7676
} as unknown as CodeQLCliServer,
7777
{} as Logger,

0 commit comments

Comments
 (0)