File tree Expand file tree Collapse file tree
vscode-tests/minimal-workspace Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 ) ;
Original file line number Diff line number Diff 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 */
477477const 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
Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments