Skip to content

Commit

Permalink
feat: add vizualization type for VsCode plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
stanimirovv committed Nov 7, 2023
1 parent e444483 commit 14640cc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 10 additions & 3 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
#!/usr/bin/env node

import { evaluateSearchQuery } from './src/evaluator'
import { evaluateSearchQuery, type FunctionDetail } from './src/evaluator'
import { parse } from './src/lexer'
import { prettify } from './src/prettyfier'

const tsConfigFilePath = process.argv[2]
const userSearchQuery = process.argv[3]

export function tsoogle (tsConfigFilePath: string, userSearchQuery: string): string {
export function tsoogle (tsConfigFilePath: string, userSearchQuery: string): FunctionDetail[] {
const searchQuery = parse(userSearchQuery)
return evaluateSearchQuery(tsConfigFilePath, searchQuery)
}

export function tsoogleCmd (tsConfigFilePath: string, userSearchQuery: string): string {
const searchQuery = parse(userSearchQuery)
let output = ''
evaluateSearchQuery(tsConfigFilePath, searchQuery).forEach(func => {
Expand All @@ -16,4 +21,6 @@ export function tsoogle (tsConfigFilePath: string, userSearchQuery: string): str
return output
}

console.log(tsoogle(tsConfigFilePath, userSearchQuery))
if (tsConfigFilePath !== undefined && userSearchQuery !== undefined) {
console.log(tsoogleCmd(tsConfigFilePath, userSearchQuery))
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@stanimirovv/tsoogle",
"version": "1.0.4",
"version": "1.0.7",
"description": "Find functions or methods by approximate signature - return type, argument types or both. Supports optional arguments, rest arguments and partial type checking.",
"main": "dist/index.js",
"bin": "dist/index.js",
Expand Down

0 comments on commit 14640cc

Please sign in to comment.