-
Notifications
You must be signed in to change notification settings - Fork 764
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
Initial and *extremely* basic completions #435
Conversation
return Task.FromResult(new CompletionList(completions, isIncomplete: false)); | ||
} | ||
|
||
public override Task<CompletionItem> Handle(CompletionItem request, CancellationToken cancellationToken) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The handle and can resolve are not used by us. They are intended to delay construction of documentation. Right now, we don't need it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
H he h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov Report
@@ Coverage Diff @@
## master #435 +/- ##
==========================================
- Coverage 91.93% 91.06% -0.87%
==========================================
Files 199 201 +2
Lines 6708 6784 +76
==========================================
+ Hits 6167 6178 +11
- Misses 541 606 +65
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
||
private IEnumerable<CompletionItem> GetPrimitiveTypeCompletions() => LanguageConstants.DeclarationTypes.Values.Select(CreateTypeCompletion); | ||
|
||
private IEnumerable<Symbol> GetAccessibleSymbols(SemanticModel model) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Next iterations will move this code into the core because it's related to how namespace lookups work during name binding. The dictionary is here to effectively remove inaccessible symbols from completion list. (Declaring a parameter called concat
will prevent the concat()
function from appearing in the list of completions.
Added (as the title says) extremely basic completions support. The suggested completions currently include keywords, existing keyword snippets, primitive types and names of accessible symbols (vars, params, resources, and functions).
Limitations:
We have to start here because implementing a completion handler in the language server completely removes the built-in completions which provide some help right now.
Next steps:
required
metadata in swaggers.