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

First implementation of tree-sitter parser #20

Merged
merged 3 commits into from
Oct 12, 2023

Conversation

WilsonZiweiWang
Copy link
Collaborator

What it does:

  1. Create a parser using the .wasm file generated from here
  2. Create an analyzer that utilizes the parser to do the parsing
  3. Currently, it gets the declarations from the tree generated by parsing the document and uses them to create completion items
  4. It shows errors in erroneous code. This does not show any details about the error for now. I only display the error when the tree says it is an error.

This PR is greatly inspired by bash-language-server. You can refer to it for more details.

@WilsonZiweiWang
Copy link
Collaborator Author

I will be working on the completions according to the list in the Redmine ticket as well as the tests while this PR is being reviewed as it is a lot to digest.

@WilsonZiweiWang WilsonZiweiWang self-assigned this Oct 11, 2023
Copy link
Member

@idillon-sfl idillon-sfl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed eslint gives a lot of errors

README.md Outdated Show resolved Hide resolved
server/src/server.ts Outdated Show resolved Hide resolved
server/src/server.ts Outdated Show resolved Hide resolved
@WilsonZiweiWang WilsonZiweiWang force-pushed the Feature-10095-Improve-code-completion branch from fa3de16 to 037e73a Compare October 12, 2023 00:30
@WilsonZiweiWang
Copy link
Collaborator Author

I noticed eslint gives a lot of errors

I fixed most of them, but some just don't make sense to me and they are annoying to fix. It's been too strict IMO. One of them tells me to use interface instead of type where it really doesn't matter much. For the ones that can be fixed by a single click on format document, I am all good. But I think we need to make the eslint rules a bit more flexible.

Copy link
Member

@deribaucourt deribaucourt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Would be nice if you could fix the eslint rules or errors.

@WilsonZiweiWang WilsonZiweiWang force-pushed the Feature-10095-Improve-code-completion branch 2 times, most recently from 41bc752 to 4158cdb Compare October 12, 2023 15:23
@WilsonZiweiWang
Copy link
Collaborator Author

LGTM. Would be nice if you could fix the eslint rules or errors.

Those eslint errors should be gone.

@WilsonZiweiWang WilsonZiweiWang force-pushed the Feature-10095-Improve-code-completion branch from 4158cdb to 5416816 Compare October 12, 2023 20:41
1. Use tree-sitter parser to get declarations and
create completion items from them
2. Show error on erroneous nodes (No details for now)
3. Debounce analyze function
@WilsonZiweiWang WilsonZiweiWang force-pushed the Feature-10095-Improve-code-completion branch from 5416816 to 95d5626 Compare October 12, 2023 20:42
@WilsonZiweiWang WilsonZiweiWang merged commit 9901584 into staging Oct 12, 2023
@WilsonZiweiWang WilsonZiweiWang deleted the Feature-10095-Improve-code-completion branch October 12, 2023 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants