Skip to content

add autocomplete and hover hints#47

Open
mr-zwets wants to merge 2 commits intomainfrom
autocompletion
Open

add autocomplete and hover hints#47
mr-zwets wants to merge 2 commits intomainfrom
autocompletion

Conversation

@mr-zwets
Copy link
Member

@mr-zwets mr-zwets commented Feb 5, 2026

closes #8

@vercel
Copy link
Contributor

vercel bot commented Feb 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cashscript-playground Ready Ready Preview, Comment Feb 5, 2026 11:23am

Request Review

Copy link
Member

@rkalis rkalis left a comment

Choose a reason for hiding this comment

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

There's some things we should fix.

];

// Generate bytes1-bytes32
for (let i = 1; i <= 32; i++) {
Copy link
Member

Choose a reason for hiding this comment

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

Let's double check if there is a way to allow dynamic types so that any bytesX works e.g. bytes420.

];

// Keywords
export const keywords: CompletionItemData[] = [
Copy link
Member

Choose a reason for hiding this comment

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

Add loops to this once they're out

// Check for bytes methods (identifier followed by dot)
// This is a heuristic - we show bytes methods after any identifier followed by a dot
// that doesn't match the above patterns
if (/\b\w+\s*\.\s*\w*$/.test(lineUntilPosition)) {
Copy link
Member

Choose a reason for hiding this comment

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

Would be nice if there is some way that we can be sure that these only show on the correct type.

];

// this.* properties
export const thisProperties: CompletionItemData[] = [
Copy link
Member

Choose a reason for hiding this comment

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

this.age is missing here

// Extract local variable declarations
// Pattern: type varName = expression;
// CashScript types: int, bool, string, bytes, bytes1-32, pubkey, sig, datasig
const typePattern = '(?:int|bool|string|bytes(?:[1-9]|[12][0-9]|3[0-2])?|pubkey|sig|datasig)';
Copy link
Member

Choose a reason for hiding this comment

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

The bytesX regex looks very strange, this should just allow bytesX where X is any number.

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.

proper auto-completion

2 participants