Skip to content

Commit

Permalink
Add keywords to completion data
Browse files Browse the repository at this point in the history
  • Loading branch information
nobodywasishere committed Feb 20, 2024
1 parent 592999d commit 8762d7b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/completion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import {
} from 'vscode';
import globals from './definitions/globals';
import methods from './definitions/methods';
import { KEYWORDS } from './definitions/index';

const COMPLETION_KEYWORDS: string[][] = KEYWORDS.map((kw) => [kw, ""])

class CrystalCompletionItemProvider implements CompletionItemProvider {
private completions: CompletionItem[];
Expand All @@ -29,6 +32,7 @@ class CrystalCompletionItemProvider implements CompletionItemProvider {

// TODO: These should be added where types or classes are appropriate
if (context.triggerCharacter == " ") {
this.push(COMPLETION_KEYWORDS, SymbolKind.Key);
this.push(globals.CLASSES, SymbolKind.Class);
this.push(globals.MODULES, SymbolKind.Module);
this.push(globals.STRUCTS, SymbolKind.Struct);
Expand Down

0 comments on commit 8762d7b

Please sign in to comment.