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

Add an API for extracting information from .tl files? #180

Closed
pdesaulniers opened this issue Jul 1, 2020 · 1 comment
Closed

Add an API for extracting information from .tl files? #180

pdesaulniers opened this issue Jul 1, 2020 · 1 comment
Labels
feature request New feature or request

Comments

@pdesaulniers
Copy link
Member

pdesaulniers commented Jul 1, 2020

In theory, this would be super useful for text editors, languages servers (teal-language/vscode-teal#16, teal-language/vscode-teal#17), tools such as #80...

Off the top of my head, I would like to be able to query things like

  • What is the type of the variable at (y, x)?
  • Where is the variable at (y, x) defined / implemented? Where is it referenced?
  • Which variables are accessible in the lexical scope at (y, x)? What are their types?

With that said, tl's parser is not designed to deal with incomplete inputs right now, so I don't know how well this API would work in text editors in practice. For instance, some incomplete inputs can cause a cascade of errors:

local x = {
   y: 
}

-- the type checker is pretty much non-functional beyond this point

Perhaps this could be implemented as an external tool instead.

@pdesaulniers pdesaulniers changed the title Add an API for extracting information from .tl files Add an API for extracting information from .tl files? Jul 1, 2020
@hishamhm hishamhm added the feature request New feature or request label Jul 1, 2020
@pdesaulniers
Copy link
Member Author

Implemented in #369 😁

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

No branches or pull requests

2 participants