We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I already provide a decent experience for relative paths /~https://github.com/TypeStrong/atom-typescript#relative-paths
Want to expand it to also list the available external module declarations. But struggling to find the different between these two types:
declare module foo{ }
vs
declare module 'foo'{ }
Is there some LS API I could use to just get 'foo' and not foo?
'foo'
foo
Note: I have access to program so if its not possible using LS feel free to guide me a bit toward the program based solution 🌹
program
refs :TypeStrong/atom-typescript#230
The text was updated successfully, but these errors were encountered:
What I've look at : they both seem to be SyntaxKind.ModuleDeclaration
SyntaxKind.ModuleDeclaration
Sorry, something went wrong.
yes. the external module have a name that is SyntaxKind.StringLiteral. so the check would be
I had a PR (#2173) that did external module name completions, this might be helpful.
PR helped a lot. Thanks ❤️
export function getExternalModuleNames(program: Program): string[] { var entries: string[] = []; program.getSourceFiles().forEach(sourceFile => { // Look for ambient external module declarations forEachChild(sourceFile, child => { if (child.kind === SyntaxKind.ModuleDeclaration && (<ModuleDeclaration>child).name.kind === SyntaxKind.StringLiteral) { entries.push((<ModuleDeclaration>child).name.text); } }); }); return entries; }
No branches or pull requests
I already provide a decent experience for relative paths /~https://github.com/TypeStrong/atom-typescript#relative-paths
Want to expand it to also list the available external module declarations. But struggling to find the different between these two types:
vs
Is there some LS API I could use to just get
'foo'
and notfoo
?Note: I have access to
program
so if its not possible using LS feel free to guide me a bit toward theprogram
based solution 🌹refs :TypeStrong/atom-typescript#230
The text was updated successfully, but these errors were encountered: