Reuse the DocumentSymbolProvider implementation to provider Code completion
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
@mscheblein what do you think ?
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).
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)
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.
This was easier than expected. My Branch https://github.com/mscheblein/vscode-abl/tree/CodeCompletion now has simple but working code completion.
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.