Skip to content

Commit

Permalink
ci(format): format code
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoge committed Nov 14, 2024
1 parent ee61c06 commit 1fa35ee
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 42 deletions.
9 changes: 4 additions & 5 deletions src/languageFeatures.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import type { ParseError } from 'dt-sql-parser';
import {
EntityContext,
} from 'dt-sql-parser/dist/parser/common/entityCollector';
import { EntityContext } from 'dt-sql-parser/dist/parser/common/entityCollector';
import { WordPosition } from 'dt-sql-parser/dist/parser/common/textAndWord';
import * as monaco from 'monaco-editor';

Expand All @@ -15,7 +13,7 @@ import {
MarkerSeverity,
Position,
Range,
Uri,
Uri
} from './fillers/monaco-editor-core';
import type { LanguageServiceDefaults } from './monaco.contribution';

Expand Down Expand Up @@ -207,7 +205,8 @@ export class CompletionAdapter<T extends BaseSQLWorker>
export class DefinitionAdapter<T extends BaseSQLWorker> implements languages.DefinitionProvider {
constructor(
private readonly _worker: WorkerAccessor<T>,
private readonly _defaults: LanguageServiceDefaults) {}
private readonly _defaults: LanguageServiceDefaults
) {}
provideDefinition(
model: editor.IReadOnlyModel,
position: Position,
Expand Down
2 changes: 1 addition & 1 deletion src/languages/flink/flink.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ setupLanguageFeatures(LanguageIdEnum.FLINK, {
completionItems: true,
diagnostics: true,
references: true,
definitions: true,
definitions: true
});
2 changes: 1 addition & 1 deletion src/languages/hive/hive.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ setupLanguageFeatures(LanguageIdEnum.HIVE, {
completionItems: true,
diagnostics: true,
references: true,
definitions: true,
definitions: true
});
2 changes: 1 addition & 1 deletion src/languages/impala/impala.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ setupLanguageFeatures(LanguageIdEnum.IMPALA, {
completionItems: true,
diagnostics: true,
references: true,
definitions: true,
definitions: true
});
2 changes: 1 addition & 1 deletion src/languages/mysql/mysql.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ setupLanguageFeatures(LanguageIdEnum.MYSQL, {
completionItems: true,
diagnostics: true,
references: true,
definitions: true,
definitions: true
});
2 changes: 1 addition & 1 deletion src/languages/pgsql/pgsql.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ setupLanguageFeatures(LanguageIdEnum.PG, {
completionItems: true,
diagnostics: true,
references: true,
definitions: true,
definitions: true
});
2 changes: 1 addition & 1 deletion src/languages/spark/spark.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ setupLanguageFeatures(LanguageIdEnum.SPARK, {
completionItems: true,
diagnostics: true,
references: true,
definitions: true,
definitions: true
});
2 changes: 1 addition & 1 deletion src/languages/trino/trino.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ setupLanguageFeatures(LanguageIdEnum.TRINO, {
completionItems: true,
diagnostics: true,
references: true,
definitions: true,
definitions: true
});
16 changes: 3 additions & 13 deletions src/monaco.contribution.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
import {
EntityContext,
Suggestions,
} from 'dt-sql-parser';

import {
editor,
Emitter,
IEvent,
IRange,
languages,
Position,
} from './fillers/monaco-editor-core';
import { EntityContext, Suggestions } from 'dt-sql-parser';

import { editor, Emitter, IEvent, IRange, languages, Position } from './fillers/monaco-editor-core';

/**
* A completion item.
Expand Down
21 changes: 9 additions & 12 deletions src/setupLanguageFeatures.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import { LanguageIdEnum } from './common/constants';
import {
IDisposable,
languages,
} from './fillers/monaco-editor-core';
import { IDisposable, languages } from './fillers/monaco-editor-core';
import {
CompletionOptions,
LanguageServiceDefaults,
LanguageServiceDefaultsImpl,
ModeConfiguration,
modeConfigurationDefault,
PreprocessCode,
PreprocessCode
} from './monaco.contribution';

export interface FeatureConfiguration {
Expand Down Expand Up @@ -122,13 +119,13 @@ function processConfiguration(
: (defaults?.modeConfiguration.completionItems.triggerCharacters ??
modeConfigurationDefault.completionItems.triggerCharacters);
const references =
typeof configuration.references === 'boolean'
? configuration.references
: (defaults?.modeConfiguration.references ?? modeConfigurationDefault.references);
typeof configuration.references === 'boolean'
? configuration.references
: (defaults?.modeConfiguration.references ?? modeConfigurationDefault.references);
const definitions =
typeof configuration.definitions === 'boolean'
? configuration.definitions
: (defaults?.modeConfiguration.definitions ?? modeConfigurationDefault.definitions);
typeof configuration.definitions === 'boolean'
? configuration.definitions
: (defaults?.modeConfiguration.definitions ?? modeConfigurationDefault.definitions);

return {
diagnostics,
Expand All @@ -138,6 +135,6 @@ function processConfiguration(
triggerCharacters
},
references,
definitions,
definitions
};
}
6 changes: 1 addition & 5 deletions src/setupLanguageMode.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import type { BaseSQLWorker } from './baseSQLWorker';
import {
IDisposable,
languages,
Uri,
} from './fillers/monaco-editor-core';
import { IDisposable, languages, Uri } from './fillers/monaco-editor-core';
import * as languageFeatures from './languageFeatures';
import { LanguageServiceDefaults } from './monaco.contribution';
import { WorkerManager } from './workerManager';
Expand Down

0 comments on commit 1fa35ee

Please sign in to comment.