File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -33,9 +33,13 @@ export class ErrorCollector {
3333 if ( service ) {
3434 const diagnostics = service . getDiagnostics ( fileName ) ;
3535 if ( ! diagnostics || ! diagnostics . length ) {
36+ this . connection . sendDiagnostics ( {
37+ uri : document . uri ,
38+ diagnostics : [ ] ,
39+ } ) ;
3640 return ;
3741 }
38- if ( diagnostics [ 0 ] . message ) {
42+ if ( diagnostics [ 0 ] . span ) {
3943 // Backwards compatibility with old ng.Diagnostic[]
4044 const offsets = ( [ ] as number [ ] ) . concat ( ...diagnostics . map ( d => [ d . span . start , d . span . end ] ) ) ;
4145 const positions = this . documents . offsetsToPositions ( document , offsets ) ;
Original file line number Diff line number Diff line change @@ -194,16 +194,14 @@ connection.onDefinition((params: lsp.TextDocumentPositionParams) => logErrors(()
194194 textSpan . start ,
195195 textSpan . start + textSpan . length ,
196196 ] ) ;
197- const originSelectionRange = lsp . Range . create (
198- start . line - 1 , start . character - 1 , end . line - 1 , end . character - 1 ) ;
197+ const originSelectionRange = lsp . Range . create ( start , end ) ;
199198 return definitions . map ( ( d ) => {
200199 const targetUri = lsp . TextDocumentIdentifier . create ( fileNameToUri ( d . fileName ) ) ;
201200 const [ start , end ] = documents . offsetsToPositions ( targetUri , [
202201 d . textSpan . start ,
203202 d . textSpan . start + d . textSpan . length ,
204203 ] ) ;
205- const targetRange = lsp . Range . create (
206- start . line - 1 , start . character - 1 , end . line - 1 , end . character - 1 ) ;
204+ const targetRange = lsp . Range . create ( start , end ) ;
207205 return {
208206 originSelectionRange,
209207 targetUri : targetUri . uri ,
You can’t perform that action at this time.
0 commit comments