Skip to content
New issue

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

Typescript removes function flags #243

Open
Dmerle opened this issue Feb 16, 2019 · 2 comments
Open

Typescript removes function flags #243

Dmerle opened this issue Feb 16, 2019 · 2 comments

Comments

@Dmerle
Copy link

@Dmerle Dmerle commented Feb 16, 2019

Typescript doesn't like to emit comments between the '()' and '{}' of a function.

Example:

SomeBinding() /* KeyBinding[T] */ {
  console.log("Bound!")
}

Emits this:

SomeBinding() {
  console.log("Bound!");
}

This is with 'removeComments' set to false in the tsconfig. This issue on the TS github implies they're aware of this but can't/won't do anything about it: microsoft/TypeScript#11046

However, the following is emitted as expected and could perhaps be used as an alternative syntax:

SomeBinding /* KeyBinding[T] */ () { ... }
@Dmerle

This comment has been minimized.

Copy link
Author

@Dmerle Dmerle commented Apr 24, 2019

I was able to replace the syntax by making the following changes to 'uclass.js':

Line 73:

let RE_func = /(\w+)\s*(\/\*([^\*]*)\*\/)?\s*\(([^.)]*)\).*/

Line 176:

s = matches[3]

Line 183:

let args = ((matches[4] || '').split(',').map((x) => refactored(x.trim())))

@keicoon

This comment has been minimized.

Copy link
Contributor

@keicoon keicoon commented May 9, 2019

@Dmerle If you check any side-effect about modification, you could help many people who be suffered about TS by sending "pull request" about that issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.