Code Monkey home page Code Monkey logo

typescriptast's People

Contributors

gitter-badger avatar tocsharp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

typescriptast's Issues

How to read unnamed exported defaults?

Hi,

I'd like to parse something like
export default { .... }
but how can I do it?

None of the below assignments give me that root object with all definitions within the curly braces.

rootNode = ast.OfKind(SyntaxKind.ExportAssignment).FirstOrDefault();
rootNode = ast.OfKind(SyntaxKind.ExportDeclaration).FirstOrDefault();
rootNode = ast.OfKind(SyntaxKind.NamedExports).FirstOrDefault();
rootNode = ast.OfKind(SyntaxKind.ExportKeyword).FirstOrDefault();
rootNode = ast.OfKind(SyntaxKind.ExportSpecifier).FirstOrDefault();
rootNode = ast.OfKind(SyntaxKind.DefaultClause).FirstOrDefault();
rootNode = ast.OfKind(SyntaxKind.DefaultKeyword).FirstOrDefault();

JsDoc Comment is null

When the following code:

/**
 * Property-based callback for X event
 * @param payload: the x payload payload
 */
@Input() public onX: (payload: XPayload) => void;

is navigated to via TypeScriptAST, the property's JsDoc contains a single entry. That entry's Comment property is null. I can't find any way to get the actual comment text without using property.GetTextWithComments() and manually parsing it.

Similarly, the parameter tag's comment is also not set - it is an empty string.

Parser cannot handle 'readonly' modifier on property signature

When parsing the file https://github.com/microsoft/TypeScript/blob/master/scripts/types/ambient.d.ts, the parser cannot handle the situation properly that there is a readonly modifier on a property signature.

Snippet:

    namespace File {
        export interface VinylOptions<T extends Contents = Contents> {
            cwd?: string;
            base?: string;
            path?: string;
            history?: readonly string[];

Subsequent Property signatures aren't reported anymore. Instead, expressions are reported.

System.InvalidCastException

Hi there,
I got this System.InvalidCastException Cannot cast 'Zu.TypeScript.TsTypes.NamedImports' to 'Zu.TypeScript.TsTypes.INamedImportBindings'
when i try to parse the following code:
import { Component, HostBinding } from '@angular/core';

Thanks

[Design] ChangeNode method is too strict

Hello, I came across an implementation that was far away from what I was expecting while using the ChangeNode() method.
If the replacement string provided equals the current node's string representation, the method throws an exception with message "Same value".
I'm convinced that one would expect a no-op in that particular case, and that this implementation is very unnatural, at the very least.

add benchmark

Hello! Thank you for interesting project.
It's very interesting to compare performance of your parser and typescript.
Please, add simple perf test

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.