microsoft / microsoft/TypeScript
JS Intellisense not detecting ES6 Symbol properties assigned after Initialization
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 2g 4h
- PR unite (30g)
- 132
Descrizione
- VS Code Version: 1.54.3
- OS Version: Windows 10 Pro, version 20H2, build 19042.804
Steps to Reproduce:
- Initialize a Symbol
- Initialize an empty object literal
- Assign the object a function, using the symbol as its property
The following code also demonstrates some of the steps to reproduce:
const symKey = Symbol();
/** @namespace */
var objLiteral = {
literalPublicFn1() {},
/**
* You found the secret fn!
*/
[symKey]() {},
};
/** @namespace */
var objAssigned = {};
/** @memberof objAssigned */
objAssigned.laterPublicFn1 = function() {};
/**
* You found the secret fn!
* @memberof objAssigned
* */
objAssigned[symKey] = function () {}
For both objects, the string properties are picked up by Intellisense and autocompleted as expected. However, Intellisense only provides function info for the symbol on the objLiteral object, where the symbol property was declared as part of the literal. For the objAssigned object, where the symbol property was assigned after initialization, no function info is provided.
In other words, intellisense works when calling objLiteral[symKey]() but not when calling objAssigned[symKey]()
Does this issue occur when all extensions are disabled?: Yes
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con la riproduzione JavaScript nell’issue e analizza la gestione da parte del servizio di linguaggio TypeScript delle proprietà Symbol calcolate assegnate dopo l’inizializzazione dell’oggetto. Confronta IntelliSense per objLiteralsymKey e objAssignedsymKey, e considera completata l’issue quando entrambi forniscono le informazioni sulla funzione mostrate per il caso literal.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, typescript, vscode
- Ambito
- devtools
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100