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

Feat: Add more completion items & Tests #26

Merged
merged 16 commits into from
Oct 20, 2023

Conversation

WilsonZiweiWang
Copy link
Collaborator

@WilsonZiweiWang WilsonZiweiWang commented Oct 13, 2023

This PR adds the following:

  1. Reserved variables
  2. Reserved keywords (currently they include python and shell keywords)
  3. Simple snippets for bitbake recipe tasks

I keep the reserved variables as the fallback in case the docs scanner fails to read them in the bitbake folder.

@WilsonZiweiWang WilsonZiweiWang added the enhancement New feature or request label Oct 13, 2023
@WilsonZiweiWang WilsonZiweiWang self-assigned this Oct 13, 2023
@WilsonZiweiWang
Copy link
Collaborator Author

WilsonZiweiWang commented Oct 16, 2023

Added initial tests for completions and analyzer. Some changes are made to the server for the convenience of testing.

Run npm run test to test

@WilsonZiweiWang WilsonZiweiWang marked this pull request as ready for review October 16, 2023 20:41
server/src/__tests__/analyzer.test.ts Show resolved Hide resolved
server/src/__tests__/analyzer.test.ts Show resolved Hide resolved
server/src/connectionHandlers/onCompletion.ts Outdated Show resolved Hide resolved
server/src/tree-sitter/analyzer.ts Outdated Show resolved Hide resolved
server/src/tree-sitter/analyzer.ts Show resolved Hide resolved
server/src/completions/reserved-keywords.ts Outdated Show resolved Hide resolved
server/src/completions/reserved-variables.ts Outdated Show resolved Hide resolved
server/src/completions/snippets.ts Outdated Show resolved Hide resolved
server/src/completions/snippets.ts Outdated Show resolved Hide resolved
@WilsonZiweiWang WilsonZiweiWang changed the title Feat: Add more completion items Feat: Add more completion items & Tests Oct 17, 2023
@WilsonZiweiWang WilsonZiweiWang force-pushed the Feature-10095-Improve-code-completion branch from dd58ee5 to bf48fe4 Compare October 17, 2023 16:18
1. Add reserved variables
2. Add reserved keywords (currently they include python
and shell keywords)
3. Add simple snippets for bitbake recipe tasks
1. Export an instance of analyzer from the source file and
use this instance through out the program
2. Move the handler function for onCompletion event to its own
file for the convenience of testing
@WilsonZiweiWang
Copy link
Collaborator Author

Added more tasks and documentation from Yocto.
Sample result:
image

@WilsonZiweiWang
Copy link
Collaborator Author

Enable suggestion when inside variable expansion.
Sample result:
image

@WilsonZiweiWang
Copy link
Collaborator Author

This change touches the setting at the workspace level, if we are ok with this approach, I'll add tests accordingly.

@WilsonZiweiWang WilsonZiweiWang added the question Further information is requested label Oct 18, 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.

Looks good to me!

server/src/server.ts Outdated Show resolved Hide resolved
server/src/tree-sitter/analyzer.ts Outdated Show resolved Hide resolved
server/src/completions/snippets.ts Show resolved Hide resolved
server/src/__tests__/completions.test.ts Show resolved Hide resolved
server/src/completions/snippets.ts Show resolved Hide resolved
server/src/completions/snippets.ts Show resolved Hide resolved
server/src/completions/reserved-keywords.ts Outdated Show resolved Hide resolved
server/src/completions/reserved-keywords.ts Show resolved Hide resolved
server/src/completions/reserved-variables.ts Outdated Show resolved Hide resolved
@WilsonZiweiWang WilsonZiweiWang force-pushed the Feature-10095-Improve-code-completion branch from f581ef3 to 48c3bff Compare October 19, 2023 15:16
@WilsonZiweiWang WilsonZiweiWang merged commit a396aaf into staging Oct 20, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants