1
- import { env , Hover , languages , MarkdownString , workspace } from "vscode" ;
1
+ import { languages , workspace } from "vscode" ;
2
2
import { getSqlDocument } from "./logic/parse" ;
3
- import { DbCache , LookupResult , RoutineDetail } from "./logic/cache" ;
4
3
import { JobManager } from "../../config" ;
5
4
import Statement from "../../database/statement" ;
6
- import { getParmAttributes , prepareParamType } from "./logic/completion" ;
7
5
import { StatementType } from "../sql/types" ;
8
6
import { remoteAssistIsEnabled } from "./logic/available" ;
9
- import { getPositionData } from "./logic/callable" ;
10
- import { CallableSignature } from "../../database/callable" ;
11
7
import Schemas , { AllSQLTypes , InternalTypes , SQLType } from "../../database/schemas" ;
12
8
13
- const standardObjects : SQLType [ ] = AllSQLTypes . filter ( type => ! [ `functions` , `procedures` ] . includes ( type ) ) ;
14
9
15
10
export const peekProvider = languages . registerDefinitionProvider ( { language : `sql` } , {
16
11
async provideDefinition ( document , position , token ) {
12
+ const standardObjects : SQLType [ ] = AllSQLTypes . filter ( type => ! [ `functions` , `procedures` ] . includes ( type ) ) ;
17
13
if ( ! remoteAssistIsEnabled ( ) ) return ;
18
- console . log ( `peekProvider` ) ;
19
14
20
15
const defaultSchema = getDefaultSchema ( ) ;
21
16
const sqlDoc = getSqlDocument ( document ) ;
@@ -26,7 +21,6 @@ export const peekProvider = languages.registerDefinitionProvider({ language: `sq
26
21
27
22
if ( statementAt ) {
28
23
const refs = statementAt . getObjectReferences ( ) ;
29
- const possibleNames = refs . map ( ref => ref . object . name ) . filter ( name => name ) ;
30
24
31
25
const ref = refs . find ( ref => ref . tokens [ 0 ] . range . start && offset <= ref . tokens [ ref . tokens . length - 1 ] . range . end ) ;
32
26
@@ -50,7 +44,7 @@ export const peekProvider = languages.registerDefinitionProvider({ language: `sq
50
44
const type = InternalTypes [ obj . type ] ;
51
45
if ( type ) {
52
46
const contents = await Schemas . generateSQL ( obj . schema , obj . name , type . toUpperCase ( ) , true ) ;
53
- lines . push ( Statement . format ( contents ) , `` , `` ) ;
47
+ lines . push ( contents , `` , `` ) ;
54
48
}
55
49
}
56
50
0 commit comments