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

Request: exposing language AST #258

Closed
alsoeric opened this issue Jun 14, 2017 · 3 comments
Closed

Request: exposing language AST #258

alsoeric opened this issue Jun 14, 2017 · 3 comments

Comments

@alsoeric
Copy link

Is there a way to expose the AST for a language with the language
protocol? The use case is for enabling AST directed editing.

My goal is to improve programming by speech recognition. Having the AST
available makes it possible to refer to elements of code by name. This
will enable more precise navigation, editing and code creation without
forcing the disabled programmer to "speak the keyboard".

@mickaelistria
Copy link

Can the documentSymbols be a good solution for your use-case?

@alsoeric
Copy link
Author

From reading the documentation, it seems like it only gives you the symbols within a language for example a class name or local variable. What I'm talking about our features within the language such as argument, index, function, method, predicate, left value, right value. In other words all of the elements of an AST. Once you have these names available, then you can edit and navigate precisely without touching the keyboard.

For example, here's a code sample

data_logger.info(json.dumps(query_dict['xyzzy']))

If I said something like "change index", I should be able to get enough information to highlight the index and make it a selection region so I can then dictate something else.

data_logger.info(json.dumps(query_dict['xyzzy']))

However, if I said something like "select argument", I should see something like:

data_logger.info(json.dumps(query_dict['xyzzy']))
1 2

what the LSP should do is return arguments on the line and let the editor show them with an indicator which the user could select to choose which argument operate on.

@dbaeumer
Copy link
Member

@alsoeric I can see how and AST can help here but currently there are no plans to expose an AST via the LSP. The whole idea of the LSP is to not do this since it makes standardizing things across languages and tools very hard. See https://www.eclipse.org/community/eclipse_newsletter/2017/may/article1.php

I will close this issue since I can't see us working on this in the near future given the current design goals of the LSP.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants