1- import { notFound } from "@src/diagnostic" ;
1+ import { notFound , NotFoundCode } from "@src/diagnostic" ;
22import AutocompleteResult from "@src/parser/AutocompleteResult" ;
3- import { getConfigs } from "@src/repositories/configs" ;
3+ import { getConfigPathByName , getConfigs } from "@src/repositories/configs" ;
44import { config } from "@src/support/config" ;
55import { findHoverMatchesInDoc } from "@src/support/doc" ;
66import { detectedRange , detectInDoc } from "@src/support/parser" ;
@@ -75,7 +75,7 @@ export const linkProvider: LinkProvider = (doc: vscode.TextDocument) => {
7575 return null ;
7676 }
7777
78- const configItem = getConfigs ( ) . items . find (
78+ const configItem = getConfigs ( ) . items . configs . find (
7979 ( config ) => config . name === param . value ,
8080 ) ;
8181
@@ -107,7 +107,7 @@ export const hoverProvider: HoverProvider = (
107107 return null ;
108108 }
109109
110- const configItem = getConfigs ( ) . items . find (
110+ const configItem = getConfigs ( ) . items . configs . find (
111111 ( config ) => config . name === match ,
112112 ) ;
113113
@@ -159,20 +159,24 @@ export const diagnosticProvider = (
159159 return null ;
160160 }
161161
162- const config = getConfigs ( ) . items . find (
162+ const config = getConfigs ( ) . items . configs . find (
163163 ( c ) => c . name === param . value ,
164164 ) ;
165165
166166 if ( config ) {
167167 return null ;
168168 }
169169
170- return notFound (
171- "Config" ,
172- param . value ,
173- detectedRange ( param ) ,
174- "config" ,
175- ) ;
170+ const pathToFile = getConfigPathByName ( param . value ) ;
171+
172+ const code : NotFoundCode = pathToFile
173+ ? {
174+ value : "config" ,
175+ target : vscode . Uri . file ( projectPath ( pathToFile ) ) ,
176+ }
177+ : "config" ;
178+
179+ return notFound ( "Config" , param . value , detectedRange ( param ) , code ) ;
176180 } ,
177181 ) ;
178182} ;
@@ -197,7 +201,7 @@ export const completionProvider: CompletionProvider = {
197201 return [ ] ;
198202 }
199203
200- return getConfigs ( ) . items . map ( ( config ) => {
204+ return getConfigs ( ) . items . configs . map ( ( config ) => {
201205 let completeItem = new vscode . CompletionItem (
202206 config . name ,
203207 vscode . CompletionItemKind . Value ,
0 commit comments