microsoft / microsoft/TypeScript
Go to Definition for Angular (9.0.0-rc.9) project breaks
Personne n'a encore pris cette issue.
- Langage dominant
- Go
- Étoiles
- 111k
- Forks
- 14.3k
- Merge moyen
- 2 j 4 h
- PR mergées (30 j)
- 132
Description
OS and VSCode version
- VSCode Version: 1.41.1
- OS Version: Ubuntu Mate 18.04
- Typescript versions tested: 3.6.4 (version from node_modules) , 3.7.3 (current version used in VSCode), ms-vscode.vscode-typescript-next-3.8.20200119 (using VSCode plugin)
- Angular version: 9.0.0-rc.9
Problem description (updated with findings in comments below)
Go To Definition does not work properly when trying to go to definition of an Angular class that resides in node_modules. Simply mouse-hovering over this Class (or function) definition works though and the context popup is shown.
Moreover, if navigating to a class that resides inside the project source files (not inside node_modules) also works.
Go To Definition also works when going into definition of libraries that are not part of Angular - for example, rxjs.
Steps to Reproduce:
- Import or create Angular project (using RC version 9.0.0-rc.9) and install node_modules
- Create a component like so:
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.scss']
})
export class LoginComponent implements OnInit {
constructor() {}
ngOnInit() {}
}
- Try
ctrl + mouse clickonOnInitclass. Following error is thrown in the log file:
Info 260 [8:44:36.701] request:
{"seq":37,"type":"request","command":"definitionAndBoundSpan","arguments":{"file":"/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/src/app/modules/login/login.component.ts","line":8,"offset":44}}
Err 261 [8:44:36.883] Exception on executing command {"seq":37,"type":"request","command":"definitionAndBoundSpan","arguments":{"file":"/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/src/app/modules/login/login.component.ts","line":8,"offset":44}}:
Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
at String.replace (<anonymous>)
at Object.normalizeSlashes (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:15757:21)
at Object.combinePaths (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:16094:31)
at Object.getPathComponents (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:15943:19)
at Object.resolvePath (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:16115:82)
at Object.normalizePath (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:15865:19)
at Object.toPath (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:8866:18)
at toPath (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:110995:23)
at getSourceFile (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:111043:24)
at tryGetSourcePosition (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:111016:24)
at tryGetSourcePosition (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:111020:61)
at tryGetSourcePosition (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:111020:61)
at tryGetSourcePosition (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:111020:61)
at tryGetSourcePosition (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:111020:61)
at tryGetSourcePosition (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:111020:61)
[... repeated entries ommited for brevity]
File text of /media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/src/app/modules/login/login.component.ts:
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-login',
templateUrl: './login.component.html',
styleUrls: ['./login.component.scss']
})
export class LoginComponent implements OnInit {
constructor() {}
ngOnInit() {}
}
Info 176 [8:56:13.165] response:
{"seq":0,"type":"response","command":"definitionAndBoundSpan","request_seq":14,"success":false,"message":"Error processing request. Maximum call stack size exceeded\nRangeError: Maximum call stack size exceeded\n at String.replace (<anonymous>)\n at Object.normalizeSlashes (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:15757:21)\n at Object.combinePaths (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:16094:31)\n at Object.getPathComponents (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:15943:19)\n at Object.resolvePath (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:16115:82)\n at Object.normalizePath (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:15865:19)\n at Object.toPath (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:8866:18)\n at toPath (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:110995:23)\n at getSourceFile (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:111043:24)\n at tryGetSourcePosition (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:111016:24)\n at tryGetSourcePosition (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:111020:61)\n at tryGetSourcePosition (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:111020:61)\n at tryGetSourcePosition (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:111016:24)\n at tryGetSourcePosition (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:111020:61)\n at tryGetSourcePosition (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:111020:61)\n at tryGetSourcePosition (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:111016:24)\n at tryGetSourcePosition (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:111020:61)\n at tryGetSourcePosition (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:111020:61)\n at tryGetSourcePosition (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:111020:61)\n at tryGetSourcePosition (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:111020:61)\n at tryGetSourcePosition (/media/martin/DADOS/Programacao/projetos/bootstrap-code/ui/node_modules/typescript/lib/tsserver.js:111020:61)\n [... repeated entries ommited for brevity]
Does this issue occur when all extensions are disabled?: Yes/No
Yes
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par reproduire Go to Definition pour OnInit dans le composant Angular 9.0.0-rc.9 signalé et inspectez la requête definitionAndBoundSpan. Lisez le chemin de pile pertinent dans node_modules/typescript/lib/tsserver.js, en particulier les appels répétés à tryGetSourcePosition. C’est terminé lorsque la navigation vers les classes Angular n’échoue plus avec Maximum call stack size exceeded.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- angular, typescript
- Domaine
- developer-experience, tooling
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100