Skip to content

Commit

Permalink
Add CallDetails #10
Browse files Browse the repository at this point in the history
  • Loading branch information
RedCMD committed Oct 25, 2024
1 parent 25e415a commit 36b164a
Show file tree
Hide file tree
Showing 6 changed files with 373 additions and 30 deletions.
14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -287,22 +287,22 @@
{
"command": "textmate.goto.file",
"group": "inline@2",
"when": "view == TextMate"
"when": "view == TextMate || view == TextMate-Call"
},
{
"command": "textmate.goto.grammar",
"group": "inline@3",
"when": "view == TextMate"
"when": "view == TextMate || view == TextMate-Call"
},
{
"command": "textmate.goto.file",
"group": "0_navigation@1",
"when": "view == TextMate"
"when": "view == TextMate || view == TextMate-Call"
},
{
"command": "textmate.goto.grammar",
"group": "0_navigation@2",
"when": "view == TextMate"
"when": "view == TextMate || view == TextMate-Call"
}
]
},
Expand All @@ -326,6 +326,12 @@
"category": "TextMate",
"icon": "assets/TextMate-file-icon.svg"
},
{
"command": "textmate.call.details",
"title": "Show Call Details",
"category": "TextMate",
"icon": "$(link-external)"
},
{
"command": "textmate.goto.file",
"title": "Go To File",
Expand Down
4 changes: 3 additions & 1 deletion src/ITextMate.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ interface IRegExpSourceAnchorCache {
}

type RegExpSource<TRuleId = RuleId | typeof endRuleId> = {

readonly source: string;
readonly ruleId: TRuleId;
readonly hasAnchor: boolean;
Expand All @@ -107,6 +106,8 @@ type IRegExpSourceListAnchorCache<TRuleId> = {
readonly A1_G1: CompiledRule<TRuleId> | null,
};
export type CompiledRule<TRuleId = RuleId | typeof endRuleId> = {
readonly regExps: string[];
readonly rules: RuleId[];
readonly scanner: vscodeOniguruma.OnigScanner;
};
export type RegExpSourceList<TRuleId = RuleId | typeof endRuleId> = {
Expand Down Expand Up @@ -162,6 +163,7 @@ interface IOnigCaptureIndex {
export type IMatchResult = {
readonly captureIndices: IOnigCaptureIndex[];
readonly matchedRuleId: RuleId;
readonly linePos: number;
readonly time: number;
readonly anchorPosition: number;
};
Expand Down
3 changes: 3 additions & 0 deletions src/Providers/DefinitionProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ let previous: {
definitions: vscode.DefinitionLink[];
};

export let gotoLocationsBroken = false;


export const DefinitionProvider: vscode.DefinitionProvider = {
async provideDefinition(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken): Promise<vscode.DefinitionLink[]> {
// vscode.window.showInformationMessage(JSON.stringify("Definition"));
gotoLocationsBroken = true;

const uriString = document.uri.toString();
if (previous &&
Expand Down
Loading

0 comments on commit 36b164a

Please sign in to comment.