File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,9 @@ const serverHost = new ServerHost();
43
43
const projSvc = new ProjectService ( serverHost , logger , connection , options ) ;
44
44
const { tsProjSvc} = projSvc ;
45
45
46
+ // Empty definition range for files without `scriptInfo`
47
+ const EMPTY_RANGE = lsp . Range . create ( 0 , 0 , 0 , 0 ) ;
48
+
46
49
// Log initialization info
47
50
connection . console . info ( `Log file: ${ logger . getLogFileName ( ) } ` ) ;
48
51
if ( process . env . NG_DEBUG ) {
@@ -176,8 +179,7 @@ connection.onDefinition((params: lsp.TextDocumentPositionParams) => {
176
179
if ( ! scriptInfo && d . textSpan . length > 0 ) {
177
180
continue ;
178
181
}
179
- const ZERO_RANGE = lsp . Range . create ( 0 , 0 , 0 , 0 ) ; // for files without `scriptInfo`
180
- const range = scriptInfo ? tsTextSpanToLspRange ( scriptInfo , d . textSpan ) : ZERO_RANGE ;
182
+ const range = scriptInfo ? tsTextSpanToLspRange ( scriptInfo , d . textSpan ) : EMPTY_RANGE ;
181
183
182
184
const targetUri = filePathToUri ( d . fileName ) ;
183
185
results . push ( {
You can’t perform that action at this time.
0 commit comments