Skip to content

feat: added keyword and built-in completion#490

Merged
JalonSolov merged 2 commits intovlang:masterfrom
cadamsdev:feat/keyword-builtin-completion
Mar 22, 2026
Merged

feat: added keyword and built-in completion#490
JalonSolov merged 2 commits intovlang:masterfrom
cadamsdev:feat/keyword-builtin-completion

Conversation

@cadamsdev
Copy link
Contributor

Preview

Keywords

Screenshot 2026-03-21 at 10 49 26 PM Screenshot 2026-03-21 at 10 49 41 PM Screenshot 2026-03-21 at 10 51 29 PM

Built-in functions (example println)

Screenshot 2026-03-21 at 10 49 55 PM

@cadamsdev cadamsdev marked this pull request as ready for review March 22, 2026 02:57
const v_builtins = ['close', 'copy', 'eprintln', 'eprint', 'error', 'error_with_code', 'exit',
'flush_stderr', 'flush_stdout', 'free', 'isnil', 'panic', 'print', 'println']

fn make_keyword_completions() []Detail {
Copy link
Contributor

Choose a reason for hiding this comment

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

Hard-coding these seems like a "code smell". I know the lists shouldn't change that much, but isn't there a way to get this info from the compiler, instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah I believe we'll need to add a compiler flag to get that info.

Copy link
Contributor

Choose a reason for hiding this comment

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

Personally, that would be my preference. Perhaps the current JSON output could be modified to include the type, rather than needing to add a new option.

If it already includes the type, then vls isn't using it. :-\

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok I'll try that. 👍

@JalonSolov
Copy link
Contributor

Conflict to resolve after other PR merged.

@JalonSolov JalonSolov merged commit ba0ac47 into vlang:master Mar 22, 2026
3 checks passed
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.

2 participants