Skip to content

Commit 30996c4

Browse files
author
zhaoge
committed
ci(format): format prettier
1 parent df125c4 commit 30996c4

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

src/languageFeatures.ts

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import type { ParseError } from 'dt-sql-parser';
2-
import {
3-
EntityContext,
4-
} from 'dt-sql-parser/dist/parser/common/entityCollector';
2+
import { EntityContext } from 'dt-sql-parser/dist/parser/common/entityCollector';
53
import { WordPosition } from 'dt-sql-parser/dist/parser/common/textAndWord';
64
import * as monaco from 'monaco-editor';
75

@@ -15,7 +13,7 @@ import {
1513
MarkerSeverity,
1614
Position,
1715
Range,
18-
Uri,
16+
Uri
1917
} from './fillers/monaco-editor-core';
2018
import type { LanguageServiceDefaults } from './monaco.contribution';
2119

@@ -236,13 +234,17 @@ export class DefinitionAdapter<T extends BaseSQLWorker> implements languages.Def
236234
};
237235
const curEntity = entities?.find((entity: EntityContext) => {
238236
const entityPosition = entity.position;
239-
if (entityPosition.startColumn === word?.startColumn && entityPosition.endColumn === word?.endColumn && entityPosition.line === position.lineNumber) {
237+
if (
238+
entityPosition.startColumn === word?.startColumn &&
239+
entityPosition.endColumn === word?.endColumn &&
240+
entityPosition.line === position.lineNumber
241+
) {
240242
return entity;
241243
}
242244
return null;
243-
})
245+
});
244246
if (curEntity) {
245-
for(let k in entities) {
247+
for (let k in entities) {
246248
const entity = entities[Number(k)];
247249
if (
248250
entity.entityContextType.includes('Create') &&
@@ -297,14 +299,22 @@ export class ReferenceAdapter<T extends BaseSQLWorker> implements languages.Refe
297299
const arr: languages.Location[] = [];
298300
const curEntity = entities?.find((entity: EntityContext) => {
299301
const entityPosition = entity.position;
300-
if (entityPosition.startColumn === word?.startColumn && entityPosition.endColumn === word?.endColumn && entityPosition.line === position.lineNumber) {
302+
if (
303+
entityPosition.startColumn === word?.startColumn &&
304+
entityPosition.endColumn === word?.endColumn &&
305+
entityPosition.line === position.lineNumber
306+
) {
301307
return entity;
302308
}
303309
return null;
304-
})
310+
});
305311
if (curEntity) {
306312
entities?.forEach((entity) => {
307-
if (word?.word && entity.text === word?.word && curEntity.entityContextType.includes(entity.entityContextType)) {
313+
if (
314+
word?.word &&
315+
entity.text === word?.word &&
316+
curEntity.entityContextType.includes(entity.entityContextType)
317+
) {
308318
let pos: WordPosition | null = null;
309319
pos = entity.position;
310320
arr.push({
@@ -318,7 +328,6 @@ export class ReferenceAdapter<T extends BaseSQLWorker> implements languages.Refe
318328
});
319329
}
320330
});
321-
322331
}
323332
return arr;
324333
});

0 commit comments

Comments
 (0)