microsoft / microsoft/TypeScript
jsDoc intellisense support for @typedef in another file
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 2 T. 4 Std.
- Gemergte PRs (30 T.)
- 132
Beschreibung
Issue Type: Feature Request
Intellisense uses @typedef tags in other files but only if the file is opened in current window. Please allow any typedef tag to be used inside current working directory even if file containing typedef is not opened.
Here is what i mean. I annotated a variable with type. This variable is exported directly with module.exports.

My typedef is in seperate file.
Configuration.js
/**
* @typedef {Object} ConfigurationInputDirectories
* @property {string} modules
* @property {string} layoutModules
* @property {string} standaloneScripts
* @property {string} standaloneStyles
* @property {string} libraryScripts
* @property {string} libraryStyles
* @property {string} markupTemplates
*/
/**
* @typedef {Object} ConfigurationOutputDirectories
* @property {string} pageScripts
* @property {string} vendorScripts
* @property {string} standaloneScripts
* @property {string} pageStyles
* @property {string} vendorStyles
* @property {string} standaloneStyles
* @property {string} markupFiles
*/
/**
* @typedef {Object} ConfigurationVendor
* @property {string} standardPath
* @property {string} minPath
*/
/**
* @typedef {Object} ConfigurationModule
* @property {string} layoutModule
* @property {string} markupTemplate
* @property {string[]} includeStandaloneScripts
* @property {string[]} includeStandaloneStyles
* @property {string[]} includeVendorScripts
* @property {string[]} includeVendorStyles
* @property {string[]} excludeStandaloneScripts
* @property {string[]} excludeStandaloneStyles
* @property {string[]} excludeVendorScripts
* @property {string[]} excludeVendorStyles
*/
/**
* @typedef {Object} ConfigurationLayoutModule
* @property {string} layoutModule
* @property {string} markupTemplate
* @property {string[]} includeStandaloneScripts
* @property {string[]} includeStandaloneStyles
* @property {string[]} includeVendorScripts
* @property {string[]} includeVendorStyles
* @property {string[]} excludeStandaloneScripts
* @property {string[]} excludeStandaloneStyles
* @property {string[]} excludeVendorScripts
* @property {string[]} excludeVendorStyles
*/
/**
* Represents configuration object for build process.
* @typedef {Object} Configuration
* @property {ConfigurationInputDirectories} inputDirectories
* @property {ConfigurationOutputDirectories} outputDirectories
* @property {Object.<string,ConfigurationVendor} vendorScripts
* @property {Object.<string,ConfigurationVendor>} vendorStyles
* @property {Object.<string,ConfigurationModule>} modules
* @property {Object.<string,ConfigurationLayoutModule>} layoutModules
* @property {string} defaultMarkupTemplate
* @property {string} contentPlaceHolder
* @property {string} nameDirectorySeperator
* @property {string[]} validLibraryEntryFileNames
* @property {string} moduleFileName
* @property {string} rootModuleFileName
* @property {string} systemjsPath
* @property {string} systemjsNamedRegistersPath
*/
When this file containing type definitions is open the intellisense/language service/or whatever you call it is recognizing this variable's type and intellisense displays the members when using this config variable. But when file is closed its type turns to any. It would be nice to see type informations from typedef tags even if files containing tags are closed.

VS Code version: Code 1.33.0 (0dd516dd412d42323fc3464531b1c715d51c4c1a, 2019-04-04T15:14:28.026Z)
OS version: Windows_NT x64 10.0.17134
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduziere das Problem mit den bereitgestellten Configuration.js-Typedefs und einem separaten module.exports-Consumer, zuerst mit geöffneter und dann mit geschlossener Typedef-Datei. Verfolge die Erkennung von JSDoc @typedef durch den JavaScript-Sprachdienst und sorge dafür, dass der Consumer diese Typen im gesamten aktuellen Arbeitsverzeichnis auflösen kann; fertig ist die Aufgabe, wenn IntelliSense die Typedef-Mitglieder in beiden Fällen anzeigt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, typescript
- Bereich
- tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100