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

Use selected TS version in the editor #69

Open
Gerrit0 opened this issue Nov 25, 2019 · 2 comments
Open

Use selected TS version in the editor #69

Gerrit0 opened this issue Nov 25, 2019 · 2 comments

Comments

@Gerrit0
Copy link
Contributor

Gerrit0 commented Nov 25, 2019

The current Monaco editor doesn't support TS 3.7, so pasting in an assertion function reports errors even with TS 3.7 selected under options - https://ts-ast-viewer.com/#code.... The parse result is correctly displayed in the middle & right panes, but errors show up in the left pane.

export function predicate (arg: any): asserts arg is string {
  if (typeof arg !== 'string') {
    throw new Error('Was not a string')
  }
}
@dsherret
Copy link
Owner

Yes, that would be nice!

I think what might be best here is to create a fork of https://github.com/microsoft/monaco-typescript that could reuse the compiler objects from the rest of the site. Then it could maybe be swapped in for the current typescript plugin.

@Gerrit0 Gerrit0 mentioned this issue Apr 7, 2023
@ArnaudBarre
Copy link

Hello ! I ran into this when analyzing the AST for import attributes.
Can the editor be updated and a small hint a the bottom that give the TS version of the editor?

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

No branches or pull requests

3 participants