Skip to content

Commit

Permalink
ci(format): format prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoge committed Dec 3, 2024
1 parent df125c4 commit 30996c4
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 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 @@ -236,13 +234,17 @@ export class DefinitionAdapter<T extends BaseSQLWorker> implements languages.Def
};
const curEntity = entities?.find((entity: EntityContext) => {
const entityPosition = entity.position;
if (entityPosition.startColumn === word?.startColumn && entityPosition.endColumn === word?.endColumn && entityPosition.line === position.lineNumber) {
if (
entityPosition.startColumn === word?.startColumn &&
entityPosition.endColumn === word?.endColumn &&
entityPosition.line === position.lineNumber
) {
return entity;
}
return null;
})
});
if (curEntity) {
for(let k in entities) {
for (let k in entities) {
const entity = entities[Number(k)];
if (
entity.entityContextType.includes('Create') &&
Expand Down Expand Up @@ -297,14 +299,22 @@ export class ReferenceAdapter<T extends BaseSQLWorker> implements languages.Refe
const arr: languages.Location[] = [];
const curEntity = entities?.find((entity: EntityContext) => {
const entityPosition = entity.position;
if (entityPosition.startColumn === word?.startColumn && entityPosition.endColumn === word?.endColumn && entityPosition.line === position.lineNumber) {
if (
entityPosition.startColumn === word?.startColumn &&
entityPosition.endColumn === word?.endColumn &&
entityPosition.line === position.lineNumber
) {
return entity;
}
return null;
})
});
if (curEntity) {
entities?.forEach((entity) => {
if (word?.word && entity.text === word?.word && curEntity.entityContextType.includes(entity.entityContextType)) {
if (
word?.word &&
entity.text === word?.word &&
curEntity.entityContextType.includes(entity.entityContextType)
) {
let pos: WordPosition | null = null;
pos = entity.position;
arr.push({
Expand All @@ -318,7 +328,6 @@ export class ReferenceAdapter<T extends BaseSQLWorker> implements languages.Refe
});
}
});

}
return arr;
});
Expand Down

0 comments on commit 30996c4

Please sign in to comment.