Skip to content

Commit 664aab2

Browse files
author
nathanielCherian
committed
fix providers
1 parent 3adac8d commit 664aab2

4 files changed

Lines changed: 4 additions & 60 deletions

File tree

examples/next.cash

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ contract P2PKH() {
44
function spend() {
55
// bytes2 left, bytes2 right = 0x123456.split(2);
66
// require(left == right);
7-
8-
require(tx.outputs[0].value == tx.inputs[this.activeInputIndex].value - 1000);
7+
require(tx.outputs[0].value == tx.inputs[this.activeInputIndex].value - 10*10);
98
}
109
}

src/CashscriptCompletionProvider.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ export default class CashscriptCompletionProvider implements vscode.CompletionIt
6262
if(arr[2]) keyword+="_indexed"; // ex. inputs[0].
6363
console.log("keyword: ", keyword);
6464

65-
// return [{
66-
// label:keyword,
67-
// kind:CompletionItemKind.Field
68-
// }]
6965
return DOT_COMPLETIONS[keyword];
7066
}
7167

src/CashscriptHoverProvider.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ class CashscriptHoverProvider implements vscode.HoverProvider{
2525
const miscel = this.getMiscellaneousHovers(document, position);
2626
if(miscel) return new vscode.Hover(miscel, range)
2727

28-
const dotHovers = this.getTxDotHovers(document, position);
29-
if(dotHovers) return new vscode.Hover(dotHovers, range)
28+
// const dotHovers = this.getTxDotHovers(document, position);
29+
// if(dotHovers) return new vscode.Hover(dotHovers, range)
3030

3131

3232
return null;
@@ -83,12 +83,12 @@ class CashscriptHoverProvider implements vscode.HoverProvider{
8383
return matches[1];
8484
}
8585

86+
// NEED TO UPDATE THIS AFTER NEW DOCS COME OUT
8687
getTxDotHovers(document:vscode.TextDocument, position:vscode.Position):vscode.MarkdownString[]{
8788
const reg = /tx.[a-zA-Z0-9]+/;
8889
let range = document.getWordRangeAtPosition(position, reg);
8990
let word = document.getText(range).substring(3);
9091

91-
// /### tx.(\w+)\n+```solidity\n(.+)\n```/
9292
const TX_HOVERS = {
9393
time:{
9494
code:'require(tx.time >= <expression>);'

src/LanguageDesc.ts

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -110,57 +110,6 @@ let TYPECASTS:Data = {
110110
let LANGUAGE:Data = {...GLOBAL_FUNCTIONS, ...OUTPUT_INSTANTIATION, ...STATEMENTS};
111111

112112

113-
/*
114-
{
115-
label:"time",
116-
kind:CompletionItemKind.Field,
117-
},
118-
{
119-
label:"age",
120-
kind:CompletionItemKind.Field
121-
},
122-
{
123-
label:"version",
124-
kind:CompletionItemKind.Field
125-
},
126-
{
127-
label:"hashPrevouts",
128-
kind:CompletionItemKind.Field
129-
},
130-
{
131-
label:"hashSequence",
132-
kind:CompletionItemKind.Field
133-
},
134-
{
135-
label:"outpoint",
136-
kind:CompletionItemKind.Field
137-
},
138-
{
139-
label:"bytecode",
140-
kind:CompletionItemKind.Field
141-
},
142-
{
143-
label:"value",
144-
kind:CompletionItemKind.Field
145-
},
146-
{
147-
label:"sequence",
148-
kind:CompletionItemKind.Field
149-
},
150-
{
151-
label:"hashOutputs",
152-
kind:CompletionItemKind.Field
153-
},
154-
{
155-
label:"locktime",
156-
kind:CompletionItemKind.Field
157-
},
158-
{
159-
label:"hashtype",
160-
kind:CompletionItemKind.Field
161-
},
162-
*/
163-
164113
let DOT_COMPLETIONS:{[key:string]:CompletionItem[]} = {
165114
tx:[
166115
{

0 commit comments

Comments
 (0)