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

Reuse the DocumentSymbolProvider implementation to provider Code completion #32

Open
chriscamicas opened this issue Apr 9, 2019 · 6 comments

Comments

@chriscamicas
Copy link
Owner

We should be able to implement a minimal code completion service with the symbol already extracted with the document symbol provider
https://code.visualstudio.com/api/references/vscode-api#CompletionItemProvider

@chriscamicas
Copy link
Owner Author

@mscheblein what do you think ?

@mscheblein
Copy link
Contributor

One would need to figure out what type of code fragment the user is editing to present a filtered list of symbols. Symbol Provider cant do that, but i think the code may be modified to do that. Another Problem is that a lot of ABL specific stuff (Buffers, Frame, Menue ...) are just defined as vscode.SymbolKind.Object, as VS does not provide appropriate Symbols. We might have to add more Symbols (in an Upgrade Save way).

@chriscamicas
Copy link
Owner Author

a filtered list can come in a second time
We should split the parser code from the classification. The parser would identify ABL objects with their real type/nature (Buffers, Frame, etc.), and the SymbolProvider could then categorize them differently (Buffer+Frame=> Object)

@mscheblein
Copy link
Contributor

It appears that VSCode filters the CompletionItemList by whatever Character(s) the User has entered. The most simple implementation is to just return the name of the Symbols generated by the SymbolProvider. I will try this out, should be easy enough.

@mscheblein
Copy link
Contributor

This was easier than expected. My Branch https://github.com/mscheblein/vscode-abl/tree/CodeCompletion now has simple but working code completion.

@chriscamicas
Copy link
Owner Author

Brilliant! great job, I tested it, it works just fine for variables but not for 'object' such as TempTable or Buffer, and I just found out why,
I think you could treat vscode.SymbolKind.Object as a vscode.CompletionItemKind.Variable (Javascript object are considered variables too) in the ParseType2ItemKind function.

I think, we should continue this discussion in a PR.

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

2 participants