Skip to content

Commit

Permalink
remove unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
ecmel committed Nov 7, 2024
1 parent 4c7010d commit 3079f5d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ All notable changes to the **kdb VS Code extension** are documented in this file
### Enhancements

- Semantic highlighting for local variables
- Display version of Insights server connected
- Display version of connected Insights server

### Fixes

- Fix for results tab flickering , improving of UX
- Fix for Issue [#382](https://github.com/KxSystems/kx-vscode/issues/382)
- Fix for run q file not using the current editor contents
- Fix for autocomplete for new and unsaved documents
- Fix for results tab

### Internal Improvements

Expand Down
4 changes: 0 additions & 4 deletions server/src/parser/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,6 @@ export function ordered(token: Token, next: Token) {
return (token.order && next.order && next.order > token.order) || false;
}

export function callable(token: Token) {
return token.assignment && token.assignment[1]?.tokenType === LCurly;
}

export function assigned(token: Token) {
return token.assignment && token.assignment[1];
}
Expand Down
6 changes: 3 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ export async function activate(context: ExtensionContext) {
commands.registerCommand(
"kdb.createDataSource",
async (item: FileTreeItem) => {
if (hasWorkspaceOrShowOption()) {
if (hasWorkspaceOrShowOption("adding datasources")) {
const uri = await addWorkspaceFile(item, "datasource", ".kdb.json");

if (uri) {
Expand Down Expand Up @@ -501,7 +501,7 @@ export async function activate(context: ExtensionContext) {
commands.registerCommand(
"kdb.createScratchpad",
async (item: FileTreeItem) => {
if (hasWorkspaceOrShowOption()) {
if (hasWorkspaceOrShowOption("adding workbooks")) {
const uri = await addWorkspaceFile(item, "workbook", ".kdb.q");
if (uri) {
await window.showTextDocument(uri);
Expand All @@ -513,7 +513,7 @@ export async function activate(context: ExtensionContext) {
commands.registerCommand(
"kdb.createPythonScratchpad",
async (item: FileTreeItem) => {
if (hasWorkspaceOrShowOption()) {
if (hasWorkspaceOrShowOption("adding workbooks")) {
const uri = await addWorkspaceFile(item, "workbook", ".kdb.py");
if (uri) {
await window.showTextDocument(uri);
Expand Down
7 changes: 5 additions & 2 deletions src/utils/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -635,12 +635,15 @@ export function formatTable(headers_: any, rows_: any, opts: any) {
return result.join("\n");
}

export function hasWorkspaceOrShowOption() {
export function hasWorkspaceOrShowOption(action: string) {
if (workspace.workspaceFolders && workspace.workspaceFolders.length > 0) {
return true;
}
window
.showWarningMessage("No workspace folder is opened.", "Open")
.showWarningMessage(
`No workspace folder is open. Please open a folder to enable ${action}.`,
"Open",
)
.then((res) => {
if (res === "Open") {
commands.executeCommand("workbench.action.files.openFolder");
Expand Down

0 comments on commit 3079f5d

Please sign in to comment.