11import 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' ;
53import { WordPosition } from 'dt-sql-parser/dist/parser/common/textAndWord' ;
64import * 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' ;
2018import 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