microsoft / microsoft/TypeScript

JSDoc property name is not parsed as expected when non-alphanumeric characters are present and intellisense not showing properties

Aperta
#36,047 3 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Needs Proposal Suggestion
Lingua principale
Go
Stelle
111k
Fork
14.3k
Merge medio
2g 4h
PR unite (30g)
132

Descrizione

TS Template added by @mjbvz

TypeScript Version: 3.8.0-dev.20200104

Search terms:

  • jsdoc / jsdocs
  • completionInfo

  • VSCode Version: 1.41.1 (user setup)
  • OS Version: Windows_NT x64 10.0.17134

Origin of this discovery:
I was trying to document my types which translate to XML classes. The syntax for which includes the "@class" as a property name of my object. This is not possible given the current syntax parsing in VSCode.

Steps to Reproduce:

  1. Place this code in the editor with the language as Javascript
    Code:
/**
 * @typedef Foo
 * @property {string} bar Property shows in intellisense
 * @property {string} @baz Property should show in intellisense but does not
 * @property {string} test Property should show in intellisense but does not
 * @property {string} @class Property name "@class" should be a possible property name that
 * does not get interpreted as a JSDoc instruction.
 * @property {string} even#ThisShouldBeAValidName! But the name is not parsed as expeted
 */

/**
 * @type {Foo}
 */
const fooInstance = {
	
}
  1. Prompt the intellisense to show within the "fooInstance" object.
    1. Expected: The properties @ baz and @ class should be highlighted like normal property names
      1. Actual: The properties are shown as if they were JSDoc instructions
    2. Expected: The property "even#ThisShouldBeAValidName!" should be highlighted like a normal property name
      1. Actual: The property is highlighted as expected until the "#" symbol and then it seems to be treated like a comment
    3. Expected: Intellisense should show all the properties
      1. Actual: Only the first property "bar" is shown. An empty string "" is shown as if it were another property name.

Does this issue occur when all extensions are disabled?: Yes

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia riproducendo il comportamento di JSDoc typedef e completionInfo nell'editor JavaScript usando l'esempio di codice in questa issue. Traccia come vengono analizzati i nomi di @property e come vengono prodotte le proposte di completamento; il lavoro è completato quando i nomi contenenti @, # e ! vengono preservati e tutte le proprietà elencate compaiono in IntelliSense.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, typescript
Ambito
compilers, devtools
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.